no message

main
HUOJIN\92525 2026-03-13 20:21:26 +08:00
parent d0813512aa
commit 223b05e074
7 changed files with 49 additions and 31 deletions

View File

@ -4,12 +4,8 @@ VITE_USE_MOCK = true
# 发布路径 # 发布路径
VITE_PUBLIC_PATH = / VITE_PUBLIC_PATH = /
# 跨域代理,您可以配置多个 ,请注意,没有换行符 # 跨域代理,您可以配置多个,请注意,没有换行符
VITE_PROXY = [ 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"]]
["/cpte-wms-basic","http://localhost:8001/cpte-wms-basic"],
["/cpte-wms","http://localhost:8000/cpte-wms"],
["/upload","http://localhost:3300/upload"]
]
#后台接口全路径地址 (必填) #后台接口全路径地址 (必填)
VITE_GLOB_DOMAIN_URL=http://localhost:8000/cpte-wms VITE_GLOB_DOMAIN_URL=http://localhost:8000/cpte-wms
@ -25,6 +21,10 @@ VITE_APP_SUB_cpte-app-1 = '//localhost:8092'
# 基础服务微服务地址 (8001 端口) # 基础服务微服务地址 (8001 端口)
VITE_GLOB_BASIC_SERVICE_URL=/cpte-wms-basic 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 将以乾坤子应用模式启动) # 填写后将作为乾坤子应用启动,主应用注册时 AppName 需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示 cpte-vue3 将以乾坤子应用模式启动)
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=cpte-vue3 #VITE_GLOB_QIANKUN_MICRO_APP_NAME=cpte-vue3

View File

@ -23,8 +23,9 @@ VITE_GLOB_DOMAIN_URL=http://10.254.27.192:8000/cpte-wms
VITE_GLOB_API_URL_PREFIX= VITE_GLOB_API_URL_PREFIX=
# 基础服务微服务地址 (8001 端口) # 基础服务微服务地址 (8001 端口)
# 生产环境请根据实际部署情况修改地址
VITE_GLOB_BASIC_SERVICE_URL=http://10.254.27.192:8001/cpte-wms-basic 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将以乾坤子应用模式启动 # 填写后将作为乾坤子应用启动主应用注册时AppName需保持一致放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示cpte-vue3将以乾坤子应用模式启动

View File

@ -15,6 +15,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
VITE_GLOB_ONLINE_VIEW_URL, VITE_GLOB_ONLINE_VIEW_URL,
VITE_GLOB_RUN_PLATFORM, VITE_GLOB_RUN_PLATFORM,
VITE_GLOB_BASIC_SERVICE_URL, VITE_GLOB_BASIC_SERVICE_URL,
VITE_GLOB_INBOUND_SERVICE_URL,
// 【CPTE 作为乾坤子应用】 // 【CPTE 作为乾坤子应用】
VITE_GLOB_QIANKUN_MICRO_APP_NAME, VITE_GLOB_QIANKUN_MICRO_APP_NAME,
VITE_GLOB_QIANKUN_MICRO_APP_ENTRY, VITE_GLOB_QIANKUN_MICRO_APP_ENTRY,
@ -50,6 +51,8 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
qiankunMicroAppEntry: VITE_GLOB_QIANKUN_MICRO_APP_ENTRY, qiankunMicroAppEntry: VITE_GLOB_QIANKUN_MICRO_APP_ENTRY,
// 基础服务微服务地址 // 基础服务微服务地址
basicServiceUrl: VITE_GLOB_BASIC_SERVICE_URL, basicServiceUrl: VITE_GLOB_BASIC_SERVICE_URL,
// 入库服务微服务地址
inboundServiceUrl: VITE_GLOB_INBOUND_SERVICE_URL,
}; };
// 【CPTE作为乾坤子应用】乾坤子应用下需要定义一下 // 【CPTE作为乾坤子应用】乾坤子应用下需要定义一下

View File

@ -49,6 +49,8 @@ export function getAppEnvConfig() {
VITE_GLOB_ONLINE_DOCUMENT_VERSION, VITE_GLOB_ONLINE_DOCUMENT_VERSION,
// 基础服务微服务地址 // 基础服务微服务地址
VITE_GLOB_BASIC_SERVICE_URL, VITE_GLOB_BASIC_SERVICE_URL,
// 入库服务微服务地址
VITE_GLOB_INBOUND_SERVICE_URL,
} = ENV; } = ENV;
// if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) { // if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
@ -79,6 +81,8 @@ export function getAppEnvConfig() {
VITE_GLOB_ONLINE_DOCUMENT_VERSION, VITE_GLOB_ONLINE_DOCUMENT_VERSION,
// 基础服务微服务地址 // 基础服务微服务地址
VITE_GLOB_BASIC_SERVICE_URL, VITE_GLOB_BASIC_SERVICE_URL,
// 入库服务微服务地址
VITE_GLOB_INBOUND_SERVICE_URL,
}; };
} }

