wuyouming666
2023-09-18 c07b4f92f7598b6f69d4c709d6651aeab24e69e1
增加修改电气密码
17个文件已修改
1个文件已删除
217 ■■■■ 已修改文件
CanadaMes-ui/src/api/home.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/api/user.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/en-US.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/zh-CN.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/layout/index.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/router/index.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Action.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Parameter.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/device/talkvue.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/user/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/DefaultController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/UserController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/User.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/vo/Result.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/vo/UserVo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/UserService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/impl/UserServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/com/example/springboot/mapper/UserMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/api/home.js
@@ -12,6 +12,13 @@
        data
    })
}
export function SelectPassword() {
return request({
url: '/home/SelectPassword',
 method: 'get',
 data :""
  })
    }
export function home2(data) {
    return request({
        url: '/home/loads',
CanadaMes-ui/src/api/user.js
@@ -22,6 +22,14 @@
   })
}
export function yanzhengmima(data) {
    return request({
        url: '/api/user/verifyPassword',
        method: 'post',
        data
    })
 }
/**
 * 注册
CanadaMes-ui/src/lang/locales/en-US.json
@@ -274,6 +274,7 @@
  "Are you sure to perform this operation ?":"Are you sure to perform this operation ?",
  "prompt":"prompt",
  "Yes":"Yes",
  "No":"No"
  "No":"No",
  "ElectricalPassword":"ElectricalPassword"
}
CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -278,5 +278,6 @@
  "alarmid": "id",
  "alacontent": "报警内容",
  "time-on": "开始时间",
  "End-Time": "结束时间"
  "End-Time": "结束时间",
  "ElectricalPassword":"电气密码"
}
CanadaMes-ui/src/layout/index.vue
@@ -13,12 +13,12 @@
                      background-color="#222f3e" text-color="#fff" active-text-color="#ffd04b"
                      :collapse="isCollapse" :unique-opened="true"
                      :collapse-transition="false" :router="true">
              <!-- <el-menu-item index="/" @click="goToHome">
             <!-- <el-menu-item index="/" @click="youhua">
                <template slot="title">
               
                  <i class="el-icon-menu"></i>
                
                  <span>{{ $t('home') }}</span>
                  <span>优化</span>
                </template>
              </el-menu-item> -->
              <!--一级菜单-->
@@ -157,6 +157,9 @@
    goToHome() {
      this.$router.push('/home');
    },
    youhua() {
      this.$router.push('/device/talk');
    },
    ...mapMutations('tags', ['addTag', 'removeTag', 'switchTag']),
    addTag(router) {
  let submenuItem;
CanadaMes-ui/src/router/index.js
@@ -33,6 +33,7 @@
        path: '/home',
        component: () => import('../views/home')
      },
      {
@@ -48,11 +49,7 @@
        component: () => import('../views/device/parameter'),
      },
      {
        path: '/device/talk',
        component: () => import('../views/device/talkvue'),
      },
      {
        path: '/device/alarm',
        component: () => import('../views/device/alarm')
@@ -61,10 +58,7 @@
        path: '/device/iostate',
        component: () => import('../views/device/iostate')
      },
      {
        path: '/device/talkvue',
        component: () => import('../views/device/talkvue')
      },
      {
        path: '/device/control',
        component: () => import('../views/device/control')
CanadaMes-ui/src/views/Electrical/Action.vue
@@ -26,6 +26,7 @@
</template>
 
<script >
import { SelectPassword } from "../../api/home";
import LanguageMixin from '../../lang/LanguageMixin'
let socket;
export default {
@@ -108,6 +109,27 @@
  },
  created () {
    this.init();
    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) {
      // 密码正确,执行相应操作
    } else {
      this.$message.success(this.$t('Password error')); // 密码错误
    }
  }).catch(() => {
    this.$message({
      type: 'info',
      message: this.$t('Operation canceled')
    });
  });
  },
  methods: {
    setActiveButton(buttonName) {
CanadaMes-ui/src/views/Electrical/Parameter.vue
@@ -25,10 +25,19 @@
      </div>
    </el-form>
    <div>
  </div>
  </div>
</template>
<script>
import { SelectPassword } from "../../api/home";
let socket;
import LanguageMixin from '../../lang/LanguageMixin'
export default {
@@ -36,6 +45,8 @@
  mixins: [LanguageMixin],
  data () {
    return {
      dialogVisible: true,
      password: '',
      activeButton: '',
      record: {
        params: [100, 200, 10, 10, 10, 10],
@@ -69,8 +80,33 @@
  created () {
    this.initWebSocket();
    this.isButtonDisabled = true;
    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) {
      // 密码正确,执行相应操作
    } else {
      this.$message.success(this.$t('Password error')); // 密码错误
    }
  }).catch(() => {
    this.$message({
      type: 'info',
      message: this.$t('Operation canceled')
    });
  });
  },
  methods: {
    setActiveButton(buttonName) {
      this.activeButton = buttonName;
    },
CanadaMes-ui/src/views/device/talkvue.vue
File was deleted
CanadaMes-ui/src/views/user/index.vue
@@ -123,6 +123,9 @@
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('ElectricalPassword')" prop="dianqimima">
        <el-input   v-model="editUserForm.dianqimima"></el-input>
      </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="editDialogVisible = false">{{ $t('langCancel') }}</el-button>
@@ -174,11 +177,8 @@
        password: [
          { required: true, message: '请输入密码', trigger: 'blur' },
          { min: 5, max: 15, message: '长度在 5 到 15 个字符', trigger: 'blur' }
        ],
        email: [
          { required: true, message: '请输入邮箱', trigger: 'blur' },
          { type: 'email', message: '请输入正确格式的邮箱地址', trigger: 'blur' }
        ]
      },
      // 控制添加用户弹框的显示和隐藏
      addDialogVisible: false,
springboot-vue3/src/main/java/com/example/springboot/controller/DefaultController.java
@@ -55,7 +55,7 @@
    }
    @ApiOperation(value = "登录")
    @CrossOrigin(origins = "http://localhost:8080", allowCredentials = "true")
    @PostMapping("/login")
    public Result login(@RequestBody UserVo userVO) {
        ValidatorUtil.validateEntity(userVO);
springboot-vue3/src/main/java/com/example/springboot/controller/UserController.java
@@ -167,4 +167,13 @@
    private class UpdatePasswordRequest {
    }
}
springboot-vue3/src/main/java/com/example/springboot/entity/User.java
@@ -34,12 +34,13 @@
    @NotBlank(message = "密码不能为空")
    @ApiModelProperty("密码")
    private String password;
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    @ApiModelProperty("邮箱")
    private String email;
    @ApiModelProperty("qq")
    private String qq;
    @ApiModelProperty("电气密码")
    private String dianqimima;
    @ApiModelProperty("联系电话")
    private String phone;
    @ApiModelProperty("状态 0/禁止 1/正常")
springboot-vue3/src/main/java/com/example/springboot/entity/vo/Result.java
@@ -9,6 +9,8 @@
    private Object data;
    public static Result success(Object data) {
        Result result = new Result();
        result.setCode(1);
springboot-vue3/src/main/java/com/example/springboot/entity/vo/UserVo.java
@@ -18,6 +18,7 @@
    private String username;
    @NotBlank(message = "密码不能为空")
    private String password;
    private String dianqimima;
    private String email;
    private String qq;
    private String phone;
@@ -25,4 +26,5 @@
    private Date createTime;
    private Date updateTime;
}
springboot-vue3/src/main/java/com/example/springboot/service/UserService.java
@@ -16,4 +16,6 @@
    List<Long> selectChild(Long id, Boolean bool);
    User getByDianqimima(String newPassword);
}
springboot-vue3/src/main/java/com/example/springboot/service/impl/UserServiceImpl.java
@@ -42,7 +42,12 @@
    public User selectByUsername(String username) {
        return lambdaQuery().select(User::getId, User::getRoleId, User::getUsername, User::getPassword, User::getState).eq(User::getUsername, username).one();
    }
    public User getByDianqimima(String newPassword) {
        return lambdaQuery().select(User::getPassword).one();
    }
    public User getByUser(String admin) {
        return lambdaQuery().select(User::getUsername).one();
    }
    public Integer countByUsername(String username) {
        return lambdaQuery().eq(User::getUsername, username).count();
    }
springboot-vue3/src/main/resources/com/example/springboot/mapper/UserMapper.xml
@@ -13,6 +13,7 @@
               u.qq          qq,
               u.phone       phone,
               u.state       state,
               u.dianqimima       dianqimima,
               u.create_time createTime
        from user u
        <where>