base64 userID

pull/455/head
wangchuxiao 2 years ago committed by Xinwei Xiong(cubxxw-openim)
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

@ -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…
Cancel
Save