Merge remote-tracking branch 'origin/main'
# Conflicts: # .env # .env.development # .env.production # src/api/shop/shopGoods/index.ts # src/views/shop/shopGoods/components/search.vue # src/views/shop/shopGoods/index.vue
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopGoods, ShopGoodsCollectParam, ShopGoodsParam } from './model';
|
||||
import type { ShopGoods, ShopGoodsParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
@@ -132,12 +132,14 @@ export async function importShopGoods(file: File) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过商品链接采集入库
|
||||
* 导入商品图片
|
||||
*/
|
||||
export async function collectShopGoods(data: ShopGoodsCollectParam) {
|
||||
export async function importShopGoodsImages(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods/collect',
|
||||
data
|
||||
MODULES_API_URL + '/shop/shop-goods/import/images',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
|
||||
@@ -14,6 +14,8 @@ export interface ShopGoodsCategory {
|
||||
type?: number;
|
||||
// 分类图片
|
||||
image?: string;
|
||||
// 广告图
|
||||
adImage?: string;
|
||||
// 上级分类ID
|
||||
parentId?: number;
|
||||
// 路由/链接地址
|
||||
|
||||
Reference in New Issue
Block a user