Selaa lähdekoodia

没有权限页面

canghailong 2 kuukautta sitten
vanhempi
sitoutus
c9fbc05b9d

+ 20 - 0
src/layout/other/noPermissions.vue

@@ -0,0 +1,20 @@
+<template>
+	<a-result status="error" title="没有访问权限。" sub-title="如有疑问请联系管理员">
+		<template #extra>
+			<a-button type="primary" @click="gohome">返回首页</a-button>
+		</template>
+	</a-result>
+</template>
+
+<script>
+	export default {
+		methods: {
+			gohome() {
+				location.href = '/'
+			},
+			goback() {
+				this.$router.go(-1)
+			}
+		}
+	}
+</script>

+ 5 - 0
src/router/index.js

@@ -25,6 +25,11 @@ const routes_404 = [
 		path: '/:pathMatch(.*)*',
 		hidden: true,
 		component: () => import('@/layout/other/404.vue')
+	},
+	{
+		path: '/noPermissions',
+		hidden: true,
+		component: () => import('@/layout/other/noPermissions.vue')
 	}
 ]
 // 系统路由

+ 2 - 1
src/views/resourceDetails/components/VideoDetails.vue

@@ -258,7 +258,7 @@ const unknownFile = computed((e) => {
 	}
 })
 const getData = (item) => {
-	resourcecentreDetail({id: item.id})
+	detail({id: item.id})
 		.then((res) => {
 			if (res.code == 200) {
 				itemData.value = res.data
@@ -319,6 +319,7 @@ const upDataList = (item) => {
 			}
 		})
 		.catch((err) => {
+			this.$router.push({ path:'/noPermissions' })
 		})
 }