mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
base64 userID
This commit is contained in:
parent
05e378fe37
commit
2f62db66cb
@ -204,6 +204,7 @@ func oaNotification(operationID, userID string) {
|
||||
}
|
||||
bytes, err := json.Marshal(elem)
|
||||
if err != nil {
|
||||
log.NewError(operationID, utils.GetSelfFuncName(), "elem: ", elem, err.Error())
|
||||
return
|
||||
}
|
||||
sysNotification := &msg.NotificationMsg{
|
||||
|
@ -52,7 +52,7 @@ func SetPassword(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
}
|
||||
userID := utils.Md5(account)
|
||||
userID := utils.Base64Encode(account)
|
||||
url := config.Config.Demo.ImAPIURL + "/auth/user_register"
|
||||
openIMRegisterReq := api.UserRegisterReq{}
|
||||
openIMRegisterReq.OperationID = params.OperationID
|
||||
|
12
pkg/utils/base64.go
Normal file
12
pkg/utils/base64.go
Normal file
@ -0,0 +1,12 @@
|
||||
package utils
|
||||
|
||||
import "encoding/base64"
|
||||
|
||||
func Base64Encode(data string) string {
|
||||
return base64.StdEncoding.EncodeToString([]byte(data))
|
||||
}
|
||||
|
||||
func Base64Decode(data string) string {
|
||||
decodedByte, _ := base64.StdEncoding.DecodeString(data)
|
||||
return string(decodedByte)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user