zhaoxiaoqiang
2023-09-05 bf8866e5048a23436f3c7eddba9c75196f805fef
密码设置
2 files modified
71 ■■■■ changed files
src/views/account-management/account-list.vue 63 ●●●● patch | view | raw | blame | history
src/views/login/index.vue 8 ●●●●● patch | view | raw | blame | history
src/views/account-management/account-list.vue
@@ -2,7 +2,7 @@
 * @Author: 小明丶
 * @Date: 2020-05-11 17:38:01
 * @LastEditors: zhaoxiaoqiang 287285524@qq.com
 * @LastEditTime: 2023-09-05 17:01:35
 * @LastEditTime: 2023-09-05 17:46:59
 * @Description: 账户管理
 -->
<template>
@@ -38,7 +38,7 @@
        <el-form-item label="用户名称:" prop="name">
          <el-input
            v-model.trim="creatForm.name"
            maxlength="20"
            maxlength="30"
            autocomplete="off"
            placeholder="请输入用户名称"
          ></el-input>
@@ -62,27 +62,6 @@
                :value="item.roleId">
              </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="密码:"  v-show="title !== '编辑账户'" prop="password">
          <el-input
            type = "password"
            v-if="isCreat"
            v-model.trim="creatForm.password"
            maxlength="20"
            autocomplete="off"
            placeholder="请输入密码"
          ></el-input>
        </el-form-item>
        <el-form-item label="密码确认:"  v-show="title !== '编辑账户'" prop="resPassword">
          <el-input
            type = "password"
            v-if="isCreat"
            v-model.trim="creatForm.resPassword"
            maxlength="20"
            autocomplete="off"
            placeholder="再次输入密码"
          ></el-input>
          <span v-else>{{creatForm.resPassword}}</span>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
@@ -187,15 +166,13 @@
    };
  },
  watch: {
    // dialogFormVisible: function(newVal) {
    //   if (!newVal) {
    //     this.creatForm.name = ""
    //     this.creatForm.phone = ""
    //     this.creatForm.password = ''
    //     this.creatForm.resPassword = ''
    //     this.creatForm.role = ''
    //   }
    // }
    dialogFormVisible: function(newVal) {
      if (!newVal) {
        this.creatForm.name = "";
        this.creatForm.phone = "";
        this.creatForm.role = '';
      }
    }
  },
  created(){
    roleGetRoleList().then(res => {
@@ -245,10 +222,6 @@
         this.$message.error('请输入用户名称');
         return
      }
      if(!v.checkName(this.creatForm.name)){
         this.$message.error('请输入正确用户名称');
         return
      }
      if(v.checkValEmpty(this.creatForm.phone)){
        this.$message.error('请输入用户手机号');
        return
@@ -261,22 +234,7 @@
        this.$message.error('请选择角色');
        return
      }
      if(v.checkValEmpty(this.creatForm.password) && this.isCreat){
        this.$message.error('请输入密码');
        return
      }
      if(!v.checkPassword(this.creatForm.password) && this.isCreat){
        this.$message.error('密码格式错误,请输入6~20位包含字母及数字');
        return
      }
      if(v.checkValEmpty(this.creatForm.resPassword)  && this.isCreat){
        this.$message.error('请输入密码确认');
        return
      }
      if(this.creatForm.password!=this.creatForm.resPassword  && this.isCreat){
        this.$message.error('密码输入不一致,请确认');
        return
      }
      if(this.title === '新建账户') {
        let temPassWord = md5(this.creatForm.phone+this.creatForm.password)
        let temconfirmPwd = md5(this.creatForm.phone+this.creatForm.resPassword)
@@ -297,7 +255,6 @@
      } else if (this.title === '编辑账户') {
        let data = {userName: this.creatForm.name, userId: this.rowsInfo.userId, roleId:this.creatForm.role}
        userUpdate(data).then(res => {
          console.log(res)
          if(res) {
            this.$notify({
              title: '提示',
src/views/login/index.vue
@@ -8,7 +8,7 @@
      </div>
      <div class="login-form">
        <div class="title-container">
          <div class='title'>权益品后台管理</div>
          权益品后台管理
        </div>
        <el-form ref="loginForm" :model="loginForm" :rules="loginRules" auto-complete="on" label-position="left" v-if="!findPass">
          <div class="login-cont">
@@ -272,7 +272,7 @@
    }
  }
  .login-form {
    // width: 400px;
    width: 300px;
    min-height: 326px;
    display: flex;
    justify-content: center;
@@ -318,15 +318,13 @@
  }
  .title-container {
    .title {
      width: 100%;
      font-size: 32px;
      margin-bottom: 82px;
      color: #333333;
      text-align: center;
      font-weight: bold;
    }
  }
  .show-pwd {
    position: absolute;
    right: 10px;