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()