diff --git a/internal/application/auth/service.go b/internal/application/auth/service.go index 72f4725..e1a9ace 100644 --- a/internal/application/auth/service.go +++ b/internal/application/auth/service.go @@ -42,6 +42,7 @@ func (a *AuthService) LoginByCaptcha(phone, openid string) (string, error) { } token, err := a.auth.LoginByCaptcha(ePhone, openid) if err != nil { + a.log.Error(err) return "", err } return token, nil diff --git a/internal/infrastructure/persistence/auth/auth_repo.go b/internal/infrastructure/persistence/auth/auth_repo.go index 1aaeec7..ddf79ee 100644 --- a/internal/infrastructure/persistence/auth/auth_repo.go +++ b/internal/infrastructure/persistence/auth/auth_repo.go @@ -73,7 +73,8 @@ func (a AuthRepositoryORM) LoginByCaptcha(phone, openid string) (string, error) } if u.Openid != openid { - return "", errors.New(fmt.Sprintf("openid和手机号不匹配,[%s]-[%s]", phone, openid)) + a.log.Errorf("openid和手机号不匹配,[%s]-[%s]", phone, openid) + return "", errors.New("不支持换机登录") } if u.Status == 0 { diff --git a/ui/src/app/app.component.ts b/ui/src/app/app.component.ts index 434ee64..9ee1354 100644 --- a/ui/src/app/app.component.ts +++ b/ui/src/app/app.component.ts @@ -50,9 +50,9 @@ export class AppComponent implements OnInit { } else { // 如果都没有token,重定向到获取token的页面 console.log("需要获取token,重定向到授权页面"); - window.location.href = "http://famyun.com/callback_test"; + // window.location.href = "http://famyun.com/callback_test"; // 生产环境使用微信授权 - // window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx13bd75fbedf283e5&redirect_uri=http%3A%2F%2Ffamyun.com%2Fcallback&response_type=code&scope=snsapi_base&state=123#wechat_redirect"; + window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx13bd75fbedf283e5&redirect_uri=http%3A%2F%2Ffamyun.com%2Fcallback&response_type=code&scope=snsapi_base&state=123#wechat_redirect"; } } });