347617796@qq.com 3 gadi atpakaļ
vecāks
revīzija
ee20b099af
5 mainītis faili ar 30 papildinājumiem un 12 dzēšanām
  1. 7 6
      app.js
  2. 1 1
      app.json
  3. 5 1
      pages/begin/begin.acss
  4. 2 1
      pages/begin/begin.axml
  5. 15 3
      pages/begin/begin.js

+ 7 - 6
app.js

@@ -1,8 +1,8 @@
 import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 
-const baseUrl = "https://test-ding.g107.com/";//测试
-// const baseUrl = "https://ding.insys.g107.com/";//正式
+// const baseUrl = "https://test-ding.g107.com/";//测试
+const baseUrl = "https://ding.insys.g107.com/";//正式
 var that;
 var yearArr = [];
 var year = formatTime(new Date()).year;
@@ -215,7 +215,7 @@ App({
     // }
   },
   //免登
-  login(corpId, callBack, errBack) {
+  login(corpId, callBack, errBack=function(){}) {
     if (that.globalData.token) {
       callBack(true)
     } else {
@@ -256,9 +256,9 @@ App({
               that.globalData.showToast(res.msg)
             }
           }).catch(err => {
-            console.log(err)
-            // errBack(err.data.code);
-            // return
+            // console.log(err)
+            errBack(err.data);
+            return
             if (err.data.code == 2001) {
               dd.confirm({
                 title: '尊敬的用户',
@@ -277,6 +277,7 @@ App({
           })
         },
         fail: function (err) {
+          console.log(JSON.stringify(err))
           that.globalData.showToast("错误" + JSON.stringify(err))
         }
       });

+ 1 - 1
app.json

@@ -1,7 +1,7 @@
 {
   "pages": [
-    "pages/workbench/index/index",
     "pages/begin/begin",
+    "pages/workbench/index/index",
     "pages/statistics/index/index",
     "pages/deploy/index/index",
     "pages/workbench/statistics_A/statistics_A",

+ 5 - 1
pages/begin/begin.acss

@@ -15,5 +15,9 @@
   }
 	.text{
 		font-size: 28rpx;
-		color: #999
+		color: #999;
+		margin-bottom: 30rpx;
+	}
+	.btn{
+		padding: 0 16rpx;
 	}

+ 2 - 1
pages/begin/begin.axml

@@ -1,6 +1,7 @@
 <view>
   <view class="noData flex-box-v flex-center-center">
     <image mode="scaleToFill" src="../../image/logo.png" class="initImg"/>
-    <text class="text">企业信息同步中...</text>
+    <text class="text">{{str}}</text>
+    <button type="primary" a:if="{{num==3}}" class="btn" catchTap="loginAll">同步企业信息</button>
   </view>
 </view>

+ 15 - 3
pages/begin/begin.js

@@ -1,7 +1,10 @@
 var app = getApp();
 var that;
 Page({
-  data: {},
+  data: {
+    num:0,
+    str:'企业信息同步中...',
+  },
   onLoad() {
    that = this;
    that.loginAll();
@@ -19,11 +22,20 @@ Page({
             url: '../workbench/noJurisdiction/noJurisdiction'
           })
         }
-      },function(code){
-        if(code==2001){
+      },function(data){
+        console.log(data,that.data.num)
+        if(data.code==2001&&data.msg!='企业授权已过期'){
+          if(that.data.num==3){ return false}
           setTimeout(function(){ 
+            let num=that.data.num;
+            that.setData({ num:num+1 })
             that.loginAll();
           }, 3000);
+        }else{
+             that.setData({
+              num:0,
+              str:'企业授权已过期'
+            })
         }
       })
   },