This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
} from '@/config/constants'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { isPollingPlatform } from '@/utils/business/pollingScheduler'
|
||||
import { canAccessExportTaskScene } from '@/config/constants/exportTask'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import type { ExportTaskDetail } from '@/types/api'
|
||||
import { ExportTaskStatus } from '@/types/api'
|
||||
@@ -70,6 +71,8 @@
|
||||
throw error
|
||||
}
|
||||
if (res.code !== 0 || !res.data) throw new Error(res.msg || '获取导出任务详情失败')
|
||||
if (!canAccessExportTaskScene(res.data.scene, user.info.user_type))
|
||||
throw Object.assign(new Error('当前账号无权访问该类订单导出'), { status: 403 })
|
||||
if (isPollingPlatformExport(res.data.scene) && !isPollingPlatform(user.info.user_type))
|
||||
throw Object.assign(new Error('仅平台账号可查看该导出任务'), { status: 403 })
|
||||
return res.data
|
||||
@@ -84,6 +87,7 @@
|
||||
const canViewDetail = computed(
|
||||
() =>
|
||||
!!taskPermissions.value &&
|
||||
canAccessExportTaskScene(taskDetail.value?.scene, user.info.user_type) &&
|
||||
hasAuth(taskPermissions.value.detail) &&
|
||||
(!isPollingPlatformExport(taskDetail.value?.scene) || isPollingPlatform(user.info.user_type))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user