From 1ed86b73627fb93b26d27acf0391d52ee29d89e9 Mon Sep 17 00:00:00 2001 From: wxy <14293288+zysysys@user.noreply.gitee.com> Date: Sun, 25 Aug 2024 09:07:26 +0800 Subject: [PATCH] =?UTF-8?q?```feat(user):=20=E6=9F=A5=E8=AF=A2=E5=B9=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=BD=93=E5=89=8D=E7=94=A8=E6=88=B7=E4=BD=99?= =?UTF-8?q?=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在用户页面展示当前用户的余额信息,通过调用用户余额接口获取数据。优化界面布局,确保余额信息 清晰呈现给用户。同时,修复了潜在的token解析问题,保证用户数据准确无误。 修复了用户余额展示的bug,优化了用户界面体验。 ``` --- src/store/modules/user.js | 1 + src/views/money/user/index.vue | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 6c109a6..19b32d2 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -69,6 +69,7 @@ const user = { commit('SET_ROLES', ['ROLE_DEFAULT']) } commit('SET_ID', user.userId) + localStorage.setItem('userId', user.userId) commit('SET_NAME', user.userName) commit('SET_AVATAR', avatar) resolve(res) diff --git a/src/views/money/user/index.vue b/src/views/money/user/index.vue index 320d9a7..6ed1897 100644 --- a/src/views/money/user/index.vue +++ b/src/views/money/user/index.vue @@ -23,7 +23,7 @@ export default { async fetchUserBalance() { try { const userId = localStorage.getItem('userId'); - console.log(userId)// 假设你登录后把userId存到了localStorage + console.log(userId)// 登录后把userId存到了localStorage if (!userId) { this.userBalanceData = {userBalance: '未登录'}; return;