This commit is contained in:
2026-06-01 10:26:27 +08:00
parent e4f9eedb80
commit 1716fb8209
8 changed files with 243 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopGoods, ShopGoodsParam } from './model';
import type { ShopGoods, ShopGoodsCollectParam, ShopGoodsParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
@@ -130,3 +130,17 @@ export async function importShopGoods(file: File) {
}
return Promise.reject(new Error(res.data.message));
}
/**
* 通过商品链接采集入库
*/
export async function collectShopGoods(data: ShopGoodsCollectParam) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-goods/collect',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}