fix(auth): resolve user 101 404 error by normalizing test user ID to 2006 and adding server fallback

这个提交包含在:
xcbyy
2026-10-13 10:41:49 +08:00
父节点 661d0d2589
当前提交 3bb6f5a6be
共有 7 个文件被更改,包括 683 次插入 和 471 次删除

查看文件

@@ -125,12 +125,12 @@ const DEMO_ACCOUNTS = [
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=200'
},
{
id: 101,
nickname: '糖心小糯米',
id: 2006,
nickname: '苏苏学姐',
roleTag: 'expert',
roleDesc: '金牌陪伴师',
desc: '工作台接单 · 雷达抢单 · 现场核销',
avatar: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=200'
avatar: 'https://images.unsplash.com/photo-1524504388940-b1c1722653e1?w=200'
}
];

查看文件

@@ -315,6 +315,7 @@
</view>
</scroll-view>
<view class="empty-records-box" v-else>
<image class="empty-icon-svg" :src="ICONS.fileText" mode="aspectFit" />
<text class="empty-txt">暂无提现申请记录</text>
</view>
</view>
@@ -580,12 +581,12 @@ const DEMO_ACCOUNTS = [
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=200'
},
{
id: 101,
id: 2006,
nickname: '苏苏学姐',
roleTag: 'expert',
roleDesc: '金牌陪伴师',
desc: '接单工作台 · 4位核销',
avatar: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=200'
avatar: 'https://images.unsplash.com/photo-1524504388940-b1c1722653e1?w=200'
}
];
@@ -721,7 +722,11 @@ const loadUserProfile = async (targetId) => {
}
isLoggedIn.value = true;
const uid = targetId || uni.getStorageSync('userId') || 1001;
let uid = targetId || uni.getStorageSync('userId') || 1001;
if (uid == 101) {
uid = 2006;
uni.setStorageSync('userId', 2006);
}
try {
const profile = await getUserProfile(uid);
if (profile) {
@@ -1074,13 +1079,9 @@ const navToWithdraw = () => {
const openWithdrawRecordsModal = async () => {
if (!ensureLoggedIn()) return;
try {
const list = await getUserWithdrawals(user.value.id || 1001);
userWithdrawalsList.value = Array.isArray(list) ? list : [];
} catch (_) {
userWithdrawalsList.value = [];
}
showWithdrawRecordsModal.value = true;
uni.navigateTo({
url: '/pages/user/withdraw-records'
});
};
// 手机号脱敏展示
@@ -2291,6 +2292,8 @@ const navTo = (url) => {
}
}
}
}
.withdraw-modal-box {
max-width: 640rpx;
@@ -2465,8 +2468,19 @@ const navTo = (url) => {
}
.empty-records-box {
padding: 60rpx 0;
padding: 60rpx 20rpx;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.empty-icon-svg {
width: 64rpx;
height: 64rpx;
margin-bottom: 16rpx;
opacity: 0.45;
}
.empty-txt {
font-size: 24rpx;
@@ -3007,6 +3021,32 @@ const navTo = (url) => {
}
.withdraw-records-modal-box {
background: #FFFFFF;
border: 1px solid #FED7AA;
box-shadow: 0 16rpx 48rpx rgba(234, 88, 12, 0.08);
.modal-header .modal-title {
color: #1C1917;
}
.records-modal-scroll .wd-card-row {
background: #FAFAF9;
border-color: #E7E5E4;
.wd-row-center .wd-val { color: #1C1917; }
.wd-row-top .wd-no { color: #78716C; }
}
.empty-records-box {
.empty-icon-svg {
opacity: 0.6;
}
.empty-txt {
color: #78716C;
}
}
}
.dist-modal-box {
.dist-summary-banner {
background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
@@ -3027,7 +3067,6 @@ const navTo = (url) => {
}
}
}
}
</style>

文件差异内容过多而无法显示 加载差异