|
@@ -73,7 +73,8 @@ func (l *loginAuth) AuthCode(ctx context.Context, phone string, code string) (st
|
|
if err != nil {
|
|
if err != nil {
|
|
return "", err
|
|
return "", err
|
|
}
|
|
}
|
|
- if *vcode != code {
|
|
|
|
|
|
+ fmt.Printf("缓存的验证码 vcode: %v,实际填入的 code:%v", vcode, code)
|
|
|
|
+ if vcode != code {
|
|
// 验证码错误
|
|
// 验证码错误
|
|
logrus.Debugf("[AuthCode] auth fail,phone:%+v", phone)
|
|
logrus.Debugf("[AuthCode] auth fail,phone:%+v", phone)
|
|
return "验证码有误", errors.New("auth fail")
|
|
return "验证码有误", errors.New("auth fail")
|
|
@@ -140,15 +141,15 @@ func (l *loginAuth) setSession(ctx context.Context, phone string, auth *redis_mo
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
-func (l *loginAuth) getSessionCode(ctx context.Context, phone string) (*string, error) {
|
|
|
|
|
|
+func (l *loginAuth) getSessionCode(ctx context.Context, phone string) (string, error) {
|
|
value, err := redis.Get(ctx, l.getRedisKey(phone))
|
|
value, err := redis.Get(ctx, l.getRedisKey(phone))
|
|
if err != nil {
|
|
if err != nil {
|
|
if err == consts.RedisNil {
|
|
if err == consts.RedisNil {
|
|
- return nil, fmt.Errorf("not found in redis,phone:%+v", phone)
|
|
|
|
|
|
+ return "", fmt.Errorf("not found in redis,phone:%+v", phone)
|
|
}
|
|
}
|
|
- return nil, err
|
|
|
|
|
|
+ return "", err
|
|
}
|
|
}
|
|
- return &value, nil
|
|
|
|
|
|
+ return value, nil
|
|
}
|
|
}
|
|
|
|
|
|
func (l *loginAuth) getSessionAuth(ctx context.Context, phone string) (*redis_model.Auth, error) {
|
|
func (l *loginAuth) getSessionAuth(ctx context.Context, phone string) (*redis_model.Auth, error) {
|