xyxie 1 gadu atpakaļ
vecāks
revīzija
d2296eda5d
1 mainītis faili ar 10 papildinājumiem un 5 dzēšanām
  1. 10 5
      services/base_from_wind_bridge.go

+ 10 - 5
services/base_from_wind_bridge.go

@@ -40,12 +40,17 @@ func GetWindBridgeUrl() (windUrl string, err error) {
 	err = nil
 	if tmpConfig != nil {
 		windFrom := tmpConfig.ConfigValue
-		tmpConfig, err = models.GetConfigDetailByCode(windFrom)
-		if err != nil && err.Error() != utils.ErrNoRow() {
-			err = errors.New("获取配置的wind地址失败,err:" + err.Error())
-			return
+		if windFrom != "" {
+			tmpConfig, err = models.GetConfigDetailByCode(windFrom)
+			if err != nil && err.Error() != utils.ErrNoRow() {
+				err = errors.New("获取配置的wind地址失败,err:" + err.Error())
+				return
+			}
+			if err == nil {
+				windUrl = tmpConfig.ConfigValue
+			}
+			err = nil
 		}
-		windUrl = tmpConfig.ConfigValue
 		return
 	}
 	return