mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-23 18:00:32 +08:00
hash userID
This commit is contained in:
parent
f96e12a8b3
commit
21051900f9
@ -11,7 +11,10 @@ import (
|
|||||||
"Open_IM/pkg/utils"
|
"Open_IM/pkg/utils"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"math/big"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ParamsSetPassword struct {
|
type ParamsSetPassword struct {
|
||||||
@ -53,7 +56,13 @@ func SetPassword(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
userID := utils.Base64Encode(account)
|
//userID := utils.Base64Encode(account)
|
||||||
|
|
||||||
|
userID := utils.Md5(params.OperationID + strconv.FormatInt(time.Now().UnixNano(), 10))
|
||||||
|
bi := big.NewInt(0)
|
||||||
|
bi.SetString(userID[0:8], 16)
|
||||||
|
userID = bi.String()
|
||||||
|
|
||||||
url := config.Config.Demo.ImAPIURL + "/auth/user_register"
|
url := config.Config.Demo.ImAPIURL + "/auth/user_register"
|
||||||
openIMRegisterReq := api.UserRegisterReq{}
|
openIMRegisterReq := api.UserRegisterReq{}
|
||||||
openIMRegisterReq.OperationID = params.OperationID
|
openIMRegisterReq.OperationID = params.OperationID
|
||||||
|
Loading…
x
Reference in New Issue
Block a user