diff --git a/.gitignore b/.gitignore index 82cadd2..c352f48 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ _roadhog-api-doc # production /dist +/qingdao # misc .DS_Store @@ -40,4 +41,4 @@ screenshot build -pnpm-lock.yaml \ No newline at end of file +pnpm-lock.yaml diff --git a/config/config.ts b/config/config.ts index eeed263..7c27b33 100644 --- a/config/config.ts +++ b/config/config.ts @@ -125,7 +125,7 @@ export default defineConfig({ */ headScripts: [ // 解决首次加载时白屏的问题 - { src: '/scripts/loading.js', async: true }, + { src: '/qingdao/scripts/loading.js', async: true }, ], //================ pro 插件配置 ================= presets: ['umi-presets-pro'], @@ -151,6 +151,9 @@ export default defineConfig({ mfsu: { strategy: 'normal', }, + outputPath: 'qingdao', + base: '/qingdao/', + publicPath: '/qingdao/', esbuildMinifyIIFE: true, requestRecord: {}, }); diff --git a/config/routes.ts b/config/routes.ts index dae11c1..934eb70 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -52,7 +52,7 @@ export default [ routes: [ { name: '字典数据', - path: '/area/updata-router/index/:id', + path: '/area/updata-router/index', component: './Area/Subway/UpLine', }, ] diff --git a/src/app.tsx b/src/app.tsx index 46d38ff..9e5d8aa 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -12,11 +12,10 @@ import { PageEnum } from './enums/pagesEnums'; import {logout} from "@/services/system/auth"; import { stringify } from 'querystring'; import { message } from 'antd' +import { createRef } from 'react'; const isDev = process.env.NODE_ENV === 'development'; - const loginOut = async () => { - await logout(); clearSessionToken(); setRemoteMenu(null); const { search, pathname } = window.location; @@ -24,11 +23,12 @@ const loginOut = async () => { /** 此方法会跳转到 redirect 参数所在的位置 */ const redirect = urlParams.get('redirect'); // Note: There may be security issues, please note - if (window.location.pathname !== '/user/login' && !redirect) { + console.log('redirect', window.location.pathname, redirect) + if (window.location.pathname !== '/qingdao/user/login' && !redirect) { history.replace({ pathname: '/user/login', search: stringify({ - redirect: pathname + search, + redirect: pathname.replace('/qingdao', '') + search, }), }); } @@ -79,9 +79,9 @@ export async function getInitialState(): Promise<{ settings: defaultSettings as Partial, }; } - // ProLayout 支持的api https://procomponents.ant.design/components/layout export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) => { + return { // actionsRender: () => [, ], actionsRender: () => [ ], @@ -95,9 +95,10 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = waterMarkProps: { // content: initialState?.currentUser?.nickName, }, + // actionRef: layoutActionRef, menu: { locale: false, - // 每当 initialState?.currentUser?.userid 发生修改时重新执行 request + // // 每当 initialState?.currentUser?.userid 发生修改时重新执行 request params: { userId: initialState?.currentUser?.userId, }, @@ -105,7 +106,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = if (!initialState?.currentUser?.userId) { return []; } - return getRemoteMenu(); + return getRemoteMenu() }, }, footerRender: () =>