|
|
@@ -2,6 +2,7 @@ package auth
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
+ "errors"
|
|
|
"fmt"
|
|
|
"time"
|
|
|
|
|
|
@@ -125,6 +126,9 @@ func (l *LoginByWeixinLogic) Login(code string) (*types.WXUserInfo, error) {
|
|
|
|
|
|
var res types.WXLoginResponse
|
|
|
req.ToJSON(&res)
|
|
|
+ if res.ErrCode != 0 {
|
|
|
+ return nil, errors.New(res.ErrMsg)
|
|
|
+ }
|
|
|
userinfo, err := l.DecryptUserInfoData(res.SessionKey)
|
|
|
userinfo.OpenID = res.OpenID
|
|
|
userinfo.SessionKey = res.SessionKey
|