diff --git a/src/pages/database/goods/newgoods/service.js b/src/pages/database/goods/newgoods/service.js index 8b6c758..dc1d0cc 100644 --- a/src/pages/database/goods/newgoods/service.js +++ b/src/pages/database/goods/newgoods/service.js @@ -2,10 +2,10 @@ /* eslint-disable */ import { request } from 'umi'; - +import { getDataBaseUrl } from '@/global_data'; /** 获取商品 sdsa GET /kitchen/api/rule */ export async function goods(data) { - return request(`/saasbase/api/goods/page`, { + return request(getDataBaseUrl()+`/api/goods/page`, { method: 'Post', data: data, // params: { ...params }, @@ -13,7 +13,7 @@ export async function goods(data) { }); } export async function getbompage (data) { - return request(`/saasbase/api/bom/getpage`, { + return request(getDataBaseUrl()+`/api/bom/getpage`, { method: 'Post', data: data, // params: { ...params }, @@ -21,7 +21,7 @@ export async function getbompage (data) { }); } export async function AddBomApi (data) { - return request(`/saasbase/api/GoodsBom/AddBom`, { + return request(getDataBaseUrl()+`/api/GoodsBom/AddBom`, { method: 'Post', data: data, // params: { ...params }, @@ -29,7 +29,7 @@ export async function AddBomApi (data) { }); } export async function getBomInfo (data) { - return request(`/saasbase/api/GoodsBom/getBomInfo`, { + return request(getDataBaseUrl()+`/api/GoodsBom/getBomInfo`, { method: 'Post', data: data, // params: { ...params }, @@ -41,7 +41,7 @@ export async function getBomInfo (data) { export async function addGoods(data) { // http://localhost:7002 - return request(`/saasbase/api/goods/add`, { + return request(getDataBaseUrl()+`/api/goods/add`, { method: 'POST', // type:'json', data: data, @@ -52,7 +52,7 @@ export async function addGoods(data) { export async function updateGoods(data) { console.log('商品数据修改', data); - return request(`/saasbase/api/goods/update`, { + return request(getDataBaseUrl()+`/api/goods/update`, { method: 'Post', data: data, // ...(options || {}), @@ -61,7 +61,7 @@ export async function updateGoods(data) { /** 删除商品 DELETE /kitchen/api/rule */ export async function removeGoods(data) { - return request(`/saasbase/api/goods/delete?id=`+data, { + return request(getDataBaseUrl()+`/api/goods/delete?id=`+data, { method: 'Get', // ...(options || {}), @@ -70,7 +70,7 @@ export async function removeGoods(data) { /** 获取商品类型 sdsa GET /kitchen/api/rule */ export async function goodsType(data) { - return request(`/saasbase/api/goods-type/goods-types`, { + return request(getDataBaseUrl()+`/api/goods-type/goods-types`, { method: 'POST', data: data, // params: { ...params }, @@ -78,7 +78,7 @@ export async function goodsType(data) { }); } export async function gettree(params) { - return request('​/saasbase/api​/goodstype/tree', { + return request(getDataBaseUrl()+'​/api​/goodstype/tree', { method: 'GET', data: { ...params, @@ -86,17 +86,17 @@ export async function gettree(params) { }); } export async function getgoodsTaste(data) { - return request(`/saasbase/api/goodstaste/getlist`); + return request(getDataBaseUrl()+`/api/goodstaste/getlist`); } export async function upload(data) { - return request(`/saasbase//api/goods/exportgood`,{ + return request(getDataBaseUrl()+`/api/goods/exportgood`,{ method: 'POST', data: data, }); } export async function GoodsTemplateExport() { - return request(`/saasbase/api/goods/goodstemplateexport`, { + return request(getDataBaseUrl()+`/api/goods/goodstemplateexport`, { method: 'post', responseType: 'blob' });