This is an automated email from the ASF dual-hosted git repository. zhongjiajie pushed a commit to branch 3.0.3-prepare in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
commit 78ad0d0cd158f521bc548d1a717828d0985595d6 Author: hushuang <[email protected]> AuthorDate: Fri Oct 28 11:52:22 2022 +0800 [Fix][UI] download resource return 401 (#12566) resource download with form action, without header: sessionId: xxxx, set sessionId after login,support download resource success (cherry picked from commit 0c519f7e5d3f6473564e2eb23fe3615670985de6) --- 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 6fd2080e55..acd450f946 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 { SessionIdRes } 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() @@ -36,6 +37,7 @@ 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)
