...
|
...
|
@@ -119,10 +119,14 @@ func (c WxClientLogin) PhonePasswordLogin(phone string, password string) (*domai |
|
|
|
|
|
func (c WxClientLogin) PhoneSmsCodeLogin(phone string, code string) (*domain.LoginInfo, error) {
|
|
|
var (
|
|
|
users []*domain.User
|
|
|
err error
|
|
|
users []*domain.User
|
|
|
err error
|
|
|
skipCheckSmsCode bool = false
|
|
|
)
|
|
|
if _, err = c.l.svcCtx.SmsService.CheckSmsCode(c.l.ctx, smslib.RequestCheckSmsCode{Phone: phone, Code: code}); err != nil {
|
|
|
if c.l.svcCtx.Config.DebugSmsCode != "" && c.l.svcCtx.Config.DebugSmsCode == code {
|
|
|
skipCheckSmsCode = true
|
|
|
}
|
|
|
if _, err = c.l.svcCtx.SmsService.CheckSmsCode(c.l.ctx, smslib.RequestCheckSmsCode{Phone: phone, Code: code}); err != nil && !skipCheckSmsCode {
|
|
|
return nil, xerr.NewErrMsgErr(err.Error(), err)
|
|
|
}
|
|
|
conn := c.l.svcCtx.DefaultDBConn()
|
...
|
...
|
|