no message

main
HUOJIN\92525 2026-03-07 20:30:18 +08:00
parent ead5985316
commit 93b0d36771
10 changed files with 111 additions and 92 deletions

View File

@ -17,9 +17,12 @@ VITE_GLOB_API_URL=/cpte-wms
# 接口前缀 # 接口前缀
VITE_GLOB_API_URL_PREFIX= VITE_GLOB_API_URL_PREFIX=
#微前端qiankun应用,命名必须以VITE_APP_SUB_开头,cpte-app-1为子应用的项目名称,也是子应用的路由父路径 #微前端 qiankun 应用,命名必须以 VITE_APP_SUB_开头cpte-app-1 为子应用的项目名称,也是子应用的路由父路径
VITE_APP_SUB_cpte-app-1 = '//localhost:8092' VITE_APP_SUB_cpte-app-1 = '//localhost:8092'
# 基础服务微服务地址 (8001 端口)
VITE_GLOB_BASIC_SERVICE_URL=http://localhost:8001/cpte-wms-basic/api/wms/basic
# 填写后将作为乾坤子应用启动,主应用注册时 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

@ -22,6 +22,10 @@ VITE_GLOB_DOMAIN_URL=http://10.254.27.192:8000/cpte-wms
# 接口父路径前缀 # 接口父路径前缀
VITE_GLOB_API_URL_PREFIX= VITE_GLOB_API_URL_PREFIX=
# 基础服务微服务地址 (8001 端口)
# 生产环境请根据实际部署情况修改地址
VITE_GLOB_BASIC_SERVICE_URL=http://10.254.27.192:8001/cpte-wms-basic/api/wms/basic
# 填写后将作为乾坤子应用启动主应用注册时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

@ -14,6 +14,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
VITE_GLOB_DOMAIN_URL, VITE_GLOB_DOMAIN_URL,
VITE_GLOB_ONLINE_VIEW_URL, VITE_GLOB_ONLINE_VIEW_URL,
VITE_GLOB_RUN_PLATFORM, VITE_GLOB_RUN_PLATFORM,
VITE_GLOB_BASIC_SERVICE_URL,
// 【CPTE 作为乾坤子应用】 // 【CPTE 作为乾坤子应用】
VITE_GLOB_QIANKUN_MICRO_APP_NAME, VITE_GLOB_QIANKUN_MICRO_APP_NAME,
@ -48,6 +49,8 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
isQiankunMicro: VITE_GLOB_QIANKUN_MICRO_APP_NAME != null && VITE_GLOB_QIANKUN_MICRO_APP_NAME !== '', isQiankunMicro: VITE_GLOB_QIANKUN_MICRO_APP_NAME != null && VITE_GLOB_QIANKUN_MICRO_APP_NAME !== '',
// 【CPTE 作为乾坤子应用】乾坤子应用入口 // 【CPTE 作为乾坤子应用】乾坤子应用入口
qiankunMicroAppEntry: VITE_GLOB_QIANKUN_MICRO_APP_ENTRY, qiankunMicroAppEntry: VITE_GLOB_QIANKUN_MICRO_APP_ENTRY,
// 基础服务微服务地址
basicServiceUrl: VITE_GLOB_BASIC_SERVICE_URL,
}; };
// 【CPTE作为乾坤子应用】乾坤子应用下需要定义一下 // 【CPTE作为乾坤子应用】乾坤子应用下需要定义一下

View File

@ -47,6 +47,8 @@ export function getAppEnvConfig() {
//在线文档编辑版本。可选属性wps, onlyoffice //在线文档编辑版本。可选属性wps, onlyoffice
VITE_GLOB_ONLINE_DOCUMENT_VERSION, VITE_GLOB_ONLINE_DOCUMENT_VERSION,
// 基础服务微服务地址
VITE_GLOB_BASIC_SERVICE_URL,
} = ENV; } = ENV;
// if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) { // if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
@ -74,7 +76,9 @@ export function getAppEnvConfig() {
VITE_GLOB_QIANKUN_MICRO_APP_ENTRY, VITE_GLOB_QIANKUN_MICRO_APP_ENTRY,
//在线文档编辑版本。可选属性wps, onlyoffice //在线文档编辑版本。可选属性wps, onlyoffice
VITE_GLOB_ONLINE_DOCUMENT_VERSION VITE_GLOB_ONLINE_DOCUMENT_VERSION,
// 基础服务微服务地址
VITE_GLOB_BASIC_SERVICE_URL,
}; };
} }

View File