View File

@ -319,9 +319,15 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
export const defHttp = createAxios(); export const defHttp = createAxios();
// 基础服务微服务 API (8001 端口) // 基础服务微服务 API (8001 端口)
// 开发环境从 .env.development 读取,生产环境从 .env.production 读取 VITE_GLOB_BASIC_SERVICE_URL
export const basicHttp = createAxios({ export const basicHttp = createAxios({
requestOptions: { requestOptions: {
apiUrl: globSetting.basicServiceUrl apiUrl: globSetting.basicServiceUrl
}, },
}); });
// 入库服务微服务 API (8002 端口)
export const inboundHttp = createAxios({
requestOptions: {
apiUrl: globSetting.inboundServiceUrl
},
});

View File

@ -1,21 +1,21 @@
import { defHttp } from '/@/utils/http/axios'; import { inboundHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage(); const { createConfirm } = useMessage();
enum Api { enum Api {
list = '/receive/asn/list', list = '/api/wms/inbound/asn/list',
save = '/receive/asn/add', save = '/api/wms/inbound/asn/add',
edit = '/receive/asn/edit', edit = '/api/wms/inbound/asn/edit',
deleteOne = '/receive/asn/delete', deleteOne = '/api/wms/inbound/asn/delete',
deleteBatch = '/receive/asn/deleteBatch', deleteBatch = '/api/wms/inbound/asn/deleteBatch',
importExcel = '/receive/asn/importExcel', importExcel = '/api/wms/inbound/asn/importExcel',
exportXls = '/receive/asn/exportXls', exportXls = '/api/wms/inbound/asn/exportXls',
queryDataById = '/receive/asn/queryById', queryDataById = '/api/wms/inbound/asn/queryById',
asnDetailList = '/receive/asn/queryAsnDetailByMainId', asnDetailList = '/api/wms/inbound/asn/queryAsnDetailByMainId',
receiveAsn = '/receive/asn/receiveAsn', receiveAsn = '/api/wms/inbound/asn/receiveAsn',
receiveBack = '/receive/asn/receiveBack', receiveBack = '/api/wms/inbound/asn/receiveBack',
closeAsn = '/receive/asn/closeAsn', closeAsn = '/api/wms/inbound/asn/closeAsn',
} }
/** /**
@ -34,7 +34,7 @@ export const getImportUrl = Api.importExcel;
* @param params * @param params
*/ */
export const queryAsnDetailListByMainId = (id) => export const queryAsnDetailListByMainId = (id) =>
defHttp.get({ inboundHttp.get({
url: Api.asnDetailList, url: Api.asnDetailList,
params: { id }, params: { id },
}); });
@ -43,13 +43,13 @@ export const queryAsnDetailListByMainId = (id) =>
* *
* @param params * @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) => { 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(); handleSuccess();
}); });
}; };
@ -65,7 +65,7 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onOk: () => { onOk: () => {
return defHttp return inboundHttp
.delete( .delete(
{ {
url: Api.deleteBatch, url: Api.deleteBatch,
@ -85,21 +85,21 @@ export const batchDelete = (params, handleSuccess) => {
*/ */
export const saveOrUpdate = (params, isUpdate) => { export const saveOrUpdate = (params, isUpdate) => {
const url = isUpdate ? Api.edit : Api.save; const url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }); return inboundHttp.post({ url: url, params });
}; };
/** /**
* id * id
* @param params * @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 * @param params
*/ */
export const receiveAsn = (id, handleSuccess) => { 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(); handleSuccess();
}); });
}; };
@ -109,17 +109,17 @@ export const receiveAsn = (id, handleSuccess) => {
* @param params * @param params
*/ */
export const receiveBack = (id, handleSuccess) => { 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(); handleSuccess();
}); });
}; };
/** /**
* *
* @param params * @param params
*/ */
export const closeAsn = (ids, handleSuccess) => { 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(); handleSuccess();
}); });
}; };

4
types/config.d.ts vendored
View File

@ -172,6 +172,8 @@ export interface GlobConfig {
qiankunMicroAppEntry?: string; qiankunMicroAppEntry?: string;
// 基础服务微服务地址 // 基础服务微服务地址
basicServiceUrl?: string; basicServiceUrl?: string;
// 入库服务微服务地址
inboundServiceUrl?: string;
} }
export interface GlobEnvConfig { export interface GlobEnvConfig {
// Site title // Site title
@ -207,4 +209,6 @@ export interface GlobEnvConfig {
VITE_GLOB_RUN_PLATFORM?: 'web' | 'electron'; VITE_GLOB_RUN_PLATFORM?: 'web' | 'electron';
// 基础服务微服务地址 // 基础服务微服务地址
VITE_GLOB_BASIC_SERVICE_URL?: string; VITE_GLOB_BASIC_SERVICE_URL?: string;
// 入库服务微服务地址
VITE_GLOB_INBOUND_SERVICE_URL?: string;
} }