Compare commits

..

1 Commits

Author SHA1 Message Date
kk b1924e2623 userId 改为依赖 this.userInfo.user_id
Uni-app H5 Deploy (Prod + Staging) / deploy (release) Successful in 47s
2026-07-11 20:29:00 +08:00
+4 -4
View File
@@ -181,7 +181,7 @@ export default {
loading: false,
categoryList: [],
activeCategory: 'all',
userInfo: { nickname: '', phone: '', avatar: '' },
userInfo: { user_id: '', nickname: '', phone: '', avatar: '' },
avatarClickCount: 0,
avatarClickTimer: null,
fromPage: '', // 记录从哪个页面跳转过来的
@@ -199,8 +199,7 @@ export default {
},
computed: {
userId() {
const info = getCachedUserInfo();
return (info && info.user_id) || '';
return this.userInfo.user_id || '';
},
canGoBack() {
// 有上一页,或者从 tab 切换过来的,都可以返回
@@ -304,7 +303,7 @@ export default {
if (cached) {
this.userInfo = { ...this.userInfo, ...cached };
} else {
this.userInfo = { nickname: '', phone: '', avatar: '' };
this.userInfo = { user_id: '', nickname: '', phone: '', avatar: '' };
}
console.log('[index] this.userInfo:', JSON.stringify(this.userInfo, null, 2));
},
@@ -317,6 +316,7 @@ export default {
this.userInfo = { ...this.userInfo, ...cached };
} else {
this.userInfo = {
user_id: config.mockUser.user_info.user_id || '',
nickname: config.mockUser.user_info.nickname || '',
phone: config.mockUser.user_info.phone || '',
avatar: config.mockUser.user_info.avatar || '',