base64 userID

pull/236/head
wangchuxiao 3 years ago
parent e95f09191a
commit fdaf4380fa

@ -209,6 +209,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{

@ -53,7 +53,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