소스 검색

上下班版本判断

seimin 3 년 전
부모
커밋
9bf903fc72
2개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 0
      src/main.js
  2. 4 2
      src/views/my.vue

+ 3 - 0
src/main.js

@@ -21,6 +21,9 @@ axios.defaults.baseURL = protocolName + "//" + domainName;
21 21
 Vue.prototype.$http = axios;
22 22
 Vue.config.productionTip = false;
23 23
 Vue.prototype.$host = protocolName + "//" + domainName;
24
+//因项目众多,前端为了加以区分,所以用域名加以判断,后期有更好的方式可以自行修改
25
+// 中南财大
26
+Vue.prototype.isZncd = document.domain === 'itsm.zuel.edu.cn';
24 27
 
25 28
 /* eslint-disable no-new */
26 29
 new Vue({

+ 4 - 2
src/views/my.vue

@@ -157,8 +157,10 @@ export default {
157 157
       });
158 158
       this.toast.show();
159 159
       // 本地测试
160
-      // this.goToWork(online, '123');
161
-      // return;
160
+      if(!this.isZncd){
161
+        this.goToWork(online, '');
162
+        return;
163
+      }
162 164
       //第二个参数 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
163 165
       sdk.getLocation(res => {
164 166
         // alert(JSON.stringify(res));