增加bark配置

This commit is contained in:
2026-06-17 23:49:19 +08:00
parent 22e0e75c35
commit 6ee1f26124
19 changed files with 784 additions and 260 deletions
+4 -18
View File
@@ -157,25 +157,11 @@ func VerifyBackendLoginCode(tenantName, account, channel, code string) error {
}
func getDefaultSystemSMSConfig() (backendURL string, apiKey string, err error) {
var row models.SystemSMS
err = models.Orm.QueryTable(new(models.SystemSMS)).
Filter("is_default", 1).
Filter("status", 1).
OrderBy("-weight", "-id").
Limit(1).
One(&row)
if err != nil {
err2 := models.Orm.QueryTable(new(models.SystemSMS)).
Filter("config_code", "custom").
OrderBy("-id").
Limit(1).
One(&row)
if err2 != nil {
return "", "", err2
}
backendURL = models.GetPlatformSettingValue("sms_custom_url", "")
apiKey = models.GetPlatformSettingValue("sms_custom_key", "")
if backendURL == "" || apiKey == "" {
return "", "", fmt.Errorf("短信网关未配置")
}
backendURL = strings.TrimSpace(row.ApiURL)
apiKey = strings.TrimSpace(row.ApiKey)
return backendURL, apiKey, nil
}