From c60f7ffc8d7394c8fd13026606fa0b8043654e48 Mon Sep 17 00:00:00 2001 From: RubyLiu Date: Thu, 7 Sep 2023 11:39:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=99=BB=E5=BD=95=E7=9B=90=E6=94=BEloc?= =?UTF-8?q?al=E9=87=8C&=E8=A1=A8=E6=A0=BC=E8=A1=8Chover=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 2 +- .../components/pure/ms-table/base-table.vue | 23 +++++++++++++++---- frontend/src/hooks/useUser.ts | 2 +- frontend/src/store/modules/user/index.ts | 5 ---- frontend/src/store/modules/user/types.ts | 2 -- .../src/views/login/components/login-form.vue | 2 +- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index f56f012a54..32767fd625 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -9,7 +9,7 @@ diff --git a/frontend/src/hooks/useUser.ts b/frontend/src/hooks/useUser.ts index 6e22ee7fff..ae3a71b382 100644 --- a/frontend/src/hooks/useUser.ts +++ b/frontend/src/hooks/useUser.ts @@ -22,7 +22,7 @@ export default function useUser() { }; const setSalt = (salt: string) => { - userStore.setSalt(salt); + localStorage.setItem('salt', salt); }; const isLoginPage = () => { diff --git a/frontend/src/store/modules/user/index.ts b/frontend/src/store/modules/user/index.ts index 3ccf0a3b77..c5c710569e 100644 --- a/frontend/src/store/modules/user/index.ts +++ b/frontend/src/store/modules/user/index.ts @@ -29,7 +29,6 @@ const useUserStore = defineStore('user', { id: undefined, certification: undefined, role: '', - salt: '', }), getters: { @@ -105,10 +104,6 @@ const useUserStore = defineStore('user', { return false; } }, - // 加盐 - setSalt(salt: string) { - this.$patch({ salt }); - }, }, }); diff --git a/frontend/src/store/modules/user/types.ts b/frontend/src/store/modules/user/types.ts index 2950af97fc..bac6ec8df3 100644 --- a/frontend/src/store/modules/user/types.ts +++ b/frontend/src/store/modules/user/types.ts @@ -18,6 +18,4 @@ export interface UserState { role: RoleType; lastOrganizationId?: string; lastProjectId?: string; - // 盐 - salt: string; } diff --git a/frontend/src/views/login/components/login-form.vue b/frontend/src/views/login/components/login-form.vue index 8ba3cf0640..dba94b07c8 100644 --- a/frontend/src/views/login/components/login-form.vue +++ b/frontend/src/views/login/components/login-form.vue @@ -117,7 +117,7 @@ if (!errors) { setLoading(true); try { - const publicKey = userStore.salt; + const publicKey = localStorage.getItem('salt') || ''; await userStore.login({ username: encrypted(values.username, publicKey), password: encrypted(values.password, publicKey),