whychdw
2022-01-23 c798b1ff37dd00f3de2065b609dd28f0b37be5e4
内容提交
7个文件已修改
161 ■■■■ 已修改文件
src/assets/js/apis/login/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/apis/userMager/userInfo.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/tools/validateRules.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/PwdChange.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/history.vue 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/login.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/apis/login/index.js
@@ -30,7 +30,7 @@
        return axios({
            method: 'post',
            url: 'User_infAction!updatePassword',
            data: "uif.USnId="+ JSON.stringify(AES.encrypt(pwd)),
            data: "uif.USnId="+ encodeURIComponent(AES.encrypt(pwd)),
        });
    },
    updateUserPwd2(name, oldPwd, newPwd) {
@@ -41,7 +41,7 @@
                UName: name,
                Upassword: md5(oldPwd),
                UNote: md5(newPwd),
                USnId: AES.encrypt(newPwd),
                USnId: encodeURIComponent(AES.encrypt(newPwd)),
            }),
        });
    },
src/assets/js/apis/userMager/userInfo.js
@@ -67,6 +67,7 @@
     * @return  {[Promise]}        查询结果
     */
    add(data) {
        data.USnId = encodeURIComponent(data.USnId);
        return axios({
            method: 'post',
            url: 'User_infAction!add',
src/assets/js/config.js
@@ -54,11 +54,11 @@
    messageCode: {
        label: '短信验证码',
        des: '登录是否启用短信验证码',
        value: false,
        value: true,
    },
    autoExit: {
        label: "自动退出",
        des: "长时间不操作自动退出",
        value: false
        value: true
    },
};
src/assets/js/tools/validateRules.js
@@ -19,11 +19,11 @@
  },
  pwd(rule, value, callback) {
    if (!value) {
      return callback(new Error('用户名不能为空'));
      return callback(new Error('密码不能为空'));
    }
    let pattern = /(?!^[0-9]+$)(?!^[A-z]+$)(?!^[^A-z0-9]+$)^[^\s\u4e00-\u9fa5]{6,20}$/;
    let pattern = /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\\W_!@#$%^&*`~()-+=]+$)(?![0-9\\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\\W_!@#$%^&*`~()-+=]{8,30}$/;
    if(!pattern.test(value)) {
      return callback(new Error('6位以上密码,数字,字母,字符至少包含两种,不能包含中文和空格'));
      return callback(new Error('长度至少8位,必须符合由数字,大写字母,小写字母,特殊符,至少其中三种组成密码'));
    }
    return callback();
  }
src/components/PwdChange.vue
@@ -44,14 +44,14 @@
    data() {
        let name = this.name;
        let validatePass = (rule, value, callback) => {
            let pwdRegex = /(?!^[0-9]+$)(?!^[A-z]+$)(?!^[^A-z0-9]+$)^[^\s\u4e00-\u9fa5]{6,20}$/;
            let pwdRegex = /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\\W_!@#$%^&*`~()-+=]+$)(?![0-9\\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\\W_!@#$%^&*`~()-+=]{8,30}$/;;
            let isRepeat = value.indexOf(name);
            if (pwdRegex.test(value)) {
                callback();
            } else if(isRepeat != -1) {
              callback(new Error("密码中存在用户名信息"));
            } else {
                callback(new Error('6位以上密码,数字,字母,字符至少包含两种,不能包含中文和空格'));
                callback(new Error('长度至少8位,必须符合由数字,大写字母,小写字母,特殊符,至少其中三种组成密码'));
            }
        };
        return {
src/pages/dataTest/history.vue
@@ -65,7 +65,15 @@
                        <div class="table-row">
                            <div class="table-cell text-right w80">测试日期:</div>
                            <div class="table-cell">
                                <el-cascader v-model="test_record.value" :options="test_record.list" size="small"
                              <el-cascader v-if="isAio" v-model="test_record1.value" :options="test_record1.list" size="small"
                                            placeholder="请选择测试日期" style="width: 100%; min-width:16rem"
                                            @change="testRecordChange">
                                <template slot-scope="{ node, data }">
                                  <span>{{ data.label }}</span>
                                  <span v-if="!node.isLeaf"> ({{data.children.length }})</span>
                                </template>
                              </el-cascader>
                                <el-cascader v-else  v-model="test_record.value" :options="test_record.list" size="small"
                                    placeholder="请选择测试日期" style="width: 100%; min-width:16rem"
                                    @change="testRecordChange">
                                    <template slot-scope="{ node, data }">
@@ -344,6 +352,63 @@
                        }
                    ]
                },
                test_record1: {
                  value: [],
                  list: [
                    {
                      value: 0,
                      label: "电池组1",
                      children: [
                        {
                          value: "herongDischarge",
                          label: "核容放电",
                          children: []
                        },
                        {
                          value: "jianceDischarge",
                          label: "监测放电",
                          children: []
                        },
                        {
                          value: "herongCharge",
                          label: "核容充电",
                          children: []
                        },
                        {
                          value: "jianceCharge",
                          label: "监测充电",
                          children: []
                        }
                      ]
                    },
                    {
                      value: 1,
                      label: "电池组2",
                      children: [
                        {
                          value: "herongDischarge",
                          label: "核容放电",
                          children: []
                        },
                        {
                          value: "jianceDischarge",
                          label: "监测放电",
                          children: []
                        },
                        {
                          value: "herongCharge",
                          label: "核容充电",
                          children: []
                        },
                        {
                          value: "jianceCharge",
                          label: "监测充电",
                          children: []
                        }
                      ]
                    },
                  ]
                },
                slider: 100,
                testTimeLong: [],
                battState: {
@@ -501,6 +566,17 @@
                this.test_record.list[1].children = [];
                this.test_record.list[2].children = [];
                this.test_record.list[3].children = [];
                // 初始化A059充放电记录
                if(this.isAio) {
                  this.test_record1.value = [];
                  this.test_record1.list.map(item=>{
                    item.children.map(item1=>{
                      item1.children = [];
                    });
                  });
                }
                // 初始化顶部文本框内容
                this.top = {
                    state: "", // 电池状态
@@ -900,14 +976,40 @@
                            this.$layer.msg("未获取到充放电记录");
                        }
                        // 充放电记录
                        this.test_record.list[0].children = herongDischarge;
                        this.test_record.list[1].children = jianceDischarge;
                        this.test_record.list[2].children = herongCharge;
                        this.test_record.list[3].children = jianceCharge;
                        if(this.isAio) {
                          this.setAioTestRecord(herongDischarge, 0);
                          this.setAioTestRecord(jianceDischarge, 1);
                          this.setAioTestRecord(herongCharge, 2);
                          this.setAioTestRecord(jianceCharge, 3);
                        }else {
                          this.setNormalTestRecord(herongDischarge, jianceDischarge, herongCharge, jianceCharge);
                        }
                    })
                    .catch(error => {
                        this.$layer.close(loading);
                        console.log(error);
                    });
            },
            /**
             * 设置普通类型充放电数据
             */
            setNormalTestRecord(herongDischarge, jianceDischarge, herongCharge, jianceCharge) {
              this.test_record.list[0].children = herongDischarge;
              this.test_record.list[1].children = jianceDischarge;
              this.test_record.list[2].children = herongCharge;
              this.test_record.list[3].children = jianceCharge;
            },
            /**
             * 设置A059充放电数据
             */
            setAioTestRecord(data, index) {
              data.map(item=>{
                // 电池组1充放电数据
                if(item.upload_client_type == 1) {
                  this.test_record1.list[0].children[index].children.push(item);
                }else {
                  this.test_record1.list[1].children[index].children.push(item);
                }
                    });
            },
            // 切换测试信息
