Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions dolphinscheduler-ui-next/src/layouts/content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,20 @@ const Content = defineComponent({
watch(
() => route.path,
() => {
state.isShowSide = menuStore.getShowSideStatus
route.matched[1].path.includes(':projectCode')
if (route.matched[1].path === '/projects/:projectCode') {
changeMenuOption(state)
getSideMenu(state)
if (route.path !== '/login') {
state.isShowSide = menuStore.getShowSideStatus
route.matched[1].path.includes(':projectCode')
if (route.matched[1].path === '/projects/:projectCode') {
changeMenuOption(state)
getSideMenu(state)
}
sideKeyRef.value = route.matched[1].path.includes(':projectCode')
? route.matched[1].path.replace(
':projectCode',
menuStore.getProjectCode
)
: route.matched[1].path
}
sideKeyRef.value = route.matched[1].path.includes(':projectCode')
? route.matched[1].path.replace(
':projectCode',
menuStore.getProjectCode
)
: route.matched[1].path
},
{ immediate: true }
)
Expand Down
11 changes: 8 additions & 3 deletions dolphinscheduler-ui-next/src/service/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
*/

import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios'
import { useUserStore } from '@/store/user/user'
import qs from 'qs'
import _ from 'lodash'
import { useUserStore } from '@/store/user/user'
import router from '@/router'

const userStore = useUserStore()

Expand All @@ -43,12 +44,16 @@ const baseRequestConfig: AxiosRequestConfig = {
const service = axios.create(baseRequestConfig)

const err = (err: AxiosError): Promise<AxiosError> => {
if (err.response?.status === 401 || err.response?.status === 504) {
userStore.setSessionId('')
userStore.setUserInfo({})
router.push({ path: '/login' })
}

return Promise.reject(err)
}

service.interceptors.request.use((config: AxiosRequestConfig<any>) => {
// console.log('config', config)

config.headers && (config.headers.sessionId = userStore.getSessionId)

return config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ export function useTable() {
row.upstreamTaskMap.length < 1
? '-'
: h(NSpace, null, {
default: () => row.upstreamTaskMap.map((item: string) => {
return h(
NTag,
{ type: 'info', size: 'small' },
{ default: () => item }
)
default: () =>
row.upstreamTaskMap.map((item: string) => {
return h(
NTag,
{ type: 'info', size: 'small' },
{ default: () => item }
)
})
})
})
)
},
{
Expand Down