fix(miniapp): 提现/财务接口不再用 1001 演示身份,修复 403
- getUserProfile/getUserWithdrawals/getUserFinanceRecords 去掉 userId=1001 默认值,改由 normalizeUserId 解析登录身份 - withdraw.vue / withdraw-records.vue / workspace.vue 调用改为 normalizeUserId(),不再硬编码 1001 - normalizeUserId 将 1001 视为演示占位符:登录态下传 0 由 token 识别,未登录才兜底 1001 - request.js 遇 403 身份校验失败时清理错配登录态并提示重新登录(其它 403 权限拒绝不受影响) - 登录态闸门补齐用例(108 套件/714 用例全绿)
这个提交包含在:
@@ -490,7 +490,8 @@ import {
|
||||
updateExpertService,
|
||||
deleteExpertService,
|
||||
uploadVoiceIntro,
|
||||
getUserWithdrawals
|
||||
getUserWithdrawals,
|
||||
normalizeUserId
|
||||
} from '@/common/api.js';
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
@@ -801,7 +802,7 @@ const goToWithdrawPage = () => {
|
||||
|
||||
const openWithdrawRecords = async () => {
|
||||
try {
|
||||
const list = await getUserWithdrawals(1001);
|
||||
const list = await getUserWithdrawals(normalizeUserId());
|
||||
withdrawRecords.value = list || [];
|
||||
} catch (_) {}
|
||||
showWithdrawRecordsModal.value = true;
|
||||
|
||||
@@ -180,7 +180,7 @@ import { onShow } from '@dcloudio/uni-app';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getUserWithdrawals } from '@/common/api.js';
|
||||
import { getUserWithdrawals, normalizeUserId } from '@/common/api.js';
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
@@ -272,7 +272,7 @@ const handleCopyOrderNo = (orderNo) => {
|
||||
|
||||
const loadWithdrawals = async () => {
|
||||
try {
|
||||
const list = await getUserWithdrawals(1001);
|
||||
const list = await getUserWithdrawals(normalizeUserId());
|
||||
if (Array.isArray(list)) {
|
||||
allRecords.value = list;
|
||||
let successSum = 0;
|
||||
|
||||
@@ -189,7 +189,8 @@ import {
|
||||
getUserProfile,
|
||||
withdrawCommission,
|
||||
getUserWithdrawals,
|
||||
getPlatformConfigs
|
||||
getPlatformConfigs,
|
||||
normalizeUserId
|
||||
} from '@/common/api.js';
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
@@ -281,7 +282,7 @@ const handleFillAllCommission = () => {
|
||||
|
||||
const loadPageData = async () => {
|
||||
try {
|
||||
const profile = await getUserProfile(1001);
|
||||
const profile = await getUserProfile(normalizeUserId());
|
||||
if (profile && profile.commission !== undefined) {
|
||||
userCommission.value = String(profile.commission);
|
||||
if (profile.nickname) {
|
||||
@@ -298,7 +299,7 @@ const loadPageData = async () => {
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
const records = await getUserWithdrawals(1001);
|
||||
const records = await getUserWithdrawals(normalizeUserId());
|
||||
if (Array.isArray(records)) {
|
||||
withdrawalsList.value = records;
|
||||
let successSum = 0;
|
||||
|
||||
在新工单中引用
屏蔽一个用户