From cdfbe141e7afb2e1984532d7cdc666c7f6da0cc3 Mon Sep 17 00:00:00 2001 From: shuiluo Date: Mon, 19 Jul 2021 20:40:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=9B=BD=E9=99=85=E5=8C=96=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/local/user.js | 6 ++++++ src/pages/user/components/modify_password.vue | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/local/user.js b/src/local/user.js index 5e57422..9b89419 100644 --- a/src/local/user.js +++ b/src/local/user.js @@ -18,4 +18,10 @@ export default { 'table.read': ['已读', 'Read'], 'table.unread': ['未读', 'Unread'], 'user.readTime': ['已读时间', 'Read Time'], + 'user.initialPassword': ['初始密码', 'Initial Password'], + 'user.password': ['新密码', 'Password'], + 'user.confirmPassword': ['确认密码', 'Confirm password'], + 'user.twoInconsistent': ['两次密码不一致', 'The two passwords are inconsistent'], + 'user.modifiedSuccessfully': ['修改成功', 'Modified successfully'], + 'user.serverException': ['服务器异常', 'Server exception'], }; diff --git a/src/pages/user/components/modify_password.vue b/src/pages/user/components/modify_password.vue index f88a00e..7b7f12f 100644 --- a/src/pages/user/components/modify_password.vue +++ b/src/pages/user/components/modify_password.vue @@ -1,16 +1,18 @@ @@ -21,7 +23,7 @@ import { EMPTY_FUN } from '@/utils'; import md5 from 'crypto-js/md5'; export default { - data: vm => ({ + data: (vm) => ({ form: { newPassword: '', oldPassword: '', @@ -34,7 +36,7 @@ export default { { required: true }, { validator(rule, value, callback) { - if (value !== vm.form.newPassword) callback('两次密码不一致'); + if (value !== vm.form.newPassword) callback(this.$t('user.twoInconsistent')); callback(); }, }, @@ -53,10 +55,10 @@ export default { newPassword: md5(this.form.newPassword).toString(), oldPassword: md5(this.form.oldPassword).toString(), }); - this.$message.success('修改成功'); + this.$message.success(this.$t('user.modifiedSuccessfully')); } catch (error) { // todo - this.$message.error('服务器异常'); + this.$message.error(this.$t('user.serverException')); } this.loading = false; }) -- GitLab