From 0c519f7e5d3f6473564e2eb23fe3615670985de6 Mon Sep 17 00:00:00 2001 From: hushuang Date: Fri, 28 Oct 2022 11:52:22 +0800 Subject: [PATCH] [Fix][UI] download resource return 401 (#12566) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resource download with form action, without header: sessionId: xxxx, set sessionId after login,support download resource success --- dolphinscheduler-ui/src/views/login/use-login.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dolphinscheduler-ui/src/views/login/use-login.ts b/dolphinscheduler-ui/src/views/login/use-login.ts index 51f387e691..6f62bd7486 100644 --- a/dolphinscheduler-ui/src/views/login/use-login.ts +++ b/dolphinscheduler-ui/src/views/login/use-login.ts @@ -24,6 +24,7 @@ import type { LoginRes } from '@/service/modules/login/types' import type { UserInfoRes } from '@/service/modules/users/types' import { useRouteStore } from '@/store/route/route' import { useTimezoneStore } from '@/store/timezone/timezone' +import cookies from 'js-cookie' export function useLogin(state: any) { const router: Router = useRouter() @@ -37,6 +38,7 @@ export function useLogin(state: any) { const loginRes: LoginRes = await login({ ...state.loginForm }) await userStore.setSessionId(loginRes.sessionId) await userStore.setSecurityConfigType(loginRes.securityConfigType) + cookies.set('sessionId', loginRes.sessionId, { path: '/' }) const userInfoRes: UserInfoRes = await getUserInfo() await userStore.setUserInfo(userInfoRes)