|
@@ -149,9 +149,15 @@ export const pollDeviceStatus = (
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
timerId = setTimeout(poll, interval);
|
|
timerId = setTimeout(poll, interval);
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
if (settled) return;
|
|
if (settled) return;
|
|
|
|
|
|
|
|
|
|
+ // 认证失败立即中止,不重试
|
|
|
|
|
+ if (error?.isAuthError) {
|
|
|
|
|
+ done(null, new Error('登录已过期,请重新登录'));
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
failCount++;
|
|
failCount++;
|
|
|
|
|
|
|
|
if (failCount >= maxConsecutiveFailures) {
|
|
if (failCount >= maxConsecutiveFailures) {
|
|
@@ -229,9 +235,15 @@ export const pollRecognizeResult = (
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
timerId = setTimeout(poll, interval);
|
|
timerId = setTimeout(poll, interval);
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
if (settled) return;
|
|
if (settled) return;
|
|
|
|
|
|
|
|
|
|
+ // 认证失败立即中止,不重试
|
|
|
|
|
+ if (error?.isAuthError) {
|
|
|
|
|
+ done(null, new Error('登录已过期,请重新登录'));
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
failCount++;
|
|
failCount++;
|
|
|
|
|
|
|
|
if (failCount >= maxConsecutiveFailures) {
|
|
if (failCount >= maxConsecutiveFailures) {
|
|
@@ -309,9 +321,15 @@ export const pollOrderInfo = (
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
timerId = setTimeout(poll, interval);
|
|
timerId = setTimeout(poll, interval);
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
if (settled) return;
|
|
if (settled) return;
|
|
|
|
|
|
|
|
|
|
+ // 认证失败立即中止,不重试
|
|
|
|
|
+ if (error?.isAuthError) {
|
|
|
|
|
+ done(null, new Error('登录已过期,请重新登录'));
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
failCount++;
|
|
failCount++;
|
|
|
|
|
|
|
|
if (failCount >= maxConsecutiveFailures) {
|
|
if (failCount >= maxConsecutiveFailures) {
|