Files
tekelanew_acs/acs/nladmin-ui/node_modules/.cache/vue-loader/41ad3782db01497933cc293fe73d6560.json
2024-12-05 09:33:18 +08:00

1 line
4.3 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\user\\center\\updateEmail.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\user\\center\\updateEmail.vue","mtime":1732871026807},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1732872825835}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport store from '@/store'\r\nimport { validEmail } from '@/utils/validate'\r\nimport { updateEmail } from '@/views/system/user'\r\nimport { resetEmail } from '@/api/system/code'\r\nexport default {\r\n props: {\r\n email: {\r\n type: String,\r\n required: true\r\n }\r\n },\r\n data() {\r\n const validMail = (rule, value, callback) => {\r\n if (value === '' || value === null) {\r\n callback(new Error('新邮箱不能为空'))\r\n } else if (value === this.email) {\r\n callback(new Error('新邮箱不能与旧邮箱相同'))\r\n } else if (validEmail(value)) {\r\n callback()\r\n } else {\r\n callback(new Error('邮箱格式错误'))\r\n }\r\n }\r\n return {\r\n loading: false, dialog: false, title: '修改邮箱', form: { pass: '', email: '', code: '' },\r\n user: { email: '', password: '' }, codeLoading: false,\r\n rules: {\r\n pass: [\r\n { required: true, message: '当前密码不能为空', trigger: 'blur' }\r\n ],\r\n email: [\r\n { required: true, validator: validMail, trigger: 'blur' }\r\n ]\r\n }\r\n }\r\n },\r\n methods: {\r\n cancel() {\r\n this.resetForm()\r\n },\r\n sendCode() {\r\n if (this.form.email && this.form.email !== this.email) {\r\n this.codeLoading = true\r\n this.buttonName = '验证码发送中'\r\n const _this = this\r\n resetEmail(this.form.email).then(res => {\r\n this.$message({\r\n showClose: true,\r\n message: '发送成功验证码有效期5分钟',\r\n type: 'success'\r\n })\r\n this.codeLoading = false\r\n this.isDisabled = true\r\n this.buttonName = this.time-- + '秒后重新发送'\r\n this.timer = window.setInterval(function() {\r\n _this.buttonName = _this.time + '秒后重新发送'\r\n --_this.time\r\n if (_this.time < 0) {\r\n _this.buttonName = '重新发送'\r\n _this.time = 60\r\n _this.isDisabled = false\r\n window.clearInterval(_this.timer)\r\n }\r\n }, 1000)\r\n }).catch(err => {\r\n this.resetForm()\r\n this.codeLoading = false\r\n console.log(err.response.data.message)\r\n })\r\n }\r\n },\r\n doSubmit() {\r\n this.$refs['form'].validate((valid) => {\r\n if (valid) {\r\n this.loading = true\r\n updateEmail(this.form).then(res => {\r\n this.loading = false\r\n this.resetForm()\r\n this.$notify({\r\n title: '邮箱修改成功',\r\n type: 'success',\r\n duration: 1500\r\n })\r\n store.dispatch('GetInfo').then(() => {})\r\n }).catch(err => {\r\n this.loading = false\r\n console.log(err.response.data.message)\r\n })\r\n } else {\r\n return false\r\n }\r\n })\r\n },\r\n resetForm() {\r\n this.dialog = false\r\n this.$refs['form'].resetFields()\r\n window.clearInterval(this.timer)\r\n this.time = 60\r\n this.buttonName = '获取验证码'\r\n this.isDisabled = false\r\n this.form = { pass: '', email: '', device_code: '' }\r\n }\r\n }\r\n}\r\n",null]}