feat(app.ts): 兼容80端口
This commit is contained in:
parent
91480031a8
commit
be7a154b03
15
src/app.ts
15
src/app.ts
@ -15,9 +15,10 @@ export async function getInitialState(): Promise<{
|
|||||||
// 给子应用暴露的方法
|
// 给子应用暴露的方法
|
||||||
export const useQiankunStateForSlave = useFatherAction;
|
export const useQiankunStateForSlave = useFatherAction;
|
||||||
|
|
||||||
const hostname = location.hostname;
|
/**
|
||||||
|
* 单端口模式 - 兼容 80 端口
|
||||||
console.log('APP_ENV', APP_ENV);
|
*/
|
||||||
|
const hostname = location.port ? `${location.hostname}:${location.port}` : location.hostname
|
||||||
|
|
||||||
export const qiankun = {
|
export const qiankun = {
|
||||||
apps: [
|
apps: [
|
||||||
@ -25,7 +26,7 @@ export const qiankun = {
|
|||||||
name: 'cabinet', // 盒子管理
|
name: 'cabinet', // 盒子管理
|
||||||
entry:
|
entry:
|
||||||
APP_ENV === 'production'
|
APP_ENV === 'production'
|
||||||
? `//${hostname}:30058/cabinet/`
|
? `//${hostname}/cabinet/`
|
||||||
: '//localhost:30088/',
|
: '//localhost:30088/',
|
||||||
props: {},
|
props: {},
|
||||||
singular: false,
|
singular: false,
|
||||||
@ -35,7 +36,7 @@ export const qiankun = {
|
|||||||
name: 'video', // AI 智能分析仓
|
name: 'video', // AI 智能分析仓
|
||||||
entry:
|
entry:
|
||||||
APP_ENV === 'production'
|
APP_ENV === 'production'
|
||||||
? `//${hostname}:30058/video/`
|
? `//${hostname}/video/`
|
||||||
: '//localhost:30068/',
|
: '//localhost:30068/',
|
||||||
singular: false,
|
singular: false,
|
||||||
credentials: true,
|
credentials: true,
|
||||||
@ -44,7 +45,7 @@ export const qiankun = {
|
|||||||
name: 'algorithm', // AI 算法分析
|
name: 'algorithm', // AI 算法分析
|
||||||
entry:
|
entry:
|
||||||
APP_ENV === 'production'
|
APP_ENV === 'production'
|
||||||
? `//${hostname}:30058/algorithm/`
|
? `//${hostname}/algorithm/`
|
||||||
: '//localhost:30078/',
|
: '//localhost:30078/',
|
||||||
singular: false,
|
singular: false,
|
||||||
credentials: true,
|
credentials: true,
|
||||||
@ -53,7 +54,7 @@ export const qiankun = {
|
|||||||
name: 'material', // 物料库
|
name: 'material', // 物料库
|
||||||
entry:
|
entry:
|
||||||
APP_ENV === 'production'
|
APP_ENV === 'production'
|
||||||
? `//${hostname}:30058/material/`
|
? `//${hostname}/material/`
|
||||||
: '//localhost:30098/',
|
: '//localhost:30098/',
|
||||||
singular: false,
|
singular: false,
|
||||||
credentials: true,
|
credentials: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user