Browse Source

[Fix][UI Next][V1.0.0-Alpha] Fix refresh resource manage auto logout bug (#8932)

3.0.0/version-upgrade
Devosend 3 years ago committed by GitHub
parent
commit
f9efd68878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-ui-next/src/service/service.ts
  2. 2
      dolphinscheduler-ui-next/src/views/login/use-login.ts

4
dolphinscheduler-ui-next/src/service/service.ts

@ -70,12 +70,10 @@ const err = (err: AxiosError): Promise<AxiosError> => {
service.interceptors.request.use((config: AxiosRequestConfig<any>) => {
config.headers && (config.headers.sessionId = userStore.getSessionId)
const sIdCookie = cookies.get('sessionId')
const language = cookies.get('language')
config.headers = config.headers || {}
if (language) config.headers.language = language
if (sIdCookie) config.headers.sessionId = sIdCookie
return config
}, err)

2
dolphinscheduler-ui-next/src/views/login/use-login.ts

@ -23,7 +23,6 @@ import type { Router } from 'vue-router'
import type { SessionIdRes } from '@/service/modules/login/types'
import type { UserInfoRes } from '@/service/modules/users/types'
import { useMenuStore } from '@/store/menu/menu'
import cookies from 'js-cookie'
import { useTimezoneStore } from '@/store/timezone/timezone'
export function useLogin(state: any) {
@ -37,7 +36,6 @@ export function useLogin(state: any) {
if (!valid) {
const loginRes: SessionIdRes = await login({ ...state.loginForm })
await userStore.setSessionId(loginRes.sessionId)
cookies.set('sessionId', loginRes.sessionId, { path: '/' })
const userInfoRes: UserInfoRes = await getUserInfo()
await userStore.setUserInfo(userInfoRes)

Loading…
Cancel
Save