@ -318,9 +318,10 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
} }
export const defHttp = createAxios(); export const defHttp = createAxios();
// other api url // 基础服务微服务 API (8001 端口)
// export const otherHttp = createAxios({ // 开发环境从 .env.development 读取,生产环境从 .env.production 读取 VITE_GLOB_BASIC_SERVICE_URL
// requestOptions: { export const basicHttp = createAxios({
// apiUrl: 'xxx', requestOptions: {
// }, apiUrl: globSetting.basicServiceUrl,
// }); },
});

View File

@ -1,17 +1,17 @@
import { defHttp } from '/@/utils/http/axios'; import { basicHttp } 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 = '/base/area/list', list = '/area/list',
queryById='/base/area/queryById', queryById='/area/queryById',
save = '/base/area/add', save = '/area/add',
edit = '/base/area/edit', edit = '/area/edit',
deleteOne = '/base/area/delete', deleteOne = '/area/delete',
deleteBatch = '/base/area/deleteBatch', deleteBatch = '/area/deleteBatch',
importExcel = '/base/area/importExcel', importExcel = '/area/importExcel',
exportXls = '/base/area/exportXls', exportXls = '/area/exportXls',
} }
/** /**
@ -29,20 +29,20 @@ export const getImportUrl = Api.importExcel;
* *
* @param params * @param params
*/ */
export const list = (params) => defHttp.get({ url: Api.list, params }); export const list = (params) => basicHttp.get({ url: Api.list, params });
/** /**
* id * id
* @param params * @param params
*/ */
export const queryById = (params) => defHttp.get({ url: Api.queryById, params }); export const queryById = (params) => basicHttp.get({ url: Api.queryById, params });
/** /**
* *
* @param params * @param params
* @param handleSuccess * @param handleSuccess
*/ */
export const deleteOne = (params, handleSuccess) => { export const deleteOne = (params, handleSuccess) => {
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => { return basicHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess(); handleSuccess();
}); });
}; };
@ -60,7 +60,7 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onOk: () => { onOk: () => {
return defHttp return basicHttp
.delete( .delete(
{ {
url: Api.deleteBatch, url: Api.deleteBatch,
@ -82,6 +82,6 @@ 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 }, { isTransformResponse: false }); return basicHttp.post({ url: url, params }, { isTransformResponse: false });
}; };

View File

@ -1,17 +1,17 @@
import { defHttp } from '/@/utils/http/axios'; import { basicHttp } 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 = '/base/item/list', list = '/item/list',
queryById = '/base/item/queryById', queryById = '/item/queryById',
save = '/base/item/add', save = '/item/add',
edit = '/base/item/edit', edit = '/item/edit',
deleteOne = '/base/item/delete', deleteOne = '/item/delete',
deleteBatch = '/base/item/deleteBatch', deleteBatch = '/item/deleteBatch',
importExcel = '/base/item/importExcel', importExcel = '/item/importExcel',
exportXls = '/base/item/exportXls', exportXls = '/item/exportXls',
} }
/** /**
@ -29,13 +29,13 @@ export const getImportUrl = Api.importExcel;
* *
* @param params * @param params
*/ */
export const list = (params) => defHttp.get({ url: Api.list, params }); export const list = (params) => basicHttp.get({ url: Api.list, params });
/** /**
* id * id
* @param params * @param params
*/ */
export const queryById = (params) => defHttp.get({ url: Api.queryById, params }); export const queryById = (params) => basicHttp.get({ url: Api.queryById, params });
/** /**
* *
@ -43,7 +43,7 @@ export const queryById = (params) => defHttp.get({ url: Api.queryById, params })
* @param handleSuccess * @param handleSuccess
*/ */
export const deleteOne = (params, handleSuccess) => { export const deleteOne = (params, handleSuccess) => {
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => { return basicHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess(); handleSuccess();
}); });
}; };
@ -61,7 +61,7 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onOk: () => { onOk: () => {
return defHttp return basicHttp
.delete( .delete(
{ {
url: Api.deleteBatch, url: Api.deleteBatch,
@ -83,5 +83,5 @@ 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 }, { isTransformResponse: false }); return basicHttp.post({ url: url, params }, { isTransformResponse: false });
}; };

View File

@ -1,18 +1,18 @@
import { defHttp } from '/@/utils/http/axios'; import { basicHttp } 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 = '/base/point/list', list = '/point/list',
queryById='/base/point/queryById', queryById='/point/queryById',
save='/base/point/add', save='/point/add',
edit='/base/point/edit', edit='/point/edit',
deleteOne = '/base/point/delete', deleteOne = '/point/delete',
deleteBatch = '/base/point/deleteBatch', deleteBatch = '/point/deleteBatch',
importExcel = '/base/point/importExcel', importExcel = '/point/importExcel',
exportXls = '/base/point/exportXls', exportXls = '/point/exportXls',
queryOutWorkStation='/base/point/queryOutWorkStation', queryOutWorkStation='/point/queryOutWorkStation',
} }
/** /**
@ -30,14 +30,14 @@ export const getImportUrl = Api.importExcel;
* *
* @param params * @param params
*/ */
export const list = (params) => defHttp.get({ url: Api.list, params }); export const list = (params) => basicHttp.get({ url: Api.list, params });
/** /**
* id * id
* @param params * @param params
*/ */
export const queryById = (params) => defHttp.get({ url: Api.queryById, params }); export const queryById = (params) => basicHttp.get({ url: Api.queryById, params });
/** /**
* *
@ -45,7 +45,7 @@ export const queryById = (params) => defHttp.get({ url: Api.queryById, params })
* @param handleSuccess * @param handleSuccess
*/ */
export const deleteOne = (params,handleSuccess) => { export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { return basicHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess(); handleSuccess();
}); });
} }
@ -63,7 +63,7 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onOk: () => { onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { return basicHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess(); handleSuccess();
}); });
} }
@ -77,11 +77,11 @@ 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 }, { isTransformResponse: false }); return basicHttp.post({ url: url, params }, { isTransformResponse: false });
} }
export const queryOutWorkStation = (params) => defHttp.get( export const queryOutWorkStation = (params) => basicHttp.get(
{ url: Api.queryOutWorkStation, params }, { url: Api.queryOutWorkStation, params },
{isTransformResponse: false,} {isTransformResponse: false,}
); );

