增加bark配置
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user