mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 08:06:43 +08:00
fix 普通用户订阅权限
This commit is contained in:
@@ -91,7 +91,6 @@ const superUser = store.state.auth.superUser
|
|||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
<VerticalNavLink
|
<VerticalNavLink
|
||||||
v-if="superUser"
|
|
||||||
:item="{
|
:item="{
|
||||||
title: '电影',
|
title: '电影',
|
||||||
icon: 'mdi-movie-check-outline',
|
icon: 'mdi-movie-check-outline',
|
||||||
@@ -99,7 +98,6 @@ const superUser = store.state.auth.superUser
|
|||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
<VerticalNavLink
|
<VerticalNavLink
|
||||||
v-if="superUser"
|
|
||||||
:item="{
|
:item="{
|
||||||
title: '电视剧',
|
title: '电视剧',
|
||||||
icon: 'mdi-television-classic',
|
icon: 'mdi-television-classic',
|
||||||
|
|||||||
@@ -129,12 +129,14 @@ onMounted(() => {
|
|||||||
<span v-if="dataList.length > 0" class="fixed right-5 bottom-5">
|
<span v-if="dataList.length > 0" class="fixed right-5 bottom-5">
|
||||||
<VBtn
|
<VBtn
|
||||||
v-if="viewType === 'list'"
|
v-if="viewType === 'list'"
|
||||||
|
size="x-large"
|
||||||
icon="mdi-view-grid"
|
icon="mdi-view-grid"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="setViewType('card')"
|
@click="setViewType('card')"
|
||||||
/>
|
/>
|
||||||
<VBtn
|
<VBtn
|
||||||
v-else
|
v-else
|
||||||
|
size="x-large"
|
||||||
icon="mdi-view-list"
|
icon="mdi-view-list"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="setViewType('list')"
|
@click="setViewType('list')"
|
||||||
|
|||||||
@@ -4,12 +4,17 @@ import api from '@/api'
|
|||||||
import type { Subscribe } from '@/api/types'
|
import type { Subscribe } from '@/api/types'
|
||||||
import NoDataFound from '@/components/NoDataFound.vue'
|
import NoDataFound from '@/components/NoDataFound.vue'
|
||||||
import SubscribeCard from '@/components/cards/SubscribeCard.vue'
|
import SubscribeCard from '@/components/cards/SubscribeCard.vue'
|
||||||
|
import store from '@/store'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 从Vuex Store中获取用户信息
|
||||||
|
const superUser = store.state.auth.superUser
|
||||||
|
const userName = store.state.auth.userName
|
||||||
|
|
||||||
// 是否刷新过
|
// 是否刷新过
|
||||||
const isRefreshed = ref(false)
|
const isRefreshed = ref(false)
|
||||||
|
|
||||||
@@ -40,9 +45,12 @@ function onRefresh() {
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 过滤数据
|
// 过滤数据,管理员用户显示全部,非管理员只显示自己的订阅
|
||||||
const filteredDataList = computed(() => {
|
const filteredDataList = computed(() => {
|
||||||
return dataList.value.filter(data => data.type === props.type)
|
if (superUser)
|
||||||
|
return dataList.value.filter(data => data.type === props.type)
|
||||||
|
else
|
||||||
|
return dataList.value.filter(data => data.type === props.type && data.username === userName)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user