View File

@ -1,17 +1,17 @@
import { defHttp } from '/@/utils/http/axios'; import { basicHttp } 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 = '/base/stock/list', list = '/stock/list',
queryById='/base/stock/queryById', queryById='/stock/queryById',
save='/base/stock/add', save='/stock/add',
edit='/base/stock/edit', edit='/stock/edit',
deleteOne = '/base/stock/delete', deleteOne = '/stock/delete',
deleteBatch = '/base/stock/deleteBatch', deleteBatch = '/stock/deleteBatch',
importExcel = '/base/stock/importExcel', importExcel = '/stock/importExcel',
exportXls = '/base/stock/exportXls', exportXls = '/stock/exportXls',
} }
/** /**
@ -29,13 +29,13 @@ export const getImportUrl = Api.importExcel;
* *
* @param params * @param params
*/ */
export const list = (params) => defHttp.get({ url: Api.list, params }); export const list = (params) => basicHttp.get({ url: Api.list, params });
/** /**
* id * id
* @param params * @param params
*/ */
export const queryById = (params) => defHttp.get({ url: Api.queryById, params }); export const queryById = (params) => basicHttp.get({ url: Api.queryById, params });
/** /**
* *
@ -43,7 +43,7 @@ export const queryById = (params) => defHttp.get({ url: Api.queryById, params })
* @param handleSuccess * @param handleSuccess
*/ */
export const deleteOne = (params,handleSuccess) => { export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { return basicHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess(); handleSuccess();
}); });
} }
@ -61,7 +61,7 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onOk: () => { onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { return basicHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess(); handleSuccess();
}); });
} }
@ -75,5 +75,5 @@ export const batchDelete = (params, handleSuccess) => {
*/ */
export const saveOrUpdate = (params, isUpdate) => { export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save; let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false }); return basicHttp.post({ url: url, params }, { isTransformResponse: false });
} }

4
types/config.d.ts vendored
View File

@ -170,6 +170,8 @@ export interface GlobConfig {
isQiankunMicro: boolean; isQiankunMicro: boolean;
// 【CPTE 作为乾坤子应用】乾坤子应用入口 // 【CPTE 作为乾坤子应用】乾坤子应用入口
qiankunMicroAppEntry?: string; qiankunMicroAppEntry?: string;
// 基础服务微服务地址
basicServiceUrl?: string;
} }
export interface GlobEnvConfig { export interface GlobEnvConfig {
// Site title // Site title
@ -203,4 +205,6 @@ export interface GlobEnvConfig {
VITE_GLOB_ONLINE_DOCUMENT_VERSION?: string; VITE_GLOB_ONLINE_DOCUMENT_VERSION?: string;
// 当前运行在什么平台 // 当前运行在什么平台
VITE_GLOB_RUN_PLATFORM?: 'web' | 'electron'; VITE_GLOB_RUN_PLATFORM?: 'web' | 'electron';
// 基础服务微服务地址
VITE_GLOB_BASIC_SERVICE_URL?: string;
} }