diff --git a/.env b/.env new file mode 100644 index 0000000..1346fe7 --- /dev/null +++ b/.env @@ -0,0 +1,11 @@ +# 租户配置(必填) +VITE_TENANT_ID=10606 + +# 租户名称 +VITE_TENANT_NAME=桂礼序 + +# WebSoftAdmin 授权码 (必填-请联系官方获取) +VITE_LICENSE_CODE=dk9mcwJyetRWQlxWRiojIzJCLi8mcQ5Wa4ojI0NWZqJWd6ICZpJCL0kjNvdjbE5WQ2AjIvl2cyVmdiwiIiETMuEjI6IibQf0NW== + +# 服务端 API 配置(可选) +VITE_SERVER_API_URL=https://server.websoft.top/api diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..6afaae4 --- /dev/null +++ b/.env.development @@ -0,0 +1,7 @@ +VITE_APP_NAME=后台管理(开发环境) +#VITE_API_URL=http://127.0.0.1:9200/api +#VITE_SERVER_API_URL=http://127.0.0.1:8000/api + +# +VITE_API_URL=https://guilixu-api.websoft.top/api +#VITE_SERVER_API_URL=http://47.107.249.41:8000/api diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..1b438d0 --- /dev/null +++ b/.env.production @@ -0,0 +1,6 @@ +# 服务端 API 配置(可选) +VITE_SERVER_API_URL=https://server.websoft.top/api +# API 配置(必填) +VITE_API_URL=https://guilixu-api.websoft.top/api +# WebSoftAdmin 授权码 (必填-请联系官方获取) +VITE_LICENSE_CODE=dk9mcwJyetRWQlxWRiojIzJCLi8mcQ5Wa4ojI0NWZqJWd6ICZpJCL0kjNvdjbE5WQ2AjIvl2cyVmdiwiIiETMuEjI6IibQf0NW== diff --git a/src/api/shop/shopGoods/index.ts b/src/api/shop/shopGoods/index.ts index 7de5915..5479fc2 100644 --- a/src/api/shop/shopGoods/index.ts +++ b/src/api/shop/shopGoods/index.ts @@ -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>( + 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)); +} diff --git a/src/api/shop/shopGoods/model/index.ts b/src/api/shop/shopGoods/model/index.ts index 17ffe29..3756be8 100644 --- a/src/api/shop/shopGoods/model/index.ts +++ b/src/api/shop/shopGoods/model/index.ts @@ -152,6 +152,16 @@ export interface BathSet { skuNo?: string; } +/** + * 商品链接采集参数 + */ +export interface ShopGoodsCollectParam { + url: string; + categoryId?: number; + status?: number; + merchantId?: number; +} + /** * 商品记录表搜索条件 */ diff --git a/src/views/shop/shopGoods/components/search.vue b/src/views/shop/shopGoods/components/search.vue index 9dd0c28..122451d 100644 --- a/src/views/shop/shopGoods/components/search.vue +++ b/src/views/shop/shopGoods/components/search.vue @@ -25,6 +25,12 @@ 导入 + + + 采集 + 导出xls @@ -64,10 +70,10 @@ diff --git a/src/views/shop/shopGoods/index.vue b/src/views/shop/shopGoods/index.vue index dac97ec..7e1a201 100644 --- a/src/views/shop/shopGoods/index.vue +++ b/src/views/shop/shopGoods/index.vue @@ -1,5 +1,5 @@ @@ -85,11 +86,19 @@ v-model:visible="showImport" @done="reload" /> + + +