diff --git a/internal/services/gateway/admin_write_channel_config.go b/internal/services/gateway/admin_write_channel_config.go index 6dedb2f..fbc7b70 100644 --- a/internal/services/gateway/admin_write_channel_config.go +++ b/internal/services/gateway/admin_write_channel_config.go @@ -96,7 +96,11 @@ func (s *Server) adminSaveChannelConfig(w http.ResponseWriter, r *http.Request) return } cfg := channelConfigFromRequest(req) - if len(cfg) == 0 { + // weixin-ilink may be saved with an empty config: the panel creates the account + // first, then the user scans the QR (get_bot_qrcode) which fills bot_token/bot_id/ + // owner_id via login-status (design/08 §4). Requiring a token here would block that + // flow, so exempt it from the "at least one field" gate. + if len(cfg) == 0 && platform != "weixin-ilink" { s.auditClaims(r, "channel.save", "error") writeError(w, apperr.Wrap(apperr.ErrBadRequest, "bad_request", "至少提供 token/baseUrl/address 等配置字段")) return