This commit is contained in:
@@ -41,7 +41,13 @@
|
||||
import type { DetailSection } from '@/components/common/DetailPage.vue'
|
||||
import { ExportTaskService } from '@/api/modules'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { getExportTaskSceneConfig, getExportTaskSceneName } from '@/config/constants'
|
||||
import {
|
||||
getExportTaskSceneConfig,
|
||||
getExportTaskSceneName,
|
||||
isPollingPlatformExport
|
||||
} from '@/config/constants'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { isPollingPlatform } from '@/utils/business/pollingScheduler'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import type { ExportTaskDetail } from '@/types/api'
|
||||
import { ExportTaskStatus } from '@/types/api'
|
||||
@@ -52,6 +58,7 @@
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const { hasAuth } = useAuth()
|
||||
const user = useUserStore()
|
||||
const polling = useAsyncTaskPolling<ExportTaskDetail>({
|
||||
storageKey: `export-task-detail:${String(route.query.id || '')}`,
|
||||
autoRestore: false,
|
||||
@@ -63,6 +70,8 @@
|
||||
throw error
|
||||
}
|
||||
if (res.code !== 0 || !res.data) throw new Error(res.msg || '获取导出任务详情失败')
|
||||
if (isPollingPlatformExport(res.data.scene) && !isPollingPlatform(user.info.user_type))
|
||||
throw Object.assign(new Error('仅平台账号可查看该导出任务'), { status: 403 })
|
||||
return res.data
|
||||
},
|
||||
isForbidden: (error: any) => error?.status === 403 || error?.response?.status === 403
|
||||
@@ -73,7 +82,10 @@
|
||||
() => getExportTaskSceneConfig(taskDetail.value?.scene)?.permissions
|
||||
)
|
||||
const canViewDetail = computed(
|
||||
() => !!taskPermissions.value && hasAuth(taskPermissions.value.detail)
|
||||
() =>
|
||||
!!taskPermissions.value &&
|
||||
hasAuth(taskPermissions.value.detail) &&
|
||||
(!isPollingPlatformExport(taskDetail.value?.scene) || isPollingPlatform(user.info.user_type))
|
||||
)
|
||||
const canDownloadTask = computed(
|
||||
() =>
|
||||
|
||||
Reference in New Issue
Block a user