feat: get is vip

This commit is contained in:
chashaobao
2025-07-07 22:08:51 +08:00
parent 2c48a70b6d
commit 42d1208ee4
7 changed files with 16 additions and 11 deletions

View File

@ -54,13 +54,13 @@ export async function requestUseProduct(
}
// 获取某个产品的剩余解锁次数
export async function requestProductBalance(productCode: ProductType) {
export async function requestProductBalance(productCode: ProductType): Promise<[number, boolean | undefined]> {
const data: GetProductDetailRequest = { productCode, userId: getUserId() };
const { balance } = await http.post<ProductInfo>(API.GET_PRODUCT_DETAIL, {
const { balance, isPaidVip } = await http.post<ProductInfo>(API.GET_PRODUCT_DETAIL, {
data,
contentType: 'application/x-www-form-urlencoded',
});
return balance;
return [balance, isPaidVip];
}
// 是否可以购买某一个产品