diff --git a/config/config.yaml b/config/config.yaml index 564454409..f6a372962 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -674,6 +674,7 @@ demo: smtpAddr: "smtp.qq.com" smtpPort: 25 #需开放此端口 出口方向 testDepartMentID: 001 + imAPIURL: http://127.0.0.1:10002 rtc: port: 11300 diff --git a/internal/demo/register/set_password.go b/internal/demo/register/set_password.go index 2b1bbbee1..7a0578264 100644 --- a/internal/demo/register/set_password.go +++ b/internal/demo/register/set_password.go @@ -10,7 +10,6 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/utils" "encoding/json" - "fmt" "github.com/gin-gonic/gin" "net/http" ) @@ -53,7 +52,7 @@ func SetPassword(c *gin.Context) { return } } - url := fmt.Sprintf("http://%s:%d/auth/user_register", utils.ServerIP, config.Config.Api.GinPort[0]) + url := config.Config.Demo.ImAPIURL + "/auth/user_register" openIMRegisterReq := api.UserRegisterReq{} openIMRegisterReq.OperationID = params.OperationID openIMRegisterReq.Platform = params.Platform diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 89225d4a8..e6e34a7be 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -412,6 +412,7 @@ type config struct { SmtpPort int `yaml:"smtpPort"` } TestDepartMentID string `yaml:"testDepartMentID"` + ImAPIURL string `yaml:"imAPIURL"` } Rtc struct { Port int `yaml:"port"`