{"remainingRequest":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\damDance-fvue\\src\\views\\ResetPwdView.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\damDance-fvue\\src\\views\\ResetPwdView.vue","mtime":1696817249232},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\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//\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\n var validateNew = function validateNew(rule, value, callback) {\n if (value === '') {\n callback(new Error(_this.$t('common.input')));\n }\n\n var config = _this.pwdStrategy;\n\n if (config.enable) {\n var pwdRule = config.pwdRule;\n var pwdLength = config.pwdLength;\n\n if (pwdRule) {\n if (value.length < pwdLength) {\n callback(new Error('新密码长度至少为' + pwdLength));\n }\n\n if (pwdRule == 1) {\n callback();\n } else if (pwdRule == 2) {\n var re = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])');\n\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\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\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(_this.$t('resetPSD.length')));\n } else {\n callback();\n }\n }\n };\n\n var validateold = function validateold(rule, value, callback) {\n if (value === '') {\n callback(new Error(_this.$t('common.input')));\n } else {\n callback();\n }\n };\n\n var validateNewReapeat = function validateNewReapeat(rule, value, callback) {\n if (value === '') {\n callback(new Error(_this.$t('common.input')));\n } else if (value !== _this.pwdForm.new) {\n callback(new Error(_this.$t('resetPSD.notSame')));\n } else {\n callback();\n }\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 type: 'settings' // settings 用户主动设置 login 首次登录强制设置\n\n };\n },\n mounted: function mounted() {\n var _this2 = this;\n\n console.log(this.$route.params, this.$route.query);\n var account = JSON.parse(sessionStorage.getItem('currentUser')).account;\n console.log(account);\n\n if (account) {\n this.account = account;\n }\n\n uc.getDefaultPwdStrategy().then(function (data) {\n if (data) {\n var form = data;\n\n if (form.enable == 1) {\n form.enable = true;\n } else {\n form.enable = false;\n }\n\n _this2.pwdStrategy = form;\n }\n });\n },\n methods: {\n submitForm: function submitForm() {\n var _this3 = this;\n\n this.$refs['pwdForm'].validate(function (valid) {\n if (valid) {\n if (_this3.account == '') {\n _this3.$message.warning(_this3.$t('resetPSD.relogin'));\n\n return;\n }\n\n _this3.confirm = true;\n\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\n if (data && data.state) {\n _this3.$message.success(_this3.$t('resetPSD.success'));\n\n _this3.confirm = false;\n\n _this3.$router.push({\n path: _this3.$route.query.redirect ? _this3.$route.query.redirect : '/login'\n });\n } else {\n _this3.confirm = false;\n }\n });\n } else {\n _this3.$message.warning(_this3.$t('resetPSD.check'));\n }\n });\n },\n back: function back() {\n var _this4 = this;\n\n if (this.$route.query.type == 'settings') {\n this.$router.go(-1);\n delete this.$route.query.type;\n } else {\n this.$store.dispatch('login/logoutAndCleanUp').then(function () {\n _this4.$router.push({\n path: '/login'\n });\n });\n }\n },\n warning: function warning() {\n this.$notify({\n title: '警告',\n message: '该密码不符合密码策略,请重置密码',\n type: 'warning'\n });\n }\n }\n};",null]}