@@ -1069,6 +1171,10 @@
            // 获取测试的信息
            getTestRecord() {
                let value = this.test_record.value;
                // A059设备
                if(this.isAio) {
                  value = this.test_record1.value;
                }
                // 没有选择充放电记录,返回-1
                if (value.length == 0) {
                    return -1;
@@ -1076,6 +1182,14 @@
                let type = value[0];
                let time = value[1];
                let list = this.test_record.list;
                // A059设备
                if(this.isAio) {
                  value = this.test_record1.value;
                  let index = value[0];
                  type = value[1];
                  time = value[2];
                  list = this.test_record1.list[index].children;
                }
                let result = 0;
                // 遍历list
                for (let i in list) {
@@ -1844,6 +1958,11 @@
                    return "";
                }
            },
            isAio() {
              // A059设备
              let batt = this.batt;
              return regEquipType(batt.FBSDeviceId, ["aio"]);
            }
        },
        mounted() {
            // 初始化图表
src/pages/login.vue
@@ -645,11 +645,14 @@
        if(rs.code == 1) {
          sessionStorage.setItem("serverStamp", rs.data);
        }else {
          sessionStorage.setItem("serverStamp", new Date().getTime());
          sessionStorage.setItem("serverStamp", new Date().getTime()+"");
        }
        setTimeout(()=>{
        callback();
        }, 500);
      }).catch(error => {
        sessionStorage.setItem("serverStamp", new Date().getTime());
        sessionStorage.setItem("serverStamp", new Date().getTime()+"");
        callback();
        console.log(error);
      });
@@ -751,8 +754,10 @@
      }
    });
    // console.log(AES.encrypt("huo1234567"));
    // console.log(AES.decrypt("8tg9f0/tX7/EHYXqLWqvxA=="));
    // console.log(AES.encrypt("sys_123456"));
    // console.log(encodeURIComponent("B17jjjYoBkbfZChw/fHzcA=="));
    // console.log(decodeURIComponent("B17jjjYoBkbfZChw%2FfHzcA%3D%3D"))
    //console.log(AES.decrypt("5OUaEnC33sVNY+jeXlx3Qg=="));
    // console.log(md5("a123456"));
    // console.log(JSON.stringify("5OUaEnC33sVNY+jeXlx3Qg=="));
  },