fix(withdraw): resolve remote 404 route, db reason column patch and avatar tmp path fallback
这个提交包含在:
@@ -900,4 +900,96 @@ export async function updateExpertServiceStatus(expertId = 101, serviceId, statu
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户收藏的陪玩列表
|
||||
*/
|
||||
export async function getFavorites(userId = 1001) {
|
||||
try {
|
||||
const res = await http.get(`/favorites?userId=${userId}`);
|
||||
return res || [];
|
||||
} catch (err) {
|
||||
console.warn('[API] 获取收藏列表异常:', err.message);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 探测是否已收藏特定陪玩
|
||||
*/
|
||||
export async function checkFavorite(expertId, userId = 1001) {
|
||||
try {
|
||||
const res = await http.get(`/favorites/check?userId=${userId}&expertId=${expertId}`);
|
||||
return res && res.isFavorite;
|
||||
} catch (err) {
|
||||
console.warn('[API] 探测收藏状态异常:', err.message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加收藏
|
||||
*/
|
||||
export async function addFavorite(expertId, userId = 1001) {
|
||||
try {
|
||||
const res = await http.post('/favorites', { userId, expertId });
|
||||
return res;
|
||||
} catch (err) {
|
||||
console.warn('[API] 添加收藏异常:', err.message);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消收藏
|
||||
*/
|
||||
export async function removeFavorite(expertId, userId = 1001) {
|
||||
try {
|
||||
const res = await http.delete(`/favorites/${expertId}?userId=${userId}`);
|
||||
return res;
|
||||
} catch (err) {
|
||||
console.warn('[API] 取消收藏异常:', err.message);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销团队列表 (一级与二级成员)
|
||||
*/
|
||||
export async function getDistributionTeam(userId = 1001) {
|
||||
try {
|
||||
const res = await http.get(`/distribution/team?userId=${userId}`);
|
||||
return res || { directCount: 0, indirectCount: 0, totalTeamCount: 0, directList: [], indirectList: [] };
|
||||
} catch (err) {
|
||||
console.warn('[API] 获取分销团队异常:', err.message);
|
||||
return { directCount: 0, indirectCount: 0, totalTeamCount: 0, directList: [], indirectList: [] };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销返佣订单记录
|
||||
*/
|
||||
export async function getDistributionRecords(userId = 1001) {
|
||||
try {
|
||||
const res = await http.get(`/distribution/records?userId=${userId}`);
|
||||
return res || [];
|
||||
} catch (err) {
|
||||
console.warn('[API] 获取分销返佣记录异常:', err.message);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 佣金提现申请
|
||||
*/
|
||||
export async function withdrawCommission(amount, channel = 'WECHAT', userId = 1001) {
|
||||
try {
|
||||
const res = await http.post(`/users/${userId}/withdraw`, { amount, channel });
|
||||
return res;
|
||||
} catch (err) {
|
||||
console.warn('[API] 佣金提现申请异常:', err.message);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户