diff --git a/src/local/user.js b/src/local/user.js index 5e5742279dbfdd3a9cc0ff3fc558934e9afda020..9b89419d3f1f4d74936978fff4cb4b82ca9fd5df 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 f88a00ef2919aa9a63bd79df2f17cbe8a0c23fcd..7b7f12f556a4db627fa84293df8e90626956ef49 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; })