feat:Rock刷新去UID拦截,新增绑定错误自动刷新与使用/绑定超时预警

This commit is contained in:
2026-11-08 18:03:48 +08:00
parent 1dba8e4c2e
commit 51dcb9de5a
22 changed files with 768 additions and 182 deletions
+19
View File
@@ -35,6 +35,25 @@ func rockBuyerNewlyBound(token *model.RockToken, ref *RockRefreshResponse) bool
return true
}
// rockUpstreamBound 判断上游「当前」是否已绑定。
//
// 只看本次实时返回的绑定信号(status / bind_changed_at / binding),
// 不用 bound_account_id 判断:上游可能保留上一次绑定的账号残留,
// 用它会导致刷新按钮把「未扫码」误判成已绑定,也无法把真实绑定同步回本地。
func rockUpstreamBound(ref *RockRefreshResponse) bool {
if ref == nil {
return false
}
switch strings.ToLower(strings.TrimSpace(ref.Token.Status)) {
case model.RockStatusBound, model.RockStatusRedeemed:
return true
}
if strings.TrimSpace(ref.Token.BindChangedAt) != "" {
return true
}
return ref.Binding.Bound || strings.TrimSpace(ref.Binding.RoleID) != ""
}
func historicalDeliveriesOnly(token *model.RockToken, ref *RockRefreshResponse) bool {
if ref == nil || len(ref.DeliveryList) == 0 {
return false