|
|
@@ -33,6 +33,10 @@ import { empty } from "@/uni_modules/uv-ui-tools/libs/function/test";
|
|
|
import { useTransfer } from "@/hooks/useTransfer";
|
|
|
import mxConst from "@/common/mxConst";
|
|
|
import { useUserStore } from '@/store/userStore';
|
|
|
+import { useAuth } from '@/hooks/useAuth';
|
|
|
+import { EnumUserRole } from '@/common/enum';
|
|
|
+const { hasPermission } = useAuth();
|
|
|
+
|
|
|
const userStore = useUserStore();
|
|
|
const openVipPopup = inject(OPEN_VIP_POPUP);
|
|
|
const props = defineProps({
|
|
|
@@ -90,8 +94,8 @@ const handleLeafClick = async ({ node, deep }) => {
|
|
|
const handleVideoPlay = async (node) => {
|
|
|
// 尝试传递更多数据,不使用playVideo,启用usingCache
|
|
|
// playVideo(node.aliId, node.aliIdType, node.name)
|
|
|
- const isVip = await userStore.checkVip();
|
|
|
- if (isVip) {
|
|
|
+ const hasAuth = hasPermission([EnumUserRole.VIP, EnumUserRole.AGENT, EnumUserRole.TEACHER]);
|
|
|
+ if (hasAuth) {
|
|
|
const nodeWithKnowledge = list.value.find(n => n.children?.includes(node))
|
|
|
transferTo(mxConst.routes.videoPlay, {
|
|
|
aliId: node.aliId,
|
|
|
@@ -99,8 +103,6 @@ const handleVideoPlay = async (node) => {
|
|
|
title: node.name,
|
|
|
node: nodeWithKnowledge
|
|
|
}, null, true)
|
|
|
- } else {
|
|
|
- openVipPopup();
|
|
|
}
|
|
|
|
|
|
}
|