mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 11:22:10 +08:00 
			
		
		
		
	方便测试导入数据
This commit is contained in:
		
							parent
							
								
									961beb3e85
								
							
						
					
					
						commit
						c1fdad547a
					
				@ -17,6 +17,7 @@ import (
 | 
			
		||||
 | 
			
		||||
type ParamsSetPassword struct {
 | 
			
		||||
	Email            string `json:"email"`
 | 
			
		||||
	Name             string `json:"name"`
 | 
			
		||||
	PhoneNumber      string `json:"phoneNumber"`
 | 
			
		||||
	Password         string `json:"password"`
 | 
			
		||||
	VerificationCode string `json:"verificationCode"`
 | 
			
		||||
@ -38,6 +39,9 @@ func SetPassword(c *gin.Context) {
 | 
			
		||||
	} else {
 | 
			
		||||
		account = params.PhoneNumber
 | 
			
		||||
	}
 | 
			
		||||
	if params.Name == "" {
 | 
			
		||||
		params.Name = account
 | 
			
		||||
	}
 | 
			
		||||
	if params.VerificationCode != config.Config.Demo.SuperCode {
 | 
			
		||||
		accountKey := account + "_" + constant.VerificationCodeForRegisterSuffix
 | 
			
		||||
		v, err := db.DB.GetAccountCode(accountKey)
 | 
			
		||||
@ -54,7 +58,7 @@ func SetPassword(c *gin.Context) {
 | 
			
		||||
	openIMRegisterReq.OperationID = params.OperationID
 | 
			
		||||
	openIMRegisterReq.Platform = params.Platform
 | 
			
		||||
	openIMRegisterReq.UserID = account
 | 
			
		||||
	openIMRegisterReq.Nickname = account
 | 
			
		||||
	openIMRegisterReq.Nickname = params.Name
 | 
			
		||||
	openIMRegisterReq.Secret = config.Config.Secret
 | 
			
		||||
	openIMRegisterResp := api.UserRegisterResp{}
 | 
			
		||||
	bMsg, err := http2.Post(url, openIMRegisterReq, config.Config.MessageCallBack.CallBackTimeOut)
 | 
			
		||||
@ -69,7 +73,7 @@ func SetPassword(c *gin.Context) {
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			log.NewError(params.OperationID, utils.GetSelfFuncName(), err.Error())
 | 
			
		||||
		}
 | 
			
		||||
		c.JSON(http.StatusOK, gin.H{"errCode": constant.RegisterFailed, "errMsg": "register failed: "+openIMRegisterResp.ErrMsg})
 | 
			
		||||
		c.JSON(http.StatusOK, gin.H{"errCode": constant.RegisterFailed, "errMsg": "register failed: " + openIMRegisterResp.ErrMsg})
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	log.Info(params.OperationID, "begin store mysql", account, params.Password)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user