feat(shop): 添加分销商申请审核相关功能
- 新增审核通过、驳回和批量审核通过分销商申请的 API 接口 - 移除无用的网站 ID 相关代码 - 优化导入导出功能 - 修复一些组件中的小问题
This commit is contained in:
@@ -103,3 +103,44 @@ export async function getShopDealerApply(id: number) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过分销商申请
|
||||
*/
|
||||
export async function approveShopDealerApply(id: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
`/shop/shop-dealer-apply/${id}/approve`
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 驳回分销商申请
|
||||
*/
|
||||
export async function rejectShopDealerApply(id: number, data: { rejectReason: string }) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
`/shop/shop-dealer-apply/${id}/reject`,
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核通过分销商申请
|
||||
*/
|
||||
export async function batchApproveShopDealerApply(ids: number[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-apply/batch-approve',
|
||||
{ ids }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user