Browse Source

避免接口未返回,导致timestamp变为NaN

lifanagju_citu 1 month ago
parent
commit
e93e027409
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/config/axios/service.js
  2. 1 1
      src/store/system.js

+ 1 - 1
src/config/axios/service.js

@@ -127,7 +127,7 @@ service.interceptors.request.use(
         appId: 'web_client',
         AppSecret: 'fa0fc0b5098b974b',
         // timestamp: 1735282548997,
-        timestamp: new Date().getTime() + systemInfo.timeDifference,
+        timestamp: new Date().getTime() + (Number(systemInfo?.timeDifference) || 0),
       })
       const content = {
         data: config.data,

+ 1 - 1
src/store/system.js

@@ -11,7 +11,7 @@ export const useSystem = defineStore('system',
     })
 
     const setTimeDifference = (Difference) => {
-      systemInfo.value.timeDifference = Difference
+      systemInfo.value.timeDifference = Number(Difference) || 0
     }
 
     const getTimeDifference = () => {