|
@@ -185,6 +185,21 @@ class Worker {
|
|
|
|
|
|
|
|
isRunSuccess(bindResponse) {
|
|
isRunSuccess(bindResponse) {
|
|
|
const payload = bindResponse?.data
|
|
const payload = bindResponse?.data
|
|
|
|
|
+ const info = String(bindResponse?.info || '')
|
|
|
|
|
+ const idempotentExists =
|
|
|
|
|
+ info.includes('跑步记录已存在') ||
|
|
|
|
|
+ info.includes('记录已存在')
|
|
|
|
|
+
|
|
|
|
|
+ // 幂等兜底:首包可能已成功落库,但响应在代理链路丢失,重发后会返回“记录已存在”。
|
|
|
|
|
+ // 该场景应按成功处理,避免误判失败后返还次数。
|
|
|
|
|
+ if (idempotentExists) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ok: true,
|
|
|
|
|
+ reason: info || '跑步记录已存在',
|
|
|
|
|
+ payload
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (!bindResponse || bindResponse.status !== 1 || !payload) {
|
|
if (!bindResponse || bindResponse.status !== 1 || !payload) {
|
|
|
return {
|
|
return {
|
|
|
ok: false,
|
|
ok: false,
|