fix: 登录不加载菜单

This commit is contained in:
cp3hnu 2024-07-25 10:38:48 +08:00
parent 1cc80986ed
commit fd3d848520
4 changed files with 7 additions and 6 deletions

View File

@ -20,16 +20,16 @@ export default {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
'/api/': {
// 要代理的地址
// target: 'http://172.20.32.181:31205',
target: 'http://172.20.32.98:8082',
target: 'http://172.20.32.181:31213', // 开发环境
// target: 'http://172.20.32.98:8082',
// target: 'http://172.20.32.150:8082',
// 配置了这个可以从 http 代理到 https
// 依赖 origin 的功能可能需要这个,比如 cookie
changeOrigin: true,
pathRewrite: { '^/api': '' },
// pathRewrite: { '^/api': '' },
},
'/profile/avatar/': {
target: 'http://172.20.32.181:31205',
target: 'http://172.20.32.181:31213',
changeOrigin: true,
},
},

View File

@ -193,6 +193,7 @@ export function render(oldRender: () => void) {
oldRender();
})
.catch(() => {
setRemoteMenu([]);
oldRender();
});
}

View File

@ -49,7 +49,7 @@
position: fixed;
right: 30px;
bottom: 20px;
z-index: 999;
z-index: 99;
width: 64px;
height: 64px;
background-color: white;

View File

@ -2,7 +2,7 @@ import { MenuDataItem } from '@ant-design/pro-components';
import { request } from '@umijs/max';
import React, { lazy } from 'react';
let remoteMenu: any = [];
let remoteMenu: any = null;
export function getRemoteMenu() {
return remoteMenu;