Leon 2 vuotta sitten
vanhempi
commit
2ec149dfd5
1 muutettua tiedostoa jossa 13 lisäystä ja 9 poistoa
  1. 13 9
      src/features/trackSomething/components/Activity.tsx

+ 13 - 9
src/features/trackSomething/components/Activity.tsx

@@ -99,14 +99,6 @@ export default function Component(props: any) {
     }
 
     function getWeRunData(autoCheck = false) {
-        Taro.checkSession({
-            success: function () {
-              console.log('打卡前获取session_key 未过期')
-            },
-            fail: function () {
-              console.log('打卡前获取session_key 已过期')
-            }
-          })
 
         // setTitle('打卡');
         setAllowRun(true)
@@ -125,7 +117,19 @@ export default function Component(props: any) {
                     cloudID: res.cloudID,
                 }
                 uploadSteps(params).then(res => {
-                    uploadSuccess(res, autoCheck, time)
+                    if ((res as any).error_code=='WX_STEP_PARSE_FAIL'){
+                        retry(params, autoCheck, time)
+                        if (!autoCheck){
+                            Taro.showToast({
+                                icon:'none',
+                                title:(res as any).error_message
+                            })
+                        }
+                    }
+                    else {
+                        uploadSuccess(res, autoCheck, time)
+                    }
+                    
                 }).catch(e => {
                     retry(params, autoCheck, time)
                     Taro.checkSession({