作者 yangfu

用户中心修改

... ... @@ -178,7 +178,8 @@ func CheckToken(ctx *context.Context) (result bool) {
if token == "" {
if strings.HasSuffix(ctx.Request.RequestURI, "loginModule") ||
strings.HasSuffix(ctx.Request.RequestURI, "accessToken") ||
strings.HasSuffix(ctx.Request.RequestURI, "refreshToken") {
strings.HasSuffix(ctx.Request.RequestURI, "refreshToken") ||
strings.HasSuffix(ctx.Request.RequestURI, "smsCode") {
return true
}
}
... ...
... ... @@ -46,8 +46,8 @@ type UCenterGetUserResponse struct {
NickName string `json:"nickname"`
Avatar string `json:"avatar"`
ImToken string `json:"imtoken"`
Accid int64 `json:"accid"`
CustomerAccount int64 `json:"customerAccount"`
Accid string `json:"accid"`
CustomerAccount string `json:"customerAccount"`
}
/*修改用户信息 UCenterPutUser */
... ...
... ... @@ -54,6 +54,13 @@ func RequestUserCenter(method string, httpMethod, request interface{}, rsponse i
log.Error(err)
return
}
var response string
if len(data) > 500 {
response = string(data[:200])
} else {
response = string(data)
}
log.Debug("request ucenter:%v rsp:%v", url, response)
return
}
... ...
... ... @@ -106,11 +106,11 @@ Success:
userAuth.AuthCode = uid.NewV1().StringNoDash()
/*更新用户信息*/
user.CsAccount = getUserResponse.CustomerAccount
user.CsAccount, _ = strconv.ParseInt(getUserResponse.CustomerAccount, 10, 64)
user.ImToken = getUserResponse.ImToken
user.Icon = getUserResponse.Avatar
user.NickName = getUserResponse.NickName
user.Accid = getUserResponse.Accid
user.Accid, _ = strconv.ParseInt(getUserResponse.Accid, 10, 64)
user.UserCenterId = getUserResponse.Id
if err = models.UpdateUsersById(user); err != nil {
log.Error(err)
... ...
... ... @@ -114,6 +114,9 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo
log.Error(err)
return
}
} else {
err = protocol.NewErrWithMessage(1)
log.Error("用户中心获取数据失败: err_no:%v msg:%v", message.Errno, message.Errmsg)
}
if getUserResponse.Id != user.UserCenterId {
err = protocol.NewErrWithMessage(1)
... ... @@ -169,8 +172,10 @@ func ChangePassword(header *protocol.RequestHeader, request *protocol.ChangePass
} else {
if message.Errno == -1 {
err = protocol.NewErrWithMessage(2028)
} else {
err = protocol.NewErrWithMessage(2028)
}
log.Debug(fmt.Sprintf("修改密码 simnum:%v ucenter_id:%v pwd:%v", user.Phone, user.UserCenterId), message.Errno, message.Errmsg)
log.Debug(fmt.Sprintf("修改密码 simnum:%v ucenter_id:%v pwd:%v", user.Phone, user.UserCenterId, request.NewPwd), message.Errno, message.Errmsg)
return
}
return
... ...