功能:发货链接支持永久有效,默认 TTL=0

- DELIVERY_LINK_TTL_MINUTES 设为 0 或负数时链接永久有效(expires_at 存 NULL),
  默认值由 120 改为 0,本地 .env 同步改为永久
- 新增 delivery_link_generated_at 列区分从未生成与永久链接,兼容历史数据
- 永久链接授权仅校验 HMAC 签名、不校验过期(exp=0),作废/恢复语义不变
- 前端链接有效期列对永久链接显示"永久有效"
This commit is contained in:
yml2213
2026-08-14 14:26:06 +08:00
parent 11bce9c87e
commit b76d8dc257
11 changed files with 147 additions and 32 deletions
+2
View File
@@ -242,6 +242,8 @@ type FulfillmentOrder struct {
DeliveredAt *time.Time `json:"delivered_at"`
DeliveryLinkExpiresAt *time.Time `json:"delivery_link_expires_at"`
DeliveryLinkRevokedAt *time.Time `json:"delivery_link_revoked_at"`
// DeliveryLinkGeneratedAt 记录发货链接的生成/恢复时间;expires_at 为 NULL 时表示永久有效。
DeliveryLinkGeneratedAt *time.Time `json:"delivery_link_generated_at"`
MerchantProduct *MerchantProduct `gorm:"foreignKey:MerchantProductID" json:"merchant_product,omitempty"`
}