diff --git a/admin/dashboard/templates/base.html b/admin/dashboard/templates/base.html index a006b53..624d5c4 100644 --- a/admin/dashboard/templates/base.html +++ b/admin/dashboard/templates/base.html @@ -63,7 +63,7 @@ .app-container { min-height: 100vh; - opacity: 0; + opacity: 1; transition: opacity .24s ease; } @@ -764,7 +764,7 @@ 修改密码 - + 退出 @@ -917,6 +917,7 @@ const baseApp = { data() { + const vm = this; return { currentView: '1', timeRange: '7', @@ -941,8 +942,8 @@ confirm_password: [ { required: true, message: '请再次输入新密码', trigger: 'blur' }, { - validator: (rule, value, callback) => { - if (value !== this.passwordForm.new_password) { + validator: function(rule, value, callback) { + if (value !== vm.passwordForm.new_password) { callback(new Error('两次输入的新密码不一致')); return; } @@ -1065,7 +1066,14 @@ this.passwordDialogVisible = false; }) .catch((error) => { - const errorMsg = error?.response?.data?.error || '修改密码失败,请稍后重试'; + let errorMsg = '修改密码失败,请稍后重试'; + try { + if (error && error.response && error.response.data && error.response.data.error) { + errorMsg = error.response.data.error; + } + } catch (e) { + // 读取错误信息失败时保持默认文案即可。 + } this.$message.error(errorMsg); }) .finally(() => {