Browse Source

修改地址

lex 1 năm trước cách đây
mục cha
commit
65f8d0a1b3

+ 13 - 13
src/helpers/utils.js

@@ -1,21 +1,21 @@
-export const array2object = (list = [], k = 'id', v) => {
-  const data = {}
+export const array2object = (list = [], k = "id", v) => {
+  const data = {};
   if (list) {
     for (const item of list) {
-      data[item[k]] = v ? item[v] : item
+      data[item[k]] = v ? item[v] : item;
     }
   }
-  return data
-}
+  return data;
+};
 
 export const getStuName = () => {
-  if (location.hostname.indexOf('dev') > -1) {
-    return 'http://mstudev.dayaedu.com'
-  } else if (location.hostname.indexOf('online') > -1) {
-    return 'https://mstuonline.dayaedu.com'
-  }  else if (location.hostname.indexOf('localhost') > -1) {
-    return 'http://localhost:9001'
+  if (location.hostname.indexOf("dev") > -1) {
+    return "https://dev.gym.lexiaoya.cn/mdaya";
+  } else if (location.hostname.indexOf("test") > -1) {
+    return "https://test.gym.lexiaoya.cn/mdaya";
+  } else if (location.hostname.indexOf("localhost") > -1) {
+    return "https://localhost:9001";
   } else {
-    return 'https://mstutest.dayaedu.com' //'http://localhost:9001' //
+    return "https://gym.lexiaoya.cn/mdaya";
   }
-}
+};

+ 1 - 4
src/layout/components/imChatTencet.vue

