fix: 轮询按运营商账户限流
All checks were successful
构建并部署前端到测试环境 / deploy (push) Successful in 55s

This commit is contained in:
luo
2026-10-26 14:31:15 +08:00
parent 049f8257fb
commit 06684e1fc0
88 changed files with 7919 additions and 486 deletions

View File

@@ -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(
() =>