File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 77
88namespace xutl \wechat ;
99
10+ use xutl \wechat \oauth \MiniOAuth ;
1011use Yii ;
1112use yii \di \Instance ;
1213use yii \caching \Cache ;
2627 * Class Wechat
2728 * @property OAuth $oauth 公众平台
2829 * @property OAuth $openOAuth 开放平台
29- * @property OAuth $miniProgram 小程序平台
30+ * @property MiniOAuth $miniProgram 小程序平台
3031 * @property AccessToken $accessToken
3132 * @property Js $js
3233 * @property Notice $notice
Original file line number Diff line number Diff line change 77
88namespace xutl \wechat \oauth ;
99
10- use Yii ;
11- use yii \authclient \OAuth2 ;
12- use yii \web \HttpException ;
10+ use xutl \authclient \WeChat ;
1311
1412/**
1513 * 微信小程序定制
1614 * @package xutl\wechat\oauth
1715 */
18- class MiniOAuth extends OAuth2
16+ class MiniOAuth extends WeChat
1917{
2018 /**
2119 * @inheritdoc
@@ -27,6 +25,8 @@ class MiniOAuth extends OAuth2
2725 */
2826 public $ useOpenId = true ;
2927
28+ private $ userParams = [];
29+
3030 /**
3131 * 获取Token
3232 * @param string $authCode
@@ -51,6 +51,7 @@ public function fetchAccessToken($authCode, array $params = [])
5151 $ response = $ this ->sendRequest ($ request );
5252
5353 $ token = $ this ->createToken (['params ' => $ response ]);
54+ $ this ->userParams = $ response ;
5455 $ this ->setAccessToken ($ token );
5556
5657 return $ token ;
@@ -83,6 +84,6 @@ protected function defaultNormalizeUserAttributeMap()
8384 */
8485 protected function initUserAttributes ()
8586 {
86- return [] ;
87+ return $ this -> userParams ;
8788 }
8889}
You can’t perform that action at this time.
0 commit comments