{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\views\\ResetPwdView.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\views\\ResetPwdView.vue","mtime":1675214578042},{"path":"D:\\jenkins\\workspace\\xypm-web\\babel.config.js","mtime":1675214572901},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.constructor\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport uc from \"@/api/uc.js\";\nexport default {\n  name: \"reset-pwd-view\",\n  data: function data() {\n    var _this = this;\n    var validateNew = function validateNew(rule, value, callback) {\n      if (value === \"\") {\n        callback(new Error(\"请输入新密码\"));\n      }\n      var config = _this.pwdStrategy;\n      if (config.enable) {\n        var pwdRule = config.pwdRule;\n        var pwdLength = config.pwdLength;\n        if (pwdRule) {\n          if (value.length < pwdLength) {\n            callback(new Error(\"新密码长度至少为\" + pwdLength));\n          }\n          if (pwdRule == 1) {\n            callback();\n          } else if (pwdRule == 2) {\n            var re = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])');\n            if (!re.test(value)) {\n              callback(new Error(\"新密码必须包含数字、字母\"));\n            } else {\n              callback();\n            }\n          } else if (pwdRule == 3) {\n            var re = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9])');\n            if (!re.test(value)) {\n              callback(new Error(\"新密码必须包含数字、字母、特殊字符\"));\n            } else {\n              callback();\n            }\n          } else if (pwdRule == 4) {\n            var re = new RegExp('(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9])');\n            if (!re.test(value)) {\n              callback(new Error(\"新密码必须包含数字、大小写字母、特殊字符\"));\n            } else {\n              callback();\n            }\n          } else {\n            callback();\n          }\n        }\n      } else {\n        if (value.length < 6) {\n          callback(new Error(\"新密码长度至少为6\"));\n        } else {\n          callback();\n        }\n      }\n    };\n    var validateold = function validateold(rule, value, callback) {\n      if (value === \"\") {\n        callback(new Error(\"请输入旧密码\"));\n      } else {\n        callback();\n      }\n    };\n    var validateNewReapeat = function validateNewReapeat(rule, value, callback) {\n      if (value === \"\") {\n        callback(new Error(\"请再次输入新密码\"));\n      } else if (value !== _this.pwdForm.new) {\n        callback(new Error(\"两次输入的密码不一致！\"));\n      } else {\n        callback();\n      }\n    };\n    return {\n      pwdForm: {\n        old: \"\",\n        new: \"\",\n        newRepeat: \"\"\n      },\n      pwdRules: {\n        old: [{\n          validator: validateold,\n          trigger: \"blur\"\n        }],\n        new: [{\n          validator: validateNew,\n          trigger: \"blur\"\n        }],\n        newRepeat: [{\n          validator: validateNewReapeat,\n          trigger: \"blur\"\n        }]\n      },\n      pwdStrategy: {},\n      account: \"\",\n      confirm: false\n    };\n  },\n  mounted: function mounted() {\n    var _this2 = this;\n    if (this.$route.params.account) {\n      this.account = this.$route.params.account;\n    }\n    uc.getDefaultPwdStrategy().then(function (data) {\n      if (data) {\n        var form = data;\n        if (form.enable == 1) {\n          form.enable = true;\n        } else {\n          form.enable = false;\n        }\n        _this2.pwdStrategy = form;\n      }\n    });\n  },\n  methods: {\n    submitForm: function submitForm() {\n      var _this3 = this;\n      this.$refs[\"pwdForm\"].validate(function (valid) {\n        if (valid) {\n          if (_this3.account == \"\") {\n            _this3.$message.warning(\"请返回重新登录\");\n            return;\n          }\n          _this3.confirm = true;\n          _this3.$http.post(\"${uc}/api/user/v1/user/modifiUserPsd\", {\n            account: _this3.account,\n            oldPwd: _this3.pwdForm.old,\n            newPwd: _this3.pwdForm.new\n          }).then(function (resp) {\n            var data = resp.data;\n            if (data && data.state) {\n              _this3.$message.success(\"修改密码成功\");\n              _this3.confirm = false;\n              _this3.$router.push({\n                path: _this3.$route.query.redirect ? _this3.$route.query.redirect : \"/\"\n              });\n            } else {\n              _this3.confirm = false;\n            }\n          });\n        } else {\n          _this3.$message.warning(\"表单校验失败，请检查表单\");\n        }\n      });\n    },\n    back: function back() {\n      var _this4 = this;\n      this.$store.dispatch(\"login/logoutAndCleanUp\").then(function () {\n        _this4.$router.push({\n          path: \"/login\"\n        });\n      });\n    },\n    warning: function warning() {\n      this.$notify({\n        title: '警告',\n        message: '该密码不符合密码策略，请重置密码',\n        type: 'warning'\n      });\n    }\n  },\n  created: function created() {\n    this.warning();\n  }\n};",null]}