shawenguan 1 年間 前
コミット
21a035cd11
1 ファイル変更12 行追加7 行削除
  1. 12 7
      Scripts/unicom/unicomHelper.js

+ 12 - 7
Scripts/unicom/unicomHelper.js

@@ -380,13 +380,18 @@ function handleFlowManagement() {
     if (!rspData) {
         return;
     }
-    let regex = /\(\{timeNum:-?\d+,timeType:"AM"\}\)/g;
-    let newValue = '({timeNum:120,timeType:"AM"})';
-    let outputString = rspData.replace(regex, newValue);
-    regex = /\(\{timeNum:-?\d+,timeType:"PM"\}\)/g;
-    newValue = '({timeNum:120,timeType:"PM"})';
-    outputString = outputString.replace(regex, newValue);
-    gRetBody = outputString;
+    let outputString = rspData;
+    if (outputString.indexOf('timeType:"AM"') != -1) {
+        let regex = /\(\{timeNum:-?\d+,timeType:"AM"\}\)/g;
+        let newValue = '({timeNum:120,timeType:"AM"})';
+        outputString = outputString.replace(regex, newValue);
+        gRetBody = outputString;
+    } else if (outputString.indexOf('timeType:"PM"') != -1) {
+        let regex = /\(\{timeNum:-?\d+,timeType:"PM"\}\)/g;
+        let newValue = '({timeNum:120,timeType:"PM"})';
+        outputString = outputString.replace(regex, newValue);
+        gRetBody = outputString;
+    }
 }
 
 function handleGrabCoupon() {