From 223b05e074b242ef7e39710a90d10763bf36a144 Mon Sep 17 00:00:00 2001 From: "HUOJIN\\92525" Date: Fri, 13 Mar 2026 20:21:26 +0800 Subject: [PATCH] no message --- .env.development | 12 ++++----- .env.production | 3 ++- src/hooks/setting/index.ts | 3 +++ src/utils/env.ts | 4 +++ src/utils/http/axios/index.ts | 8 +++++- src/views/receive/asn/Asn.api.ts | 46 ++++++++++++++++---------------- types/config.d.ts | 4 +++ 7 files changed, 49 insertions(+), 31 deletions(-) diff --git a/.env.development b/.env.development index 6eb1f17..9755eef 100644 --- a/.env.development +++ b/.env.development @@ -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 diff --git a/.env.production b/.env.production index 03504b1..f333a1a 100644 --- a/.env.production +++ b/.env.production @@ -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将以乾坤子应用模式启动) diff --git a/src/hooks/setting/index.ts b/src/hooks/setting/index.ts index 2bb1c6d..5cfc871 100644 --- a/src/hooks/setting/index.ts +++ b/src/hooks/setting/index.ts @@ -15,6 +15,7 @@ export const useGlobSetting = (): Readonly => { 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 => { qiankunMicroAppEntry: VITE_GLOB_QIANKUN_MICRO_APP_ENTRY, // 基础服务微服务地址 basicServiceUrl: VITE_GLOB_BASIC_SERVICE_URL, + // 入库服务微服务地址 + inboundServiceUrl: VITE_GLOB_INBOUND_SERVICE_URL, }; // 【CPTE作为乾坤子应用】乾坤子应用下,需要定义一下 diff --git a/src/utils/env.ts b/src/utils/env.ts index 483ff8b..13e4d61 100644 --- a/src/utils/env.ts +++ b/src/utils/env.ts @@ -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, }; } diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index 9ba4886..abc9f41 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -319,9 +319,15 @@ function createAxios(opt?: Partial) { 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 + }, +}); diff --git a/src/views/receive/asn/Asn.api.ts b/src/views/receive/asn/Asn.api.ts index 2928948..9914f13 100644 --- a/src/views/receive/asn/Asn.api.ts +++ b/src/views/receive/asn/Asn.api.ts @@ -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(); }); }; diff --git a/types/config.d.ts b/types/config.d.ts index fc47595..3e970a5 100644 --- a/types/config.d.ts +++ b/types/config.d.ts @@ -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; }