This commit is contained in:
2026-03-02 14:32:58 +08:00
parent ced2cd04db
commit 70f0f98cf9
4 changed files with 293 additions and 13 deletions

View File

@@ -278,3 +278,67 @@ export function getInviteLink(params) {
const queryString = buildQueryString(params || {});
return useApiFetch(`/agent/invite_link${queryString}`).get().json();
}
// ==================== 白名单相关接口 ====================
/**
* 获取可屏蔽的 feature 列表(带价格)
*/
export function getWhitelistFeatures() {
return useApiFetch("/agent/whitelist/features").get().json();
}
/**
* 创建白名单订单
* @param {object} params - 创建参数
* @param {string} params.id_card - 身份证号
* @param {string[]} params.feature_ids - 要屏蔽的 feature ID 列表
* @param {string} params.order_id - 关联的查询订单 ID可选
*/
export function createWhitelistOrder(params) {
return useApiFetch("/agent/whitelist/order/create").post(params).json();
}
/**
* 查询白名单列表
* @param {object} params - 查询参数
* @param {number} params.page - 页码
* @param {number} params.page_size - 每页数量
* @param {string} params.id_card - 身份证号(可选)
*/
export function getWhitelistList(params) {
const queryString = buildQueryString(params || {});
return useApiFetch(`/agent/whitelist/list${queryString}`).get().json();
}
/**
* 检查模块是否已下架
* @param {object} params - 查询参数
* @param {string} params.id_card - 身份证号
* @param {string} params.feature_api_id - Feature 的 API 标识
* @param {string} params.query_id - 查询记录 ID可选
*/
export function checkFeatureWhitelistStatus(params) {
const queryString = buildQueryString(params || {});
return useApiFetch(`/agent/whitelist/check${queryString}`).get().json();
}
/**
* 下架单个模块(创建订单并支付或免费下架)
* @param {object} params - 下架参数
* @param {string} params.query_id - 查询记录 ID
* @param {string} params.feature_api_id - Feature 的 API 标识
*/
export function offlineFeature(params) {
return useApiFetch("/agent/whitelist/offline").post(params).json();
}
/**
* 检查订单是否属于当前代理推广
* @param {object} params - 查询参数
* @param {string} params.order_id - 订单 ID
*/
export function checkOrderAgent(params) {
const queryString = buildQueryString(params || {});
return useApiFetch(`/agent/order/agent${queryString}`).get().json();
}