Browse Source

定时刷工单处理

wuhb 4 months ago
parent
commit
c04342e4ec
3 changed files with 23 additions and 18 deletions
  1. 20 18
      pages/index/index.uvue
  2. 2 0
      pages/login/index.uvue
  3. 1 0
      pages/profile/index.uvue

+ 20 - 18
pages/index/index.uvue

@@ -510,25 +510,27 @@
 		if(is_time == "0"){
 			console.log("启动定时器")
 			keep.onStartCSystemTimer(10,function(){
-				console.log("onStartCSystemTimer ");
+				const is_login = uni.getStorageSync("login_key")
+				console.log("onStartCSystemTimer:" + is_login);
 				getNofiyMes();
-				// 加载待接单数量
-				loadAssignedCount()
-				
-				// 加载待自评工单数量
-				loadSelfScoreCount()
-				
-				// 加载超时工单数量
-				loadOverdueCount()
-				
-				// 加载已挂起工单数量
-				loadSuspendedCount()
-				
-				// 加载待审批工单数量
-				loadApproveCount()
-				// 超时工单列表
-				loadOverdueList()
-				
+				if(is_login == '1'){
+					// 加载待接单数量
+					loadAssignedCount()
+					
+					// 加载待自评工单数量
+					loadSelfScoreCount()
+					
+					// 加载超时工单数量
+					loadOverdueCount()
+					
+					// 加载已挂起工单数量
+					loadSuspendedCount()
+					
+					// 加载待审批工单数量
+					loadApproveCount()
+					// 超时工单列表
+					loadOverdueList()
+				}	
 				keep.acquire(1000);// 唤醒一秒钟
 			});
 			uni.setStorageSync("notify_key", "1")

+ 2 - 0
pages/login/index.uvue

@@ -203,6 +203,8 @@
 				return
 			}
 
+			uni.setStorageSync("login_key", "1")
+			
             // 保存登录信息
             saveAccessToken(resultObj['token'] as string)
 

+ 1 - 0
pages/profile/index.uvue

@@ -174,6 +174,7 @@
         } catch (e: any) {
             console.log('退出登录接口调用失败', e)
         } finally {
+			uni.setStorageSync("login_key", "0")
             clearAuth()
         }
     }