shawenguan 2 년 전
부모
커밋
59cfec4c63
1개의 변경된 파일7개의 추가작업 그리고 6개의 파일을 삭제
  1. 7 6
      Scripts/jhsh/jhshHelper.js

+ 7 - 6
Scripts/jhsh/jhshHelper.js

@@ -84,10 +84,10 @@ function checkHandleRequest() {
         }
         lk.log('queryOptType='+queryOptType);
         lk.log('txcode='+String(txcode));
-        let notifyCount = checkTodayNotifyCount();
         if('clp_service' == queryOptType){
             switch(txcode){
                 case 'autoLogin':
+                    let notifyCount = checkTodayNotifyCount(txcode);
                     let DeviceId = $request.headers['DeviceId'] || $request.headers['Deviceid'] || $request.headers['deviceid'];
                     let MBCUserAgent = $request.headers['MBC-User-Agent'] || $request.headers['Mbc-user-agent'] || $request.headers['mbc-user-agent'];
                     if($request.headers['AppVersion']){
@@ -118,6 +118,7 @@ function checkHandleRequest() {
             lk.log(`建行生活活动数据[${txcode}]获取成功`);
             switch(txcode){
                 case 'A3341A038':
+                    let notifyCount = checkTodayNotifyCount(txcode);
                     if(notifyCount < 2){
                         lk.appendNotifyInfo('🎉 建行生活签到数据获取成功');
                     }
@@ -129,24 +130,24 @@ function checkHandleRequest() {
     }
 }
 
-function checkTodayNotifyCount(){
-    let notifyCntStr = lk.getVal(jhshStoreKeyPrefix+'NotifyCnt');
+function checkTodayNotifyCount(flag='default'){
+    let notifyCntStr = lk.getVal(jhshStoreKeyPrefix+'NotifyCnt-'+flag);
     let td = lk.formatDate(new Date(), 'yyyyMMdd');
     let n = 0;
     if(notifyCntStr){
         let [date, num] = notifyCntStr.split('_');
         if (date == td && num) {
             n = Number(num) + 1;
-            lk.setVal(jhshStoreKeyPrefix+'NotifyCnt', `${td}_${n}`);
+            lk.setVal(jhshStoreKeyPrefix+'NotifyCnt-'+flag, `${td}_${n}`);
             return n;
         } else {
             n = n + 1;
-            lk.setVal(jhshStoreKeyPrefix+'NotifyCnt', `${td}_${n}`);
+            lk.setVal(jhshStoreKeyPrefix+'NotifyCnt-'+flag, `${td}_${n}`);
             return n;
         }
     }else{
         n = n + 1;
-        lk.setVal(jhshStoreKeyPrefix+'NotifyCnt', `${td}_${n}`);
+        lk.setVal(jhshStoreKeyPrefix+'NotifyCnt-'+flag, `${td}_${n}`);
         return n;
     }
 }