ZhaoJing преди 2 години
родител
ревизия
20f8ff781b

+ 0 - 1
index.html

@@ -11,6 +11,5 @@
 <div id="app"></div>
 <script src="/config.js"></script>
 <script type="module" src="/src/main.ts"></script>
-<script src="https://mapapi.qq.com/web/mapComponents/geoLocation/v/geolocation.min.js"></script>
 </body>
 </html>

+ 2 - 1
src/components/FilePreview/index.vue

@@ -37,7 +37,8 @@ function getFullUrl(url) {
 function getFileType(str) {
   if (str) {
     str = str += ''.toLocaleLowerCase()
-    const ext = str.split('.').at(-1)
+    const arr = str.split('.')
+    const ext = arr[arr.length - 1].toLowerCase()
     if (['pdf'].includes(ext)) {
       return 'pdf'
     } else if (['mp4'].includes(ext)) {

+ 7 - 3
src/components/FileUploadProgress/index.vue

@@ -105,12 +105,14 @@ function beforeUpload(file) {
 
   if (props.sizeLimit) {
     const isLtSize = file.size / 1024 < props.sizeLimit;
-    if (["png", "jpg", "jpeg"].includes(file.name?.split(".").at(-1))) {
+    const arr = file.name?.split(".")
+    const ext = arr[arr.length - 1]
+    if (["png", "jpg", "jpeg"].includes(ext)) {
       isPicture.value = "picture";
     }
     if (
       ["mp4", "ppt", "pptx", "xls", "xlsx"].includes(
-        file.name?.split(".").at(-1)
+        ext
       )
     ) {
       isPicture.value = "text";
@@ -165,7 +167,9 @@ function onExceed() {
 const dialogImageUrl = ref("");
 const dialogVisible = ref(false);
 const handlePictureCardPreview = (uploadFile) => {
-  if (["png", "jpg", "jpeg"].includes(uploadFile.url?.split(".").at(-1))) {
+  const arr = uploadFile.url?.split(".")
+  const ext = arr[arr.length - 1]
+  if (["png", "jpg", "jpeg"].includes(ext)) {
     dialogImageUrl.value = uploadFile.url;
     dialogVisible.value = true;
   }

+ 7 - 3
src/components/ImportHomework/index.vue

@@ -109,12 +109,14 @@ function beforeUpload(file) {
 
   if (props.sizeLimit) {
     const isLtSize = file.size / 1024 < props.sizeLimit;
-    if (["png", "jpg", "jpeg"].includes(file.name?.split(".").at(-1))) {
+    const arr = file.name?.split('.')
+    const ext = arr[arr.length - 1].toLowerCase()
+    if (["png", "jpg", "jpeg"].includes(ext)) {
       isPicture.value = "picture";
     }
     if (
       ["mp4", "ppt", "pptx", "xls", "xlsx"].includes(
-        file.name?.split(".").at(-1)
+        ext
       )
     ) {
       isPicture.value = "text";
@@ -172,7 +174,9 @@ function onExceed() {
 const dialogImageUrl = ref("");
 const dialogVisible = ref(false);
 const handlePictureCardPreview = (uploadFile) => {
-  if (["png", "jpg", "jpeg"].includes(uploadFile.url?.split(".").at(-1))) {
+  const arr = uploadFile.url?.split('.')
+  const ext = arr[arr.length - 1].toLowerCase()
+  if (["png", "jpg", "jpeg"].includes(ext)) {
     dialogImageUrl.value = uploadFile.url;
     dialogVisible.value = true;
   }

+ 2 - 1
src/layout/app/components/AppSider/index.vue

@@ -13,7 +13,8 @@ const modules: Record<string, { default: RouteRecordRaw }> = import.meta.glob(
 const constantRoutes: RouteRecordRaw[] = [];
 const asyncRoutes: RouteRecordRaw[] = [];
 Object.keys(modules).forEach((path) => {
-  const filename = path.split("/").at(-1);
+  const arr = path.split("/");
+  const filename = arr[arr.length - 1];
   if (filename?.startsWith("_")) constantRoutes.push(modules[path].default);
   else asyncRoutes.push(modules[path].default);
 });

+ 2 - 1
src/pages/jsd/personal/index.vue

@@ -70,7 +70,8 @@ const modules = import.meta.glob("~/router/routes/jsd/*.ts", { eager: true });
 const constantRoutes = [];
 const asyncRoutes = [];
 Object.keys(modules).forEach((path) => {
-  const filename = path.split("/").at(-1);
+  const arr = path.split("/")
+  const filename = arr[arr.length - 1];
   if (filename?.startsWith("_")) constantRoutes.push(modules[path].default);
   else asyncRoutes.push(modules[path].default);
 });

+ 1 - 1
src/pages/jsd/wdkc/zbkc/live.vue

@@ -175,7 +175,7 @@ function getChapterDetail() {
           source: res.data.one_info.pull_m3u8_address,
           width: "100%",
           height: "636px",
-          autoplay: false,
+          autoplay: true,
           cover: res.data.one_info.tzk_img,
           isLive: true,
           rePlay: false,

+ 2 - 1
src/pages/manage/tbkt/video.vue

@@ -166,7 +166,8 @@ const lookDetail = (type, file, name) => {
   if (type == 1) {
     window.open(getFullUrl(file));
   } else if (type == 2) {
-    const ext = file.split('.').at(-1);
+    const arr = file.split(".")
+    const ext = arr[arr.length - 1];
     let blob = new Blob([getFullUrl(file)], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); //type为所需要下载的文件格式,以xlsx文件为例
     let url = window.URL.createObjectURL(blob);
     let fileName = `${name}.${ext}`;

+ 2 - 1
src/pages/manage/yhxx/jsgl/MenuItem.vue

@@ -44,7 +44,8 @@ const modules = import.meta.glob("~/router/routes/manage/*.ts", {
 const constantRoutes = [];
 const asyncRoutes = [];
 Object.keys(modules).forEach((path) => {
-  const filename = path.split("/").at(-1);
+  const arr = path.split("/");
+  const filename = arr[arr.length - 1];
   if (filename?.startsWith("_")) constantRoutes.push(modules[path].default);
   else asyncRoutes.push(modules[path].default);
 });

+ 2 - 1
src/pages/xsd/index.vue

@@ -59,7 +59,8 @@ const modules = import.meta.glob('~/router/routes/xsd/*.ts', { eager: true });
 const constantRoutes = [];
 const asyncRoutes = [];
 Object.keys(modules).forEach((path) => {
-    const filename = path.split("/").at(-1);
+    const arr = path.split("/");
+    const filename = arr[arr.length - 1];
     if (filename?.startsWith("_")) constantRoutes.push(modules[path].default);
     else asyncRoutes.push(modules[path].default);
 });

+ 1 - 1
src/pages/zbkc/detailIsLive.vue

@@ -57,7 +57,7 @@
                 <div class="mt-20px" id="player-con"></div>
                 <ChatBlock :id="tzk_id" />
             </div>
-            <div v-if="user.user_role_id <75" class="w-300px mt-46px right-box pt-30px">
+            <div v-if="user.user_role_id ==75" class="w-300px mt-46px right-box pt-30px">
                 <div class="right-nav ml-20px">
                     <span>相关章节</span>
                     <i></i>

+ 2 - 1
src/pages/zbkc/homework.vue

@@ -134,7 +134,8 @@ function filePre(item) {
 
 function download(item) {
     // window.open(getFullUrl(item), '_blank');
-    const ext = item.split(';')[2].split('.').at(-1).toLowerCase()
+    const arr = item.split(';')[2].split('.');
+    const ext = arr[arr.length - 1].toLowerCase()
     downLoadFile1(getFullUrl(item.split(';')[2]), `${item.split(';')[0]}.${ext}`)
 }
 </script>

+ 2 - 1
src/router/index.ts

@@ -13,7 +13,8 @@ export const constantRoutes: RouteRecordRaw[] = []
 export const asyncRoutes: RouteRecordRaw[] = []
 export const frontRoutes: RouteRecordRaw[] = []
 Object.keys(modules).forEach((path) => {
-  const filename = path.split('/').at(-1)
+  const arr = path.split('/');
+  const filename = arr[arr.length - 1]
   if (filename?.startsWith('_'))
     constantRoutes.push(modules[path].default)
   else if (path.indexOf('./routes/manage') != -1) {