@@ -30,10 +30,7 @@ export default {
     console.log(this.$store.state.user, "user");
     const users = this.$store.state.user;
     const origin = /(localhost|192)/.test(location.host)
-      ? // ? "https://test.lexiaoya.cn"
-        "https://test.dayaedu.com"
-      : /online.dayaedu.com/.test(location.href)
-      ? "https://online.dayaedu.com"
+      ? "https://test.gym.lexiaoya.cn"
       : location.origin;
     this.src = `${origin}/imChat/?platform=daya&userID=${
       users.imUserId

+ 46 - 45
src/utils/validate.js

@@ -23,100 +23,101 @@ export function isvalidPhone(str) {
 
 // 学生地址
 export function vaildStudentUrl() {
-  let url = window.location.href;
+  let url = window.location.hostname;
   let returnUrl = "";
-  if (/online/.test(url)) {
-    //线上
-    returnUrl = "https://mstuonline.dayaedu.com";
-  } else if (/dev/.test(url)) {
+  if (/dev/.test(url)) {
     // dev 环境
-    returnUrl = "http://mstudev.dayaedu.com";
+    returnUrl = "https://dev.gym.lexiaoya.cn/mdaya";
   } else if (/test/.test(url)) {
     // dev 环境
-    returnUrl = "http://mstutest.dayaedu.com";
+    returnUrl = "https://test.gym.lexiaoya.cn/mdaya";
   } else {
-    // 默认dev环境
-    returnUrl = "http://mstutest.dayaedu.com";
+    returnUrl = "https://gym.lexiaoya.cn/mdaya";
   }
   return returnUrl;
 }
 
 // 老师地址
 export function vaildTeacherUrl() {
-  let url = window.location.href;
+  let url = window.location.hostname;
   let returnUrl = "";
-  if (/online/.test(url)) {
-    //线上
-    returnUrl = "https://mteaonline.dayaedu.com";
-  } else if (/dev/.test(url)) {
+  if (/dev/.test(url)) {
     // dev 环境
-    returnUrl = "http://mteadev.dayaedu.com";
+    returnUrl = "https://dev.gym.lexiaoya.cn/mteacher";
   } else if (/test/.test(url)) {
     // dev 环境
-    returnUrl = "http://mteatest.dayaedu.com";
+    returnUrl = "https://test.gym.lexiaoya.cn/mteacher";
   } else {
-    // 默认dev环境
-    returnUrl = "https://mteatest.dayaedu.com";
+    // 线上环境
+    returnUrl = "https://gym.lexiaoya.cn/mteacher";
   }
   return returnUrl;
 }
 
 // 教务地址
 export function vaildTeachingUrl() {
-  let url = window.location.href;
+  let url = window.location.hostname;
   let returnUrl = "";
-  if (/online/.test(url)) {
-    //线上
-    returnUrl = "https://manonline.dayaedu.com";
-  } else if (/dev/.test(url)) {
+  if (/dev/.test(url)) {
     // dev 环境
-    returnUrl = "http://mandev.dayaedu.com";
+    returnUrl = "https://dev.gym.lexiaoya.cn/manager";
   } else if (/test/.test(url)) {
     // dev 环境
-    returnUrl = "http://mantest.dayaedu.com";
+    returnUrl = "https://test.gym.lexiaoya.cn/manager";
   } else {
-    // 默认dev环境
-    returnUrl = "http://mantest.dayaedu.com";
+    // 线上环境
+    returnUrl = "https://gym.lexiaoya.cn/manager";
+  }
+  return returnUrl;
+}
+
+// 学校地址
+export function vaildSchoolUrl() {
+  let url = window.location.hostname;
+  let returnUrl = "";
+  if (/dev/.test(url)) {
+    // dev 环境
+    returnUrl = "https://dev.gym.lexiaoya.cn/school";
+  } else if (/test/.test(url)) {
+    // dev 环境
+    returnUrl = "https://test.gym.lexiaoya.cn/school";
+  } else {
+    // 线上环境
+    returnUrl = "https://gym.lexiaoya.cn/school";
   }
   return returnUrl;
 }
 
 // OA地址
 export function validOaUrl() {
-  let url = window.location.href;
+  let url = window.location.hostname;
   let returnUrl = "";
-  if (/online/.test(url)) {
-    //线上
-    returnUrl = "https://oaonline.dayaedu.com";
-  } else if (/dev/.test(url)) {
+  if (/dev/.test(url)) {
     // dev 环境
-    returnUrl = "http://oadev.dayaedu.com";
+    returnUrl = "https://dev.gym.lexiaoya.cn/oa";
   } else if (/test/.test(url)) {
     // dev 环境
-    returnUrl = "https://oatest.dayaedu.com";
+    returnUrl = "https://test.gym.lexiaoya.cn/oa";
   } else {
-    // 默认dev环境
-    returnUrl = "http://oatest.dayaedu.com";
+    // 线上环境
+    returnUrl = "https://gym.lexiaoya.cn/oa";
   }
   return returnUrl;
 }
 
 // 商城地址
 export function validMallUrl() {
-  let url = window.location.href;
+  let url = window.location.hostname;
   let returnUrl = "";
-  if (/online/.test(url)) {
-    //线上
-    returnUrl = "https://online.dayaedu.com/mall/";
-  } else if (/dev/.test(url)) {
+  if (/dev/.test(url)) {
     // dev 环境
-    returnUrl = "https://dev.dayaedu.com/mall/";
+    returnUrl = "https://dev.gym.lexiaoya.cn/mall/";
   } else if (/test/.test(url)) {
     // dev 环境
-    returnUrl = "https://test.dayaedu.com/mall/";
+    returnUrl = "https://test.gym.lexiaoya.cn/mall/";
   } else {
-    // 默认dev环境
-    returnUrl = "https://test.dayaedu.com/mall/";
+    // 线上环境
+    returnUrl = "https://gym.lexiaoya.cn/mall/";
   }
   return returnUrl;
 }

+ 99 - 54
src/views/categroyManager/insideSetting/branchManager.vue

@@ -7,7 +7,10 @@
     <transition name="el-fade-in-linear">
       <div
         class="m-core"
-        v-if="((tableList.length > 0 || pageInfo.page > 1) && contextFlag) || !isSearch"
+        v-if="
+          ((tableList.length > 0 || pageInfo.page > 1) && contextFlag) ||
+            !isSearch
+        "
       >
         <!-- 搜索类型 -->
         <save-form
@@ -78,7 +81,8 @@
             :data="tableList"
             :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
           >
-            <el-table-column align="center" prop="id" label="单位编号"> </el-table-column>
+            <el-table-column align="center" prop="id" label="单位编号">
+            </el-table-column>
             <el-table-column align="center" prop="name" label="单位名称">
             </el-table-column>
             <el-table-column align="center" prop="logo" label="logo">
@@ -106,7 +110,11 @@
           </el-table-column>
           <el-table-column align="center" prop="mobileNo" label="手机号">
           </el-table-column> -->
-            <el-table-column align="center" label="是否全职资源" v-if="tenantId == 1">
+            <el-table-column
+              align="center"
+              label="是否全职资源"
+              v-if="tenantId == 1"
+            >
               <template slot-scope="scope">
                 {{ scope.row.fullJobResource ? "是" : "否" }}
               </template>
@@ -136,7 +144,9 @@
                   type="text"
                   >删除</el-button
                 > -->
-                <el-button @click="rejuest(scope.row)" type="text">领队注册</el-button>
+                <el-button @click="rejuest(scope.row)" type="text"
+                  >领队注册</el-button
+                >
               </template>
             </el-table-column>
           </el-table>
@@ -156,7 +166,11 @@
         title="合作单位"
         btnTitle="新建合作单位"
         :context="context"
-        v-if="!(tableList.length > 0 || pageInfo.page > 1) && contextFlag && isSearch"
+        v-if="
+          !(tableList.length > 0 || pageInfo.page > 1) &&
+            contextFlag &&
+            isSearch
+        "
       />
     </transition>
     <el-dialog
@@ -181,14 +195,22 @@
         >
         </el-alert>
         <el-row>
-          <el-form-item label="单位名称" prop="name" :label-width="formLabelWidth">
+          <el-form-item
+            label="单位名称"
+            prop="name"
+            :label-width="formLabelWidth"
+          >
             <el-input
               v-model.trim="form.name"
               :disabled="basdisabled"
               autocomplete="off"
             ></el-input>
           </el-form-item>
-          <el-form-item label="所属分部" prop="organId" :label-width="formLabelWidth">
+          <el-form-item
+            label="所属分部"
+            prop="organId"
+            :label-width="formLabelWidth"
+          >
             <el-select
               :disabled="basdisabled"
               v-model.trim="form.organId"
@@ -252,7 +274,10 @@
             prop="fullJobResource"
             :label-width="formLabelWidth"
           >
-            <el-select :disabled="basdisabled" v-model.trim="form.fullJobResource">
+            <el-select
+              :disabled="basdisabled"
+              v-model.trim="form.fullJobResource"
+            >
               <el-option label="是" :value="1"></el-option>
               <el-option label="否" :value="0"></el-option>
             </el-select>
@@ -293,7 +318,9 @@
             ></i>
           </div>
           <el-form-item
-            :rules="[{ required: true, message: '请输入联系人', trigger: 'blur' }]"
+            :rules="[
+              { required: true, message: '请输入联系人', trigger: 'blur' }
+            ]"
             :label="'联系人姓名'"
             :prop="'cooperationOrganLinkmanList.' + index + '.linkman'"
             :label-width="formLabelWidth"
@@ -305,7 +332,9 @@
             ></el-input>
           </el-form-item>
           <el-form-item
-            :rules="[{ required: true, message: '请输入职位', trigger: 'blur' }]"
+            :rules="[
+              { required: true, message: '请输入职位', trigger: 'blur' }
+            ]"
             :label="'联系人职位'"
             :prop="'cooperationOrganLinkmanList.' + index + '.job'"
             :label-width="formLabelWidth"
@@ -323,8 +352,8 @@
               {
                 pattern: /^1[3456789]\d{9}$/,
                 message: '请输入正确的手机号',
-                trigger: 'blur',
-              },
+                trigger: 'blur'
+              }
             ]"
             :label="'联系人手机号'"
             :prop="'cooperationOrganLinkmanList.' + index + '.mobileNo'"
@@ -379,11 +408,15 @@
       <el-radio-group v-model="radio" @change="changeRadio" class="groupWrap">
         <el-radio label="SCHOOL_LEADER">分管领导</el-radio>
         <el-radio label="TEACHER">负责老师</el-radio>
-        <el-radio :disabled="staffStat.orchestraLeaderNums > 0" label="ORCHESTRA_LEADER"
+        <el-radio
+          :disabled="staffStat.orchestraLeaderNums > 0"
+          label="ORCHESTRA_LEADER"
           >乐团领队</el-radio
         >
 
-        <el-radio :disabled="staffStat.schoolmasterNums > 0" label="SCHOOLMASTER"
+        <el-radio
+          :disabled="staffStat.schoolmasterNums > 0"
+          label="SCHOOLMASTER"
           >学校校长</el-radio
         >
       </el-radio-group>
@@ -396,7 +429,7 @@ import {
   cooperationOrganAdd,
   cooperationOrganUpdate,
   cooperationOrganDel,
-  queryPage,
+  queryPage
 } from "@/api/systemManage";
 import cleanDeep from "clean-deep";
 import { isvalidPhone } from "@/utils/validate";
@@ -407,7 +440,7 @@ import qs from "qs";
 import { isBoolean } from "@rongcloud/engine";
 import ImageCropper from "@/components/ImageCropper";
 import qrCode from "@/components/QrCode/index";
-import { vaildTeachingUrl } from "@/utils/validate";
+import { vaildSchoolUrl } from "@/utils/validate";
 import { getCooperation } from "./api";
 let validPhone = (rule, value, callback) => {
   if (!value) {
@@ -426,7 +459,7 @@ export default {
       searchForm: {
         organId: null,
         isEnable: null,
-        search: null,
+        search: null
       },
       validPhone,
       searchLsit: [],
@@ -437,14 +470,14 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
       teachingStatus: false, // 添加教学点
       formActionTitle: "create",
       formTitle: {
         create: "添加合作单位",
         update: "修改合作单位",
-        look: "查看合作单位",
+        look: "查看合作单位"
       },
       formLabelWidth: "120px",
       form: {
@@ -458,20 +491,24 @@ export default {
         educationUserId: null,
         logo: null,
         cooperationOrganLinkmanList: [
-          { cooperationOrganId: "", job: "", linkman: "", mobileNo: "" },
-        ],
+          { cooperationOrganId: "", job: "", linkman: "", mobileNo: "" }
+        ]
       },
       rules: {
-        name: [{ required: true, message: "请输入教学点名称", trigger: "blur" }],
+        name: [
+          { required: true, message: "请输入教学点名称", trigger: "blur" }
+        ],
 
-        organId: [{ required: true, message: "请选择所属分部", trigger: "change" }],
+        organId: [
+          { required: true, message: "请选择所属分部", trigger: "change" }
+        ],
         educationUserId: [
-          { required: true, message: "请选择乐团主管", trigger: "change" },
+          { required: true, message: "请选择乐团主管", trigger: "change" }
         ],
         fullJobResource: [
-          { required: true, message: "请选择是否全职资源", trigger: "change" },
+          { required: true, message: "请选择是否全职资源", trigger: "change" }
         ],
-        isEnable: [{ required: true, message: "请选择状态", trigger: "change" }],
+        isEnable: [{ required: true, message: "请选择状态", trigger: "change" }]
       },
       basdisabled: false,
       actionRow: null,
@@ -487,7 +524,7 @@ export default {
         previewsCircle: false, //预览图是否是圆形
         full: true, // 是否输出原图比例的截图
         enlarge: 2,
-        title: "logo", //模态框上显示的标题
+        title: "logo" //模态框上显示的标题
       },
       codeStatus: false,
       codeUrl: "www.baidu.com",
@@ -498,8 +535,8 @@ export default {
         schoolLeaderNums: 0,
         schoolmasterNums: 0,
         studentNums: 0,
-        teacherNums: 0,
-      },
+        teacherNums: 0
+      }
     };
   },
   async mounted() {
@@ -517,10 +554,10 @@ export default {
       this.$confirm("您确定删除合作单位?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
-          cooperationOrganDel(rows.id).then((res) => {
+          cooperationOrganDel(rows.id).then(res => {
             if (res.code == 200) {
               this.$message.success("删除成功");
               this.teachingStatus = false;
@@ -540,7 +577,7 @@ export default {
       this.searchForm = {
         organId: null,
         isEnable: null,
-        search: null,
+        search: null
       };
 
       this.$refs.searchForm.resetFields();
@@ -550,7 +587,7 @@ export default {
     },
     changeRadio() {
       this.$refs.qrCode.resetImage();
-      this.codeUrl = `${vaildTeachingUrl()}/school/#/school-register?id=${
+      this.codeUrl = `${vaildSchoolUrl()}/#/school-register?id=${
         this.activeRow.id
       }&type=${this.radio}`;
     },
