diff --git a/src/api/types.ts b/src/api/types.ts index f9dbfca0..93288d74 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -478,6 +478,9 @@ export interface DownloadingInfo { // 媒体信息 media: { [key: string]: any } + + // 下载用户 + userid?: string } // 缺失剧集信息 diff --git a/src/views/reorganize/DownloadingListView.vue b/src/views/reorganize/DownloadingListView.vue index 9627d009..71b9d0da 100644 --- a/src/views/reorganize/DownloadingListView.vue +++ b/src/views/reorganize/DownloadingListView.vue @@ -4,6 +4,11 @@ import api from '@/api' import type { DownloadingInfo } from '@/api/types' import NoDataFound from '@/components/NoDataFound.vue' import DownloadingCard from '@/components/cards/DownloadingCard.vue' +import store from '@/store' + +// 从Vuex Store中获取用户信息 +const superUser = store.state.auth.superUser +const userName = store.state.auth.userName // 定时器 let refreshTimer: NodeJS.Timer | null = null @@ -35,6 +40,14 @@ function onRefresh() { loading.value = false } +// 过滤数据,管理员用户显示全部,非管理员只显示自己的订阅 +const filteredDataList = computed(() => { + if (superUser) + return dataList.value + else + return dataList.value.filter(data => data.userid === userName) +}) + // 加载时获取数据 onBeforeMount(() => { fetchData() @@ -71,17 +84,17 @@ onUnmounted(() => { @refresh="onRefresh" >