From 375d6b984cab6848ae66c8860fd2915d26f2507d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 4 Dec 2023 13:28:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=97=E9=99=90=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E5=BE=AA=E7=8E=AF=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/config/axios/service.ts | 3 +-- core/core-frontend/src/views/login/index.vue | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/config/axios/service.ts b/core/core-frontend/src/config/axios/service.ts index 7875bba7c3..97a2bbf65e 100644 --- a/core/core-frontend/src/config/axios/service.ts +++ b/core/core-frontend/src/config/axios/service.ts @@ -144,8 +144,7 @@ service.interceptors.response.use( showClose: true }) if (response.data.code === 80001) { - // localStorage.clear() - localStorage.setItem('DE-GATEWAY-FLAG', response.data.msg) + localStorage.clear() let queryRedirectPath = '/workbranch/index' if (router.currentRoute.value.fullPath) { queryRedirectPath = router.currentRoute.value.fullPath as string diff --git a/core/core-frontend/src/views/login/index.vue b/core/core-frontend/src/views/login/index.vue index e9d176490d..0f46e3f235 100644 --- a/core/core-frontend/src/views/login/index.vue +++ b/core/core-frontend/src/views/login/index.vue @@ -82,7 +82,7 @@ const formRef = ref() const duringLogin = ref(false) const handleLogin = () => { if (!formRef.value) return - formRef.value.validate((valid: boolean) => { + formRef.value.validate(async (valid: boolean) => { if (valid) { if (!checkUsername(state.loginForm.username) || !validatePwd(state.loginForm.password)) { ElMessage.error('用户名或密码错误') @@ -90,6 +90,10 @@ const handleLogin = () => { } const name = state.loginForm.username.trim() const pwd = state.loginForm.password + if (!wsCache.get(appStore.getDekey)) { + const res = await queryDekey() + wsCache.set(appStore.getDekey, res.data) + } const param = { name: rsaEncryp(name), pwd: rsaEncryp(pwd) } duringLogin.value = true cleanPlatformFlag()