refactor:优化前端国际化
This commit is contained in:
parent
1f5afdf50b
commit
50d81753b6
@ -116,7 +116,22 @@ export async function getBackEndControlRoutes() {
|
|||||||
// window.location.reload();
|
// window.location.reload();
|
||||||
// }, 3000);
|
// }, 3000);
|
||||||
// }
|
// }
|
||||||
return res.data.result;
|
let resData = res.data.result;
|
||||||
|
recursive(resData);
|
||||||
|
|
||||||
|
|
||||||
|
return resData;
|
||||||
|
}
|
||||||
|
|
||||||
|
function recursive(resData: any) {
|
||||||
|
if (resData && resData.length > 0) {
|
||||||
|
resData.forEach((item: any) => {
|
||||||
|
item.meta.title = item.i18nName;
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
recursive(item.children);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -115,7 +115,7 @@ export const staticRoutes: Array<RouteRecordRaw> = [
|
|||||||
name: 'login',
|
name: 'login',
|
||||||
component: () => import('/@/views/login/index.vue'),
|
component: () => import('/@/views/login/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '登录',
|
title: 'Login',
|
||||||
isPublic: true,
|
isPublic: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user