wu
2023-09-20 1c5e44cdff0f7900914a883056d93979265e306f
删除不需要的代码,parameter、action页不需要输入密码
3个文件已修改
61 ■■■■■ 已修改文件
CanadaMes-ui/src/views/Electrical/Action.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Parameter.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/UserController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Action.vue
@@ -17,7 +17,7 @@
      <div class="kuai_div" v-for="(item, index) in record.xyData" :key="index">
        <el-input v-model="item.name" style="width: 240px;" class="in_mc" readonly></el-input>
        <el-switch v-model="item.value" active-value="1" inactive-value="0"  @change="send()"></el-switch>
        <el-switch v-model="item.value" active-value="1" inactive-value="0" @change="send()"></el-switch>
      </div>
    </el-form>
@@ -27,7 +27,6 @@
 
<script > 
import LanguageMixin from '../../lang/LanguageMixin'
import { SelectPassword } from "../../api/home";
let socket;
export default {
  name: "Action",
@@ -35,7 +34,6 @@
  data () {
    return {
      activeButton: '',
      record: {
        params: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        canshu: [
@@ -109,9 +107,7 @@
    }
  },
  created () {
    this.init(); 
  },
  methods: {
    setActiveButton(buttonName) {
@@ -170,36 +166,9 @@
    },
    send () {
      SelectPassword().then(res => {
 this.password = res.data.password;
});
    this.$prompt(this.$t('Are you sure to perform this operation?'), this.$t('prompt'), {
    inputType: 'password',
    inputPlaceholder: this.$t('Please enter the password'),
    confirmButtonText: this.$t('Yes'),
    cancelButtonText: this.$t('No'),
    type: 'warning'
  }).then(({ value }) => {
    if (this.password === value) {
      // 密码正确,执行相应操作
      this.messagepack.data = this.record.xyData.map(item => parseInt(item.value)); // 转换为整数数组
      //console.log(this.messagepack);
      socket?.send(JSON.stringify(this.messagepack));
    } else {
      this.$message.success(this.$t('Password error')); // 密码错误
    }
  }).catch(() => {
    this.$message({
      type: 'info',
      message: this.$t('Operation canceled')
    });
  });
    }
  }
CanadaMes-ui/src/views/Electrical/Parameter.vue
@@ -39,7 +39,6 @@
let socket;
import LanguageMixin from '../../lang/LanguageMixin'
import { SelectPassword } from "../../api/home";
export default {
  name: "Parameter",
  mixins: [LanguageMixin],
@@ -79,9 +78,7 @@
  created () {
    this.initWebSocket();
    this.isButtonDisabled = true; 
  },
  methods: {
   
@@ -161,32 +158,9 @@
      }
    },
    send () {
      SelectPassword().then(res => {
 this.password = res.data.password;
});
    this.$prompt(this.$t('Are you sure to perform this operation?'), this.$t('prompt'), {
    inputType: 'password',
    inputPlaceholder: this.$t('Please enter the password'),
    confirmButtonText: this.$t('Yes'),
    cancelButtonText: this.$t('No'),
    type: 'warning'
  }).then(({ value }) => {
    if (this.password === value) {
      // 密码正确,执行相应操作
      this.messagepack.data = this.record.xyData.map((item) => parseInt(item.value2)); // 转换为整数数组
      //console.log(this.messagepack);
      socket?.send(JSON.stringify(this.messagepack));
    } else {
      this.$message.success(this.$t('Password error')); // 密码错误
    }
  }).catch(() => {
    this.$message({
      type: 'info',
      message: this.$t('Operation canceled')
    });
  });
    },
    handleChange (index, value) {
      this.record.xyData[index].value = value;
springboot-vue3/src/main/java/com/example/springboot/controller/UserController.java
@@ -108,7 +108,7 @@
    @RequiresRoles({"admin"})
    @RequiresPermissions({"user:update", "user:add"})
    public Result saveOrUpdate(@RequestBody User user) {
        if ("admin".equals(user.getUsername()) && user.getState() == 0) {
        if ("admin".equals(user.getUsername())) {
            return Result.fail("管理员不可以被禁用");
        }
        Integer count = userService.lambdaQuery()