fix version 1

This commit is contained in:
2026-09-22 21:15:34 +08:00
parent 9f86366638
commit d63d7e8b3a
277 changed files with 9959 additions and 1514 deletions

View File

@@ -28,7 +28,8 @@ func (p *ProviderClient) init() {
Provider = &ProviderClient{}
}
func withProvider() {
// InitProvider 初始化各服务商客户端供独立部署NewImpl与聚合部署service.Expose共用
func InitProvider() {
Provider.init()
for key, conf := range config.Spec.SMTP {
switch strings.ToLower(key) {
@@ -45,6 +46,12 @@ func withProvider() {
Provider.Aliyun = NewAliyun(conf)
case "tencent":
Provider.Tencent = NewTencent(conf)
case "default":
// 聚合部署的短信配置只有 default 段,此处作为默认阿里云通道初始化,
// 保证请求 provider=aliyun 时可用(显式配置的 aliyun 段优先)。
if Provider.Aliyun == nil {
Provider.Aliyun = NewAliyun(conf)
}
}
}
}