fix: redirect default path after login
This commit is contained in:
+13
-10
@@ -7,30 +7,33 @@ import icons from './icons';
|
||||
function formatIcon(name: string) {
|
||||
return name
|
||||
.replace(name[0], name[0].toUpperCase())
|
||||
.replace(/-(w)/g, function(all, letter) {
|
||||
.replace(/-(w)/g, function (all, letter) {
|
||||
return letter.toUpperCase();
|
||||
});
|
||||
}
|
||||
|
||||
export function patchRoutes({ routes }) {
|
||||
console.log('patchRoutes====',routes)
|
||||
Object.keys(routes).forEach(key => {
|
||||
export function patchRoutes({ routes, initialState }) {
|
||||
console.log('patchRoutes99999', routes);
|
||||
Object.keys(routes).forEach((key) => {
|
||||
const { icon } = routes[key];
|
||||
if (icon && typeof icon === 'string') {
|
||||
const upperIcon = formatIcon(icon);
|
||||
if (icons[upperIcon] || icons[upperIcon + 'Outlined']) {
|
||||
routes[key].icon = React.createElement(icons[upperIcon] || icons[upperIcon + 'Outlined']);
|
||||
routes[key].icon = React.createElement(
|
||||
icons[upperIcon] || icons[upperIcon + 'Outlined']
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function renderMenuIcon (icon: string){
|
||||
|
||||
export function renderMenuIcon(icon: string) {
|
||||
const upperIcon = formatIcon(icon);
|
||||
console.log('upperIcon',upperIcon)
|
||||
console.log('upperIcon', upperIcon);
|
||||
if (icons[upperIcon] || icons[upperIcon + 'Outlined']) {
|
||||
return React.createElement(icons[upperIcon] || icons[upperIcon + 'Outlined']);
|
||||
return React.createElement(
|
||||
icons[upperIcon] || icons[upperIcon + 'Outlined']
|
||||
);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user