fix err
This commit is contained in:
parent
72fb221d1f
commit
c1eab396ac
@ -65,6 +65,17 @@ func (l *BindMobileLogic) BindMobile(req *types.BindMobileReq) (resp *types.Bind
|
|||||||
// 进行平台绑定
|
// 进行平台绑定
|
||||||
if claims != nil {
|
if claims != nil {
|
||||||
if claims.UserType == model.UserTypeTemp {
|
if claims.UserType == model.UserTypeTemp {
|
||||||
|
userTemp, err := l.svcCtx.UserTempModel.FindOne(l.ctx, claims.UserId)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "绑定手机号, 读取临时用户失败: %v", err)
|
||||||
|
}
|
||||||
|
userAuth, err := l.svcCtx.UserAuthModel.FindOneByUserIdAuthType(l.ctx, user.Id, userTemp.AuthType)
|
||||||
|
if err != nil && !errors.Is(err, model.ErrNotFound) {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "绑定手机号, 读取用户认证失败: %v", err)
|
||||||
|
}
|
||||||
|
if userAuth != nil && userAuth.AuthKey != userTemp.AuthKey {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("该手机号已绑定其他微信号"), "绑定手机号, 临时用户已注册: %s", encryptedMobile)
|
||||||
|
}
|
||||||
err = l.svcCtx.UserService.TempUserBindUser(l.ctx, nil, user.Id)
|
err = l.svcCtx.UserService.TempUserBindUser(l.ctx, nil, user.Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "绑定手机号, 临时用户绑定用户失败: %+v", err)
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "绑定手机号, 临时用户绑定用户失败: %+v", err)
|
||||||
|
@ -303,6 +303,10 @@ func initServices(c config.Config, userAuthModel model.UserAuthModel, westDexSer
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
Concurrency: 10,
|
Concurrency: 10,
|
||||||
|
Queues: map[string]int{
|
||||||
|
"default": 10,
|
||||||
|
"agent_balance": 6,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,11 +5,11 @@ var message map[uint32]string
|
|||||||
func init() {
|
func init() {
|
||||||
message = make(map[uint32]string)
|
message = make(map[uint32]string)
|
||||||
message[OK] = "SUCCESS"
|
message[OK] = "SUCCESS"
|
||||||
message[SERVER_COMMON_ERROR] = "服务器开小差啦,稍后再来试一试"
|
message[SERVER_COMMON_ERROR] = "系统正在升级,请稍后再试"
|
||||||
message[REUQEST_PARAM_ERROR] = "参数错误"
|
message[REUQEST_PARAM_ERROR] = "参数错误"
|
||||||
message[TOKEN_EXPIRE_ERROR] = "token失效,请重新登陆"
|
message[TOKEN_EXPIRE_ERROR] = "token失效,请重新登陆"
|
||||||
message[TOKEN_GENERATE_ERROR] = "生成token失败"
|
message[TOKEN_GENERATE_ERROR] = "生成token失败"
|
||||||
message[DB_ERROR] = "数据库繁忙,请稍后再试"
|
message[DB_ERROR] = "系统维护升级中,请稍后再试"
|
||||||
message[DB_UPDATE_AFFECTED_ZERO_ERROR] = "更新数据影响行数为0"
|
message[DB_UPDATE_AFFECTED_ZERO_ERROR] = "更新数据影响行数为0"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ func MapErrMsg(errcode uint32) string {
|
|||||||
if msg, ok := message[errcode]; ok {
|
if msg, ok := message[errcode]; ok {
|
||||||
return msg
|
return msg
|
||||||
} else {
|
} else {
|
||||||
return "服务器开小差啦,稍后再来试一试"
|
return "系统正在升级,请稍后再试"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
func TestAesEcbMobileEncryption(t *testing.T) {
|
func TestAesEcbMobileEncryption(t *testing.T) {
|
||||||
// 测试手机号加密
|
// 测试手机号加密
|
||||||
mobile := "18680618651"
|
mobile := "18653052547"
|
||||||
|
|
||||||
keyStr := "ff83609b2b24fc73196aac3d3dfb874f"
|
keyStr := "ff83609b2b24fc73196aac3d3dfb874f"
|
||||||
// 测试加密
|
// 测试加密
|
||||||
|
Loading…
Reference in New Issue
Block a user