add: 增加超级会员页面,修复未绑定美团的检查登录报错而未成功跳转首页问题
This commit is contained in:
@@ -33,6 +33,23 @@ export const usePermissionStore = defineStore("permission", () => {
|
||||
.then((data) => {
|
||||
if (!isTest) {
|
||||
const dynamicRoutes = parseDynamicRoutes(data.filter(v => v.type == 0));
|
||||
console.log('dynamicRoutes')
|
||||
console.log(dynamicRoutes)
|
||||
dynamicRoutes.forEach((route) => {
|
||||
//过滤出可见子节点
|
||||
let onlyOneChild = null
|
||||
const showingChildren = route.children.filter((route) => {
|
||||
if (!route.meta?.hidden) {
|
||||
onlyOneChild = route;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
// 仅有一个节点
|
||||
if (showingChildren.length === 1 && onlyOneChild) {
|
||||
route.redirect = onlyOneChild.path;
|
||||
}
|
||||
})
|
||||
routes.value = [...constantRoutes, ...dynamicRoutes];
|
||||
isRoutesLoaded.value = true;
|
||||
resolve(dynamicRoutes);
|
||||
|
||||
Reference in New Issue
Block a user