no message
parent
d0813512aa
commit
223b05e074
|
|
@ -4,12 +4,8 @@ VITE_USE_MOCK = true
|
|||
# 发布路径
|
||||
VITE_PUBLIC_PATH = /
|
||||
|
||||
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
||||
VITE_PROXY = [
|
||||
["/cpte-wms-basic","http://localhost:8001/cpte-wms-basic"],
|
||||
["/cpte-wms","http://localhost:8000/cpte-wms"],
|
||||
["/upload","http://localhost:3300/upload"]
|
||||
]
|
||||
# 跨域代理,您可以配置多个,请注意,没有换行符
|
||||
VITE_PROXY=[["/cpte-wms-basic","http://localhost:8001/cpte-wms-basic"],["/cpte-wms-inbound","http://localhost:8002/cpte-wms-inbound"],["/cpte-wms","http://localhost:8000/cpte-wms"],["/upload","http://localhost:3300/upload"]]
|
||||
|
||||
#后台接口全路径地址 (必填)
|
||||
VITE_GLOB_DOMAIN_URL=http://localhost:8000/cpte-wms
|
||||
|
|
@ -25,6 +21,10 @@ VITE_APP_SUB_cpte-app-1 = '//localhost:8092'
|
|||
|
||||
# 基础服务微服务地址 (8001 端口)
|
||||
VITE_GLOB_BASIC_SERVICE_URL=/cpte-wms-basic
|
||||
# 入库服务微服务地址 (8002 端口)
|
||||
VITE_GLOB_INBOUND_SERVICE_URL=/cpte-wms-inbound
|
||||
|
||||
|
||||
|
||||
# 填写后将作为乾坤子应用启动,主应用注册时 AppName 需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示 cpte-vue3 将以乾坤子应用模式启动)
|
||||
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=cpte-vue3
|
||||
|
|
|
|||
|
|
@ -23,8 +23,9 @@ VITE_GLOB_DOMAIN_URL=http://10.254.27.192:8000/cpte-wms
|
|||
VITE_GLOB_API_URL_PREFIX=
|
||||
|
||||
# 基础服务微服务地址 (8001 端口)
|
||||
# 生产环境请根据实际部署情况修改地址
|
||||
VITE_GLOB_BASIC_SERVICE_URL=http://10.254.27.192:8001/cpte-wms-basic
|
||||
# 入库服务微服务地址 (8002 端口)
|
||||
VITE_GLOB_INBOUND_SERVICE_URL=http://10.254.27.192:8002/cpte-wms-inbound
|
||||
|
||||
|
||||
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示cpte-vue3将以乾坤子应用模式启动)
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
|
|||
VITE_GLOB_ONLINE_VIEW_URL,
|
||||
VITE_GLOB_RUN_PLATFORM,
|
||||
VITE_GLOB_BASIC_SERVICE_URL,
|
||||
VITE_GLOB_INBOUND_SERVICE_URL,
|
||||
// 【CPTE 作为乾坤子应用】
|
||||
VITE_GLOB_QIANKUN_MICRO_APP_NAME,
|
||||
VITE_GLOB_QIANKUN_MICRO_APP_ENTRY,
|
||||
|
|
@ -50,6 +51,8 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
|
|||
qiankunMicroAppEntry: VITE_GLOB_QIANKUN_MICRO_APP_ENTRY,
|
||||
// 基础服务微服务地址
|
||||
basicServiceUrl: VITE_GLOB_BASIC_SERVICE_URL,
|
||||
// 入库服务微服务地址
|
||||
inboundServiceUrl: VITE_GLOB_INBOUND_SERVICE_URL,
|
||||
};
|
||||
|
||||
// 【CPTE作为乾坤子应用】乾坤子应用下,需要定义一下
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ export function getAppEnvConfig() {
|
|||
VITE_GLOB_ONLINE_DOCUMENT_VERSION,
|
||||
// 基础服务微服务地址
|
||||
VITE_GLOB_BASIC_SERVICE_URL,
|
||||
// 入库服务微服务地址
|
||||
VITE_GLOB_INBOUND_SERVICE_URL,
|
||||
} = ENV;
|
||||
|
||||
// if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
|
||||
|
|
@ -79,6 +81,8 @@ export function getAppEnvConfig() {
|
|||
VITE_GLOB_ONLINE_DOCUMENT_VERSION,
|
||||
// 基础服务微服务地址
|
||||
VITE_GLOB_BASIC_SERVICE_URL,
|
||||
// 入库服务微服务地址
|
||||
VITE_GLOB_INBOUND_SERVICE_URL,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -319,9 +319,15 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
|
|||
export const defHttp = createAxios();
|
||||
|
||||
// 基础服务微服务 API (8001 端口)
|
||||
// 开发环境从 .env.development 读取,生产环境从 .env.production 读取 VITE_GLOB_BASIC_SERVICE_URL
|
||||
export const basicHttp = createAxios({
|
||||
requestOptions: {
|
||||
apiUrl: globSetting.basicServiceUrl
|
||||
},
|
||||
});
|
||||
|
||||
// 入库服务微服务 API (8002 端口)
|
||||
export const inboundHttp = createAxios({
|
||||
requestOptions: {
|
||||
apiUrl: globSetting.inboundServiceUrl
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { inboundHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/receive/asn/list',
|
||||
save = '/receive/asn/add',
|
||||
edit = '/receive/asn/edit',
|
||||
deleteOne = '/receive/asn/delete',
|
||||
deleteBatch = '/receive/asn/deleteBatch',
|
||||
importExcel = '/receive/asn/importExcel',
|
||||
exportXls = '/receive/asn/exportXls',
|
||||
queryDataById = '/receive/asn/queryById',
|
||||
asnDetailList = '/receive/asn/queryAsnDetailByMainId',
|
||||
receiveAsn = '/receive/asn/receiveAsn',
|
||||
receiveBack = '/receive/asn/receiveBack',
|
||||
closeAsn = '/receive/asn/closeAsn',
|
||||
list = '/api/wms/inbound/asn/list',
|
||||
save = '/api/wms/inbound/asn/add',
|
||||
edit = '/api/wms/inbound/asn/edit',
|
||||
deleteOne = '/api/wms/inbound/asn/delete',
|
||||
deleteBatch = '/api/wms/inbound/asn/deleteBatch',
|
||||
importExcel = '/api/wms/inbound/asn/importExcel',
|
||||
exportXls = '/api/wms/inbound/asn/exportXls',
|
||||
queryDataById = '/api/wms/inbound/asn/queryById',
|
||||
asnDetailList = '/api/wms/inbound/asn/queryAsnDetailByMainId',
|
||||
receiveAsn = '/api/wms/inbound/asn/receiveAsn',
|
||||
receiveBack = '/api/wms/inbound/asn/receiveBack',
|
||||
closeAsn = '/api/wms/inbound/asn/closeAsn',
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -34,7 +34,7 @@ export const getImportUrl = Api.importExcel;
|
|||
* @param params
|
||||
*/
|
||||
export const queryAsnDetailListByMainId = (id) =>
|
||||
defHttp.get({
|
||||
inboundHttp.get({
|
||||
url: Api.asnDetailList,
|
||||
params: { id },
|
||||
});
|
||||
|
|
@ -43,13 +43,13 @@ export const queryAsnDetailListByMainId = (id) =>
|
|||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
export const list = (params) => inboundHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
return inboundHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
|
@ -65,7 +65,7 @@ export const batchDelete = (params, handleSuccess) => {
|
|||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp
|
||||
return inboundHttp
|
||||
.delete(
|
||||
{
|
||||
url: Api.deleteBatch,
|
||||
|
|
@ -85,21 +85,21 @@ export const batchDelete = (params, handleSuccess) => {
|
|||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params });
|
||||
return inboundHttp.post({ url: url, params });
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据id查询数据
|
||||
* @param params
|
||||
*/
|
||||
export const queryDataById = (id) => defHttp.get({ url: Api.queryDataById, params: { id } });
|
||||
export const queryDataById = (id) => inboundHttp.get({ url: Api.queryDataById, params: { id } });
|
||||
|
||||
/**
|
||||
* 整单入库
|
||||
* @param params
|
||||
*/
|
||||
export const receiveAsn = (id, handleSuccess) => {
|
||||
return defHttp.get({ url: Api.receiveAsn, params: { id } }, { joinParamsToUrl: true }).then(() => {
|
||||
return inboundHttp.get({ url: Api.receiveAsn, params: { id } }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
|
@ -109,17 +109,17 @@ export const receiveAsn = (id, handleSuccess) => {
|
|||
* @param params
|
||||
*/
|
||||
export const receiveBack = (id, handleSuccess) => {
|
||||
return defHttp.get({ url: Api.receiveBack, params: { id } }, { joinParamsToUrl: true }).then(() => {
|
||||
return inboundHttp.get({ url: Api.receiveBack, params: { id } }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 出库单关闭
|
||||
* 入库单关闭
|
||||
* @param params
|
||||
*/
|
||||
export const closeAsn = (ids, handleSuccess) => {
|
||||
return defHttp.get({ url: Api.closeAsn, params: { ids } }, { joinParamsToUrl: true }).then(() => {
|
||||
return inboundHttp.get({ url: Api.closeAsn, params: { ids } }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -172,6 +172,8 @@ export interface GlobConfig {
|
|||
qiankunMicroAppEntry?: string;
|
||||
// 基础服务微服务地址
|
||||
basicServiceUrl?: string;
|
||||
// 入库服务微服务地址
|
||||
inboundServiceUrl?: string;
|
||||
}
|
||||
export interface GlobEnvConfig {
|
||||
// Site title
|
||||
|
|
@ -207,4 +209,6 @@ export interface GlobEnvConfig {
|
|||
VITE_GLOB_RUN_PLATFORM?: 'web' | 'electron';
|
||||
// 基础服务微服务地址
|
||||
VITE_GLOB_BASIC_SERVICE_URL?: string;
|
||||
// 入库服务微服务地址
|
||||
VITE_GLOB_INBOUND_SERVICE_URL?: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue