正在显示
5 个修改的文件
包含
19 行增加
和
6 行删除
@@ -178,7 +178,8 @@ func CheckToken(ctx *context.Context) (result bool) { | @@ -178,7 +178,8 @@ func CheckToken(ctx *context.Context) (result bool) { | ||
178 | if token == "" { | 178 | if token == "" { |
179 | if strings.HasSuffix(ctx.Request.RequestURI, "loginModule") || | 179 | if strings.HasSuffix(ctx.Request.RequestURI, "loginModule") || |
180 | strings.HasSuffix(ctx.Request.RequestURI, "accessToken") || | 180 | strings.HasSuffix(ctx.Request.RequestURI, "accessToken") || |
181 | - strings.HasSuffix(ctx.Request.RequestURI, "refreshToken") { | 181 | + strings.HasSuffix(ctx.Request.RequestURI, "refreshToken") || |
182 | + strings.HasSuffix(ctx.Request.RequestURI, "smsCode") { | ||
182 | return true | 183 | return true |
183 | } | 184 | } |
184 | } | 185 | } |
@@ -46,8 +46,8 @@ type UCenterGetUserResponse struct { | @@ -46,8 +46,8 @@ type UCenterGetUserResponse struct { | ||
46 | NickName string `json:"nickname"` | 46 | NickName string `json:"nickname"` |
47 | Avatar string `json:"avatar"` | 47 | Avatar string `json:"avatar"` |
48 | ImToken string `json:"imtoken"` | 48 | ImToken string `json:"imtoken"` |
49 | - Accid int64 `json:"accid"` | ||
50 | - CustomerAccount int64 `json:"customerAccount"` | 49 | + Accid string `json:"accid"` |
50 | + CustomerAccount string `json:"customerAccount"` | ||
51 | } | 51 | } |
52 | 52 | ||
53 | /*修改用户信息 UCenterPutUser */ | 53 | /*修改用户信息 UCenterPutUser */ |
@@ -54,6 +54,13 @@ func RequestUserCenter(method string, httpMethod, request interface{}, rsponse i | @@ -54,6 +54,13 @@ func RequestUserCenter(method string, httpMethod, request interface{}, rsponse i | ||
54 | log.Error(err) | 54 | log.Error(err) |
55 | return | 55 | return |
56 | } | 56 | } |
57 | + var response string | ||
58 | + if len(data) > 500 { | ||
59 | + response = string(data[:200]) | ||
60 | + } else { | ||
61 | + response = string(data) | ||
62 | + } | ||
63 | + log.Debug("request ucenter:%v rsp:%v", url, response) | ||
57 | return | 64 | return |
58 | } | 65 | } |
59 | 66 |
@@ -106,11 +106,11 @@ Success: | @@ -106,11 +106,11 @@ Success: | ||
106 | userAuth.AuthCode = uid.NewV1().StringNoDash() | 106 | userAuth.AuthCode = uid.NewV1().StringNoDash() |
107 | 107 | ||
108 | /*更新用户信息*/ | 108 | /*更新用户信息*/ |
109 | - user.CsAccount = getUserResponse.CustomerAccount | 109 | + user.CsAccount, _ = strconv.ParseInt(getUserResponse.CustomerAccount, 10, 64) |
110 | user.ImToken = getUserResponse.ImToken | 110 | user.ImToken = getUserResponse.ImToken |
111 | user.Icon = getUserResponse.Avatar | 111 | user.Icon = getUserResponse.Avatar |
112 | user.NickName = getUserResponse.NickName | 112 | user.NickName = getUserResponse.NickName |
113 | - user.Accid = getUserResponse.Accid | 113 | + user.Accid, _ = strconv.ParseInt(getUserResponse.Accid, 10, 64) |
114 | user.UserCenterId = getUserResponse.Id | 114 | user.UserCenterId = getUserResponse.Id |
115 | if err = models.UpdateUsersById(user); err != nil { | 115 | if err = models.UpdateUsersById(user); err != nil { |
116 | log.Error(err) | 116 | log.Error(err) |
@@ -114,6 +114,9 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo | @@ -114,6 +114,9 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo | ||
114 | log.Error(err) | 114 | log.Error(err) |
115 | return | 115 | return |
116 | } | 116 | } |
117 | + } else { | ||
118 | + err = protocol.NewErrWithMessage(1) | ||
119 | + log.Error("用户中心获取数据失败: err_no:%v msg:%v", message.Errno, message.Errmsg) | ||
117 | } | 120 | } |
118 | if getUserResponse.Id != user.UserCenterId { | 121 | if getUserResponse.Id != user.UserCenterId { |
119 | err = protocol.NewErrWithMessage(1) | 122 | err = protocol.NewErrWithMessage(1) |
@@ -169,8 +172,10 @@ func ChangePassword(header *protocol.RequestHeader, request *protocol.ChangePass | @@ -169,8 +172,10 @@ func ChangePassword(header *protocol.RequestHeader, request *protocol.ChangePass | ||
169 | } else { | 172 | } else { |
170 | if message.Errno == -1 { | 173 | if message.Errno == -1 { |
171 | err = protocol.NewErrWithMessage(2028) | 174 | err = protocol.NewErrWithMessage(2028) |
175 | + } else { | ||
176 | + err = protocol.NewErrWithMessage(2028) | ||
172 | } | 177 | } |
173 | - log.Debug(fmt.Sprintf("修改密码 simnum:%v ucenter_id:%v pwd:%v", user.Phone, user.UserCenterId), message.Errno, message.Errmsg) | 178 | + log.Debug(fmt.Sprintf("修改密码 simnum:%v ucenter_id:%v pwd:%v", user.Phone, user.UserCenterId, request.NewPwd), message.Errno, message.Errmsg) |
174 | return | 179 | return |
175 | } | 180 | } |
176 | return | 181 | return |
-
请 注册 或 登录 后发表评论