@@ -561,21 +598,21 @@ export default {
           url: "/api-web/export/cooperationOrgan",
           fileName: "合作单位.xls",
           method: "post",
-          params: qs.stringify(cleanDeep(this.searchForm)),
+          params: qs.stringify(cleanDeep(this.searchForm))
         },
         "您确定导出合作单位?"
       );
     },
     onTeachingSubmit(formName) {
       // 添加数据
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate(valid => {
         if (valid) {
           if (this.formActionTitle == "create") {
             if (this.form.id) {
               // 判断有没有Id,如果有则删除
               delete this.form.id;
             }
-            cooperationOrganAdd(this.form).then((res) => {
+            cooperationOrganAdd(this.form).then(res => {
               if (res.code == 200) {
                 this.$message.success("创建成功");
                 this.teachingStatus = false;
@@ -585,7 +622,7 @@ export default {
               }
             });
           } else if (this.formActionTitle == "update") {
-            cooperationOrganUpdate(this.form).then((res) => {
+            cooperationOrganUpdate(this.form).then(res => {
               if (res.code == 200) {
                 this.$message.success("修改成功");
                 this.teachingStatus = false;
@@ -605,8 +642,8 @@ export default {
       queryPage({
         rows: this.pageInfo.limit,
         page: this.pageInfo.page,
-        ...this.searchForm,
-      }).then((res) => {
+        ...this.searchForm
+      }).then(res => {
         if (res.code == 200 && res.data) {
           // this.contextFlag = res.data.rows.length>0?true:false
           this.contextFlag = true;
@@ -635,7 +672,7 @@ export default {
           fullJobResource: rows.fullJobResource,
           isEnable: rows.isEnable,
           educationUserId: rows.educationUserId,
-          logo: rows.logo,
+          logo: rows.logo
         };
 
         let cooperationOrganLinkmanList =
@@ -646,10 +683,14 @@ export default {
                   cooperationOrganId: rows.id,
                   job: "",
                   linkman: "",
-                  mobileNo: "",
-                },
+                  mobileNo: ""
+                }
               ];
-        this.$set(this.form, "cooperationOrganLinkmanList", cooperationOrganLinkmanList);
+        this.$set(
+          this.form,
+          "cooperationOrganLinkmanList",
+          cooperationOrganLinkmanList
+        );
         this.basdisabled = false;
       } else if (type == "look") {
         this.changeOrgan(rows.organId);
@@ -664,13 +705,17 @@ export default {
           fullJobResource: rows.fullJobResource,
           isEnable: rows.isEnable,
           educationUserId: rows.educationUserId,
-          logo: rows.logo,
+          logo: rows.logo
         };
         let cooperationOrganLinkmanList =
           rows.cooperationOrganLinkmanList.length > 0
             ? [...rows.cooperationOrganLinkmanList]
             : [];
-        this.$set(this.form, "cooperationOrganLinkmanList", cooperationOrganLinkmanList);
+        this.$set(
+          this.form,
+          "cooperationOrganLinkmanList",
+          cooperationOrganLinkmanList
+        );
         this.basdisabled = true;
         // 查看
       } else {
@@ -683,7 +728,7 @@ export default {
       if (val) {
         try {
           const ruselt = await getOrganRole({
-            id: val,
+            id: val
           });
           this.educationList = ruselt?.data?.EDUCATION;
 
@@ -705,7 +750,7 @@ export default {
           cooperationOrganId: this.actionRow.id,
           job: "",
           linkman: "",
-          mobileNo: "",
+          mobileNo: ""
         });
       } else {
         // 新增
@@ -713,7 +758,7 @@ export default {
           cooperationOrganId: "",
           job: "",
           linkman: "",
-          mobileNo: "",
+          mobileNo: ""
         });
       }
     },
@@ -734,12 +779,12 @@ export default {
         console.log(res, "rejuest");
         this.staffStat = { ...res.data.staffStat };
         this.activeRow = row;
-        this.codeUrl = `${vaildTeachingUrl()}/school/#/school-register?id=${
+        this.codeUrl = `${vaildSchoolUrl()}/#/school-register?id=${
           row.id
         }&type=${this.radio}`;
         this.codeStatus = true;
       } catch (e) {}
-    },
+    }
   },
   watch: {
     teachingStatus(val) {
@@ -754,11 +799,11 @@ export default {
           organId: null,
           isEnable: null,
           educationUserId: null,
-          cooperationOrganLinkmanList: [],
+          cooperationOrganLinkmanList: []
         };
         this.$refs.ruleForm.resetFields();
       }
-    },
+    }
   },
   computed: {
     isSearch() {
@@ -768,8 +813,8 @@ export default {
         !isBoolean(this.searchForm.isEnable) &&
         !this.searchForm.isEnable
       );
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>