From d549e4d504a0c289acabd7c10b42cf9b817f3ea5 Mon Sep 17 00:00:00 2001 From: From-wh Date: Fri, 24 Feb 2023 17:59:30 +0800 Subject: [PATCH] =?UTF-8?q?improve:=20=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/admin/src/pages/setting/user/index.vue | 2 ++ template/admin/src/store/module/userInfo.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/template/admin/src/pages/setting/user/index.vue b/template/admin/src/pages/setting/user/index.vue index 3ec28a567..73a3ada2b 100644 --- a/template/admin/src/pages/setting/user/index.vue +++ b/template/admin/src/pages/setting/user/index.vue @@ -59,6 +59,7 @@ export default { }, mounted() { this.account = this.$store.state.userInfo.userInfo.account; + this.formValidate.real_name = this.$store.state.userInfo.userInfo.real_name; }, methods: { handleSubmit(name) { @@ -66,6 +67,7 @@ export default { if (valid) { updtaeAdmin(this.formValidate) .then((res) => { + this.$store.commit('userInfo/userRealName', this.formValidate.real_name); this.$Message.success(res.msg); }) .catch((res) => { diff --git a/template/admin/src/store/module/userInfo.js b/template/admin/src/store/module/userInfo.js index d2144d7b2..577687e51 100644 --- a/template/admin/src/store/module/userInfo.js +++ b/template/admin/src/store/module/userInfo.js @@ -56,6 +56,9 @@ export default { userInfo(state, userInfo) { state.userInfo = userInfo; }, + userRealName(state, realName) { + state.userInfo.real_name = realName; + }, uniqueAuth(state, uniqueAuth) { state.uniqueAuth = uniqueAuth; },