code兑换
This commit is contained in:
@@ -41,10 +41,11 @@ class Wechat
|
||||
* @Date : 2022/9/9 11:29
|
||||
* @Author : <Jason.C>
|
||||
*/
|
||||
public function callback()
|
||||
public function code()
|
||||
{
|
||||
$code = $GLOBALS['data']['data']['code'];
|
||||
$this->initWechat();
|
||||
$user = $this->app->oauth->user();
|
||||
$user = $this->app->oauth->userFromCode($code);
|
||||
// $user 可以用的方法:
|
||||
// $user->getId(); // 对应微信的 OPENID
|
||||
// $user->getNickname(); // 对应微信的 nickname
|
||||
|
||||
Reference in New Issue
Block a user