wechat_kit icon indicating copy to clipboard operation
wechat_kit copied to clipboard

微信授权不走回调

Open 995996812 opened this issue 3 years ago • 4 comments

_wechatLogin = _wechat.authResp().listen(listenWechatLogin);

995996812 avatar Nov 12 '21 10:11 995996812

void listenWechatLogin(WechatAuthResp value) { print('微信登录: $value'); if (value.errorCode == WechatSdkResp.ERRORCODE_SUCCESS) { _wechat .getAccessTokenUnionID( appId: Constant.kWechatAppID, appSecret: Constant.kWechatAppSecret, code: value.code, ) .then((WechatAccessTokenResp accessTokenResp) { if (accessTokenResp.errcode == WechatApiResp.ERRORCODE_SUCCESS) { _wechatLoginResp.sink.add(accessTokenResp); } }); } }

995996812 avatar Nov 12 '21 10:11 995996812

Future wechatLogin() async { print('微信登录'); _wechat.auth( scope: <String>[WechatScope.SNSAPI_USERINFO], state: 'auth', ); }

995996812 avatar Nov 12 '21 10:11 995996812

void listenWechatLogin(WechatAuthResp value) { print('微信登录: $value'); if (value.errorCode == WechatSdkResp.ERRORCODE_SUCCESS) { _wechat .getAccessTokenUnionID( appId: Constant.kWechatAppID, appSecret: Constant.kWechatAppSecret, code: value.code, ) .then((WechatAccessTokenResp accessTokenResp) { if (accessTokenResp.errcode == WechatApiResp.ERRORCODE_SUCCESS) { _wechatLoginResp.sink.add(accessTokenResp); } }); } }

_wechatLogin = _wechat.authResp().listen(listenWechatLogin);

我也遇到了这个问题,你解决了吗?

lilySkt avatar Nov 25 '21 14:11 lilySkt

同上,遇到了这个问题,请问你们后来怎么解决的 @lilySkt @995996812

danglu999 avatar Feb 13 '23 01:02 danglu999