refactor:优化前端国际化

This commit is contained in:
PZ688 2025-02-27 23:38:51 +08:00
parent 1f5afdf50b
commit 50d81753b6
2 changed files with 17 additions and 2 deletions

View File

@ -116,7 +116,22 @@ export async function getBackEndControlRoutes() {
// window.location.reload();
// }, 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);
}
});
}
}
/**

View File

@ -115,7 +115,7 @@ export const staticRoutes: Array<RouteRecordRaw> = [
name: 'login',
component: () => import('/@/views/login/index.vue'),
meta: {
title: '登录',
title: 'Login',
isPublic: true,
},
},