lex 11 месяцев назад
Родитель
Сommit
8e7ae4b125
2 измененных файлов с 6 добавлено и 15 удалено
  1. 2 5
      src/common/common.js
  2. 4 10
      src/common/util.js

+ 2 - 5
src/common/common.js

@@ -168,7 +168,7 @@ const _throttle = (fn, time) => {
 // }
 // 学生地址
 const validStudentUrl = () => {
-  let url = window.location.href;
+  let url = window.location.hostname;
   let returnUrl = "";
   if (/test/.test(url)) {
     // test环境
@@ -176,12 +176,9 @@ const validStudentUrl = () => {
   } else if (/dev/.test(url)) {
     // dev 环境
     returnUrl = "https://dev.gym.lexiaoya.cn/mdaya";
-  } else if (/online/.test(url)) {
+  } else {
     //线上
     returnUrl = "https://gym.lexiaoya.cn/mdaya";
-  } else {
-    // 默认test环境
-    returnUrl = "https://test.gym.lexiaoya.cn/mdaya";
   }
   return returnUrl;
 };

+ 4 - 10
src/common/util.js

@@ -158,7 +158,7 @@ export function checkPhone(phoneNumber) {
 
 // 学生地址
 export function validStudentUrl() {
-  let url = window.location.href;
+  let url = window.location.hostname;
   let returnUrl = "";
   if (/test/.test(url)) {
     // test环境
@@ -166,19 +166,16 @@ export function validStudentUrl() {
   } else if (/dev/.test(url)) {
     // dev 环境
     returnUrl = "https://dev.gym.lexiaoya.cn/mdaya";
-  } else if (/online/.test(url)) {
+  } else {
     //线上
     returnUrl = "https://gym.lexiaoya.cn/mdaya";
-  } else {
-    // 默认test环境
-    returnUrl = "https://test.gym.lexiaoya.cn/mdaya";
   }
   return returnUrl;
 }
 
 // 老师地址
 export function validTeacherUrl() {
-  let url = window.location.href;
+  let url = window.location.hostname;
   let returnUrl = "";
   if (/test/.test(url)) {
     // test环境
@@ -186,12 +183,9 @@ export function validTeacherUrl() {
   } else if (/dev/.test(url)) {
     // dev 环境
     returnUrl = "https://dev.gym.lexiaoya.cn/mteacher";
-  } else if (/online/.test(url)) {
+  } else {
     //线上
     returnUrl = "https://gym.lexiaoya.cn/mteacher";
-  } else {
-    // 默认test环境
-    returnUrl = "https://test.gym.lexiaoya.cn/mteacher";
   }
   return returnUrl;
 }