```feat(user): 查询并显示当前用户余额

在用户页面展示当前用户的余额信息,通过调用用户余额接口获取数据。优化界面布局,确保余额信息
清晰呈现给用户。同时,修复了潜在的token解析问题,保证用户数据准确无误。

修复了用户余额展示的bug,优化了用户界面体验。
```
master
wxy 2024-08-25 09:07:26 +08:00
parent 9ab5c50980
commit 1ed86b7362
2 changed files with 2 additions and 1 deletions

View File

@ -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)

View File

@ -23,7 +23,7 @@ export default {
async fetchUserBalance() {
try {
const userId = localStorage.getItem('userId');
console.log(userId)// userIdlocalStorage
console.log(userId)// userIdlocalStorage
if (!userId) {
this.userBalanceData = {userBalance: '未登录'};
return;