{"remainingRequest":"D:\\cloud\\cemp\\cemp-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\cloud\\cemp\\cemp-ui\\src\\views\\admin\\user\\info.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\cloud\\cemp\\cemp-ui\\src\\views\\admin\\user\\info.vue","mtime":1619070292891},{"path":"D:\\cloud\\cemp\\cemp-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\cloud\\cemp\\cemp-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\cloud\\cemp\\cemp-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\cloud\\cemp\\cemp-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\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//\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 {handleDown} from \"@/api/admin/user\";\nimport {mapState} from 'vuex'\nimport store from \"@/store\";\nimport request from '@/router/axios'\n\nexport default {\n data() {\n var validatePass = (rule, value, callback) => {\n if (this.ruleForm2.password !== '') {\n if (value !== this.ruleForm2.newpassword1) {\n callback(new Error('两次输入密码不一致!'))\n } else {\n callback()\n }\n } else {\n callback()\n }\n }\n return {\n switchStatus: '',\n avatarUrl: '',\n show: false,\n headers: {\n Authorization: 'Bearer ' + store.getters.access_token\n },\n ruleForm2: {\n username: '',\n password: '',\n newpassword1: '',\n newpassword2: '',\n avatar: '',\n phone: ''\n },\n rules2: {\n password: [{required: true, min: 6, message: '原密码不能为空且不少于6位', trigger: 'change'}],\n newpassword1: [{required: false, min: 6, message: '不少于6位', trigger: 'change'}],\n newpassword2: [{required: false, validator: validatePass, trigger: 'blur'}]\n }\n }\n },\n created() {\n this.ruleForm2.username = this.userInfo.username\n this.ruleForm2.phone = this.userInfo.phone\n this.switchStatus = 'userManager'\n },\n computed: {\n ...mapState({\n userInfo: state => state.user.userInfo\n }),\n },\n methods: {\n switchTab(tab, event) {\n this.switchStatus = tab.name\n },\n submitForm(formName) {\n this.$refs[formName].validate(valid => {\n if (valid) {\n request({\n url: '/admin/user/edit',\n method: 'put',\n data: this.ruleForm2\n }).then(response => {\n if (response.data.data) {\n this.$notify({\n title: '成功',\n message: '修改成功',\n type: 'success',\n duration: 2000\n })\n // 修改密码之后强制重新登录\n if (this.switchStatus === 'passwordManager') {\n this.$store.dispatch('LogOut').then(() => {\n location.reload() // 为了重新实例化vue-router对象 避免bug\n })\n }\n } else {\n this.$notify({\n title: '失败',\n message: response.data.msg,\n type: 'error',\n duration: 2000\n })\n }\n }).catch(() => {\n this.$notify({\n title: '失败',\n message: '修改失败',\n type: 'error',\n duration: 2000\n })\n })\n } else {\n return false\n }\n })\n },\n resetForm(formName) {\n this.$refs[formName].resetFields()\n }\n }\n}\n",{"version":3,"sources":["info.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"info.vue","sourceRoot":"src/views/admin/user","sourcesContent":["\r\n\r\n\r\n\r\n\r\n\r\n\r\n"]}]}