Quellcode durchsuchen

修改课件播放

lex vor 1 Jahr
Ursprung
Commit
5881058e2a
3 geänderte Dateien mit 27 neuen und 26 gelöschten Zeilen
  1. 19 19
      src/helpers/validate.ts
  2. 1 1
      src/main.ts
  3. 7 6
      src/views/coursewarePlay/index.tsx

+ 19 - 19
src/helpers/validate.ts

@@ -1,22 +1,22 @@
-// 学员地址
-export function vaildStudentUrl() {
-  const url = window.location.href;
-  let returnUrl = '';
-  if (/online/.test(url)) {
-    //线上
-    returnUrl = 'https://mstuonline.dayaedu.com';
-  } else if (/dev/.test(url)) {
-    // dev 环境
-    returnUrl = 'http://mstudev.dayaedu.com';
-  } else if (/test/.test(url)) {
-    // dev 环境
-    returnUrl = 'http://mstutest.dayaedu.com';
-  } else {
-    // 默认dev环境
-    returnUrl = 'http://mstudev.dayaedu.com';
-  }
-  return returnUrl;
-}
+// // 学员地址
+// export function vaildStudentUrl() {
+//   const url = window.location.hostname;
+//   let returnUrl = '';
+//   if (/online/.test(url)) {
+//     //线上
+//     returnUrl = 'https://gym.lexiaoya.cn/mdaya/';
+//   } else if (/dev.gym/.test(url)) {
+//     // dev 环境
+//     returnUrl = 'https://dev.gym.lexiaoya.cn/mdaya/';
+//   } else if (/test.gym/.test(url)) {
+//     // dev 环境
+//     returnUrl = 'https://test.gym.lexiaoya.cn/mdaya/';
+//   } else {
+//     // 默认dev环境
+//     returnUrl = 'https://dev.gym.lexiaoya.cn/mdaya/';
+//   }
+//   return returnUrl;
+// }
 
 export function checkPhone(phone: string) {
   const phoneRule = /^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\d{8}$/;

+ 1 - 1
src/main.ts

@@ -34,7 +34,7 @@ postMessage({ api: 'getNavHeight' }, (res: any) => {
 
 const url = window.location.href;
 const urlIsTeacher =
-  /mteaonline.dayaedu.com/.test(url) || /mteatest.dayaedu.com/.test(url)
+  /mteaonline.dayaedu.com/.test(url) || /mteatest.dayaedu.com/.test(url) || /gym.lexiaoya.cn\/mteacher/.test(url) || /test.gym.lexiaoya.cn\/mteacher/.test(url)
     ? true
     : false;
 // const paymentType = (window as any).paymentType; // 浏览器设置

+ 7 - 6
src/views/coursewarePlay/index.tsx

@@ -234,12 +234,13 @@ export default defineComponent({
 
       // console.log(list, 'list')
 
-      let _firstIndex = list.findIndex(
-        (n: any) =>
-          n.knowledgePointMaterialRelationId == route.query.kId ||
-          n.materialId == route.query.kId
-      );
-      _firstIndex = _firstIndex > -1 ? _firstIndex : 0;
+      const _firstIndex = 0;
+      // list.findIndex(
+      //   (n: any) =>
+      //     n.knowledgePointMaterialRelationId == route.query.kId ||
+      //     n.materialId == route.query.kId
+      // );
+      // _firstIndex = _firstIndex > -1 ? _firstIndex : 0;
       const item = list[_firstIndex];
 
       // console.log(_firstIndex, '_firstIndex', route.query.kId, 'route.query.kId', item)