fix(菜单): 切换无任何权限项目时重置顶部菜单

This commit is contained in:
baiqi 2024-07-23 13:47:19 +08:00 committed by 刘瑞斌
parent ee7b31d7e2
commit 5253ae532b
4 changed files with 9 additions and 12 deletions

View File

@ -1,12 +1,12 @@
<template>
<a-menu
v-show="appStore.topMenus.length > 0"
v-show="appStore.getTopMenus.length > 0"
v-model:selected-keys="activeMenus"
class="bg-transparent"
mode="horizontal"
@menu-item-click="menuClickHandler"
>
<a-menu-item v-for="menu of appStore.topMenus" :key="(menu.name as string)" @click="jumpPath(menu.name)">
<a-menu-item v-for="menu of appStore.getTopMenus" :key="(menu.name as string)" @click="jumpPath(menu.name)">
{{ t(menu.meta?.locale || '') }}
</a-menu-item>
</a-menu>
@ -99,7 +99,6 @@
appStore.setTopMenus(filterMenuTopRouter);
setCurrentTopMenu(name as string);
return;
}
}

View File

@ -253,12 +253,7 @@
projectId: value as string,
userId: userStore.id || '',
});
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
} finally {
await userStore.checkIsLogin(true);
appStore.hideLoading();
router.replace({
name: getFirstRouteNameByPermission(router.getRoutes()),
query: {
@ -266,6 +261,11 @@
pId: value as string,
},
});
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
} finally {
appStore.hideLoading();
}
}

View File

@ -44,7 +44,7 @@
prompt: 'consent',
},
async (loginResult) => {
const { redirectUrl, authCode, state } = loginResult;
const { authCode } = loginResult;
const dingCallback = getDingCallback(authCode);
userStore.qrCodeLogin(await dingCallback);
setLongType('DING_TALK');
@ -76,9 +76,8 @@
// 使code
},
(errorMsg) => {
Message.error(`errorMsg of errorCbk: ${errorMsg}`);
// ,使toast
console.error(`errorMsg of errorCbk: ${errorMsg}`);
Message.error(`errorMsg of errorCbk: ${errorMsg}`);
}
);
};

View File

@ -77,7 +77,6 @@
},
onLoginFail(err: WWLoginErrorResp) {
Message.error(`errorMsg of errorCbk: ${err.errMsg}`);
console.log(err);
},
});
};