feat(all): 修改配置

This commit is contained in:
NICE CODE BY DEV 2024-05-06 17:44:39 +08:00
parent bb22f22373
commit 0ca9a39710
5 changed files with 33 additions and 9 deletions

11
config/config.prod.ts Normal file
View File

@ -0,0 +1,11 @@
import { defineConfig } from '@umijs/max';
export default defineConfig({
define: {
APP_ENV: 'production',
CABINET_HOST: '/cabinet/',
VIDEO_HOST: '/video/',
ALGORITHM_HOST: '/algorithm/',
MATERIAL_HOST: '/material/',
},
});

View File

@ -18,6 +18,7 @@ export default defineConfig({
routes,
npmClient: 'pnpm',
define: {
APP_ENV: process.env.NODE_ENV || 'production',
APP_ENV: process.env.NODE_ENV || 'development',
COMMON_URL: 'http://10.0.0.204:30058', // 基建服务
},
});

4
global.d.ts vendored
View File

@ -1 +1,5 @@
declare const APP_ENV: string;
declare const COMMON_URL: string;
declare const VIDEO_HOST: string;
declare const ALGORITHM_HOST: string;
declare const MATERIAL_HOST: string;

View File

@ -18,6 +18,8 @@
"@ant-design/pro-components": "^2.6.49",
"@umijs/max": "^4.1.1",
"@zhst/func": "^0.8.1",
"@zhst/request": "^0.12.1",
"@zhst/slave": "^0.7.1",
"antd": "^5.14.1",
"cross-env": "^7.0.3"
},

View File

@ -1,4 +1,4 @@
import doRequest from '@/utils/request';
import { reqConfig } from '@zhst/request';
import useFatherAction from './actions';
// 运行时配置
@ -17,14 +17,16 @@ export const useQiankunStateForSlave = useFatherAction;
const hostname = location.hostname;
console.log('APP_ENV', APP_ENV);
export const qiankun = {
apps: [
{
name: 'cabinet', // 盒子管理
entry:
APP_ENV === 'production'
? `//${hostname}:30068/cabinet/`
: '//localhost:30068/',
? `//${hostname}:30058/cabinet/`
: '//localhost:30088/',
props: {},
singular: false,
credentials: true,
@ -33,8 +35,8 @@ export const qiankun = {
name: 'video', // AI 智能分析仓
entry:
APP_ENV === 'production'
? `//${hostname}:30088/video/`
: '//localhost:30088/',
? `//${hostname}:30058/video/`
: '//localhost:30068/',
singular: false,
credentials: true,
},
@ -42,7 +44,7 @@ export const qiankun = {
name: 'algorithm', // AI 算法分析
entry:
APP_ENV === 'production'
? `//${hostname}:30078/algorithm/`
? `//${hostname}:30058/algorithm/`
: '//localhost:30078/',
singular: false,
credentials: true,
@ -51,7 +53,7 @@ export const qiankun = {
name: 'material', // 物料库
entry:
APP_ENV === 'production'
? `//${hostname}:30098/material/`
? `//${hostname}:30058/material/`
: '//localhost:30098/',
singular: false,
credentials: true,
@ -65,4 +67,8 @@ export const qiankun = {
},
};
export const request = doRequest;
// @ts-ignore
export const request = reqConfig({
baseURL: COMMON_URL,
showMsg: true,
});