From f2177a9e8e8ec3551173936c3a049835942a669e Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Tue, 25 Jun 2024 15:34:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86ID=E9=94=99=E8=AF=AF=20feat:=20=E5=BA=95=E9=83=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=AC=E5=8F=B8=E5=90=8D=E5=AD=97=E5=92=8C?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Auth.js | 3 ++- src/views/App.jsx | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/stores/Auth.js b/src/stores/Auth.js index e7fc4bb..55ab140 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -60,7 +60,7 @@ const useAuthStore = create((set, get) => ({ // return true // 以上是 Hardcode 判断 // 以下是权限列表从数据库读取后使用的方法 - return permissionList.some((value, key, arry) => { + return permissionList.some((value) => { if (value.indexOf(WILDCARD_TOKEN) > -1) { return true } @@ -76,6 +76,7 @@ const useAuthStore = create((set, get) => ({ const { setStorage } = usingStorage() const { token: loginToken, WU_ID: userId } = await fetchLoginToken(usr, pwd) + const userDetail = await fetchUserDetail(loginToken) await loadUserPermission(userId) set(() => ({ diff --git a/src/views/App.jsx b/src/views/App.jsx index 1882319..22d0737 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -43,7 +43,6 @@ function App() { const needToLogin = href !== '/login' && isEmpty(loginToken) useEffect(() => { - console.info('app.useEffect.loginToken: ' + loginToken) fetchUserDetail(loginToken) .then(u => { setUserDetail({ @@ -163,9 +162,7 @@ function App() { isPermitted(PERM_ROLE_NEW) ? { label: {t('account:management.roleList')}, key: '4' } : null, { type: 'divider' }, { label: {t('Logout')}, key: '99' }, - ], - { type: 'divider' }, - { label: <>v{BUILD_VERSION}, key: 'BUILD_VERSION' }, + ] ], }} trigger={['click']} @@ -192,7 +189,7 @@ function App() { }}> {needToLogin ? <>login... : } -
+