Kaynağa Gözat

iframe权限与判断area

11wqe1 2 gün önce
ebeveyn
işleme
5860c39d35

+ 4 - 1
src/App.vue

@@ -412,7 +412,10 @@ const getUrlParam = (urlStr, urlKey) => {
   <div v-loading="isShow" style="height: 100vh;">
     <router-view></router-view>
   </div>
-  <iframe :src="courseUrl" allow="camera *; microphone *;display-capture;midi;encrypted-media;clipboard-write;clipboard-read" :webkitallowfullscreen="true" :mozallowfullscreen="true" :allowfullscreen="true"  class="courseIframe" v-if="courseUrl"></iframe>
+  <iframe :src="courseUrl" 
+  allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
+  :webkitallowfullscreen="true" :mozallowfullscreen="true" :allowfullscreen="true"  class="courseIframe" 
+  v-if="courseUrl"></iframe>
   <!-- </keep-alive> -->
 </template>
 

+ 19 - 1
src/components/dialog/addClassDialog.vue

@@ -82,6 +82,20 @@
       default: () => {}
     }
   });
+  const areaJson = ref([
+          { name: '罗湖区', code: '440303' },
+          { name: '福田区', code: '440304' },
+          { name: '南山区', code: '440305' },
+          { name: '宝安区', code: '440306' },
+          { name: '龙岗区', code: '440307' },
+          { name: '盐田区', code: '440308' },
+          { name: '龙华区', code: '440309' },
+          { name: '坪山区', code: '440310' },
+          { name: '光明区', code: '440311' },
+          { name: '大鹏新区', code: '4403A4' },
+          { name: '深汕特别合作区', code: '441521' },
+          { name: '深汕特别合作区', code: '4403A5' }
+        ]);
   const open = (data) => {
     console.log('data',data);
         show.value = true;
@@ -237,6 +251,10 @@
 
       let courseGrade = classData.courseGrade ? await axios.get("https://pbl.cocorobo.cn/api/pbl/getClassById?id="+classData.courseGrade) : '';
       let coursePackageName = await axios.get("https://pbl.cocorobo.cn/api/pbl/getCopyCourseName?id="+classData.courseId);
+
+      let area = areaJson.value.find(item => userInfo.user.schooldest.includes(item.code) || userInfo.user.schooldest.includes(item.name));
+      let dest = area ? area.name : '未知';
+      
       let params = {
         "serverName": "深教AI6",
         "dataType": 0,
@@ -245,7 +263,7 @@
         "teacherPhone": userInfo.user.phonenumber,
         "eduId": userInfo.user.eduid || userInfo.user.sessionid,
         "schoolName": userInfo.user.schoolName,
-        "area": userInfo.user.schooldest,
+        "area": dest,
         "coursePackageName": coursePackageName2 ? coursePackageName2 : coursePackageName.data[0][0].title,
         "courseId": classData.courseId,
         "courseName": courseName || classData.title,

+ 1 - 1
src/components/main/feedback.vue

@@ -68,7 +68,7 @@
         </template>
         <div style="height: calc(100% - 32px);">
             <iframe width="100%" height="100%"
-                allow="camera *; microphone *;display-capture;midi;encrypted-media;"
+                allow='allow="camera *; microphone *;display-capture;midi;encrypted-media;clipboard-write;clipboard-read" :webkitallowfullscreen="true" :mozallowfullscreen="true" :allowfullscreen="true"'
                 :src="aiChatUrl" frameborder="0"
                 scrolling="no"></iframe>
         </div>

+ 1 - 0
src/components/main/opendetail.vue

@@ -99,6 +99,7 @@
 								</div>
 								<div style="flex: 1" v-if="inst.file && inst.file.length">
 									<iframe
+					                    allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
 										:src="pdfUrl"
 										width="100%"
 										height="100%"

+ 2 - 1
src/views/iframeRoute.vue

@@ -12,7 +12,8 @@
         </template>
         <div class="iframDiv">
             <iframe :src="iframeSrc" frameborder="0"
-            allow="camera *; fullscreen *;fullscreen 'src'; microphone *"></iframe>
+            allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
+            ></iframe>
         </div>
     </el-page-header>
 </template>

+ 3 - 1
src/views/login.vue

@@ -1,7 +1,9 @@
 <template>
     <div class="login">
         <!-- iframe 全屏显示 -->
-        <iframe src="//edu.cocorobo.cn/ResourcesLogin" frameborder="0"></iframe>
+        <iframe src="//edu.cocorobo.cn/ResourcesLogin" frameborder="0"
+        allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
+        ></iframe>
     </div>
 </template>
 <script setup>

+ 6 - 2
src/views/main.vue

@@ -81,10 +81,14 @@
         <!-- <Edu v-if="isLogin"></Edu> -->
       </div>
       <div class="iframe" :style="leftShow ? { width: '100%' } : ''" v-else-if="activeIndex == 1" v-loading="loading">
-        <iframe ref="iframeRef1" :src="iframeRef1Url" frameborder="0"></iframe>
+        <iframe ref="iframeRef1" :src="iframeRef1Url" 
+        allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
+        frameborder="0"></iframe>
       </div>
       <div class="iframe" :style="leftShow ? { width: '100%' } : ''" v-else-if="activeIndex == 2" v-loading="loading">
-        <iframe ref="iframeRef2" :src="iframeRef2Url" frameborder="0"></iframe>
+        <iframe ref="iframeRef2" :src="iframeRef2Url" 
+        allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
+        frameborder="0"></iframe>
         <el-dialog v-model="iframeRef2Dialog" width="450" @close="clickSwitch(1)">
           <template #header="{ }">
             <div class="my-header">