diff --git a/zhiyin-app/package.json b/zhiyin-app/package.json index 90b73e1..975fbaf 100644 --- a/zhiyin-app/package.json +++ b/zhiyin-app/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "scripts": { "dev:mp-weixin": "uni -p mp-weixin", - "build:mp-weixin": "uni build -p mp-weixin && cp -n static/avatar-*.png dist/build/mp-weixin/static/ 2>/dev/null; true", + "build:mp-weixin": "uni build -p mp-weixin && cp -f static/avatar-*.png dist/build/mp-weixin/static/ 2>/dev/null; true", "dev:h5": "uni", - "build:h5": "uni build && cp -n static/avatar-*.png dist/build/h5/static/ 2>/dev/null; true", + "build:h5": "uni build && cp -f static/avatar-*.png dist/build/h5/static/ 2>/dev/null; true", "test": "vitest run", "test:watch": "vitest" }, diff --git a/zhiyin-app/src/pages/user/user.vue b/zhiyin-app/src/pages/user/user.vue index d5a53d5..68e8fa5 100644 --- a/zhiyin-app/src/pages/user/user.vue +++ b/zhiyin-app/src/pages/user/user.vue @@ -6,6 +6,7 @@ {{ userInfo.nickname || '未设置昵称' }} + ID: {{ maskedId }} {{ userInfo.plan || '免费版' }} @@ -103,6 +104,10 @@ const stats = ref({ interviewCount: 0, avgScore: '--', completedCount: 0 }) const token = ref('') const isLoggedIn = computed(() => !!token.value) +const maskedId = computed(() => { + const id = userInfo.value.id || '' + return id.length > 6 ? `****${id.slice(-6)}` : id || '--' +}) const refreshState = () => { token.value = uni.getStorageSync('token') || '' @@ -177,6 +182,7 @@ const doLogout = () => { .profile-info { flex: 1; display: flex; flex-direction: column; } .nickname { font-size: 34rpx; font-weight: 700; color: #FFFFFF; } .plan-badge { font-size: 20rpx; color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.2); padding: 4rpx 14rpx; border-radius: 8rpx; align-self: flex-start; margin-top: 8rpx; } +.user-id { font-size: 20rpx; color: rgba(255,255,255,0.5); margin-top: 4rpx; } .header-arrow { font-size: 36rpx; color: rgba(255,255,255,0.5); } .stats-bar { display: flex; align-items: center; background: rgba(255,255,255,0.15); border-radius: var(--radius-lg); padding: 24rpx 0; } .stat { flex: 1; display: flex; flex-direction: column; align-items: center; }