mirror of
https://github.com/w7corp/easywechat.git
synced 2025-01-22 11:32:08 +00:00
Updated 网页授权 (markdown)
parent
2ba293f62f
commit
e75c243d24
6
网页授权.md
6
网页授权.md
@ -106,11 +106,13 @@ $auth->authorize($to = null, $scope = 'snsapi_userinfo', $state = 'STATE')
|
||||
// 请一定要自己存储用户的登录信息,不要每次都授权
|
||||
if (empty($_SESSION['logged_user'])) {
|
||||
$user = $auth->authorize(); // 返回用户 Bag
|
||||
$_SESSION['logged_user'] = $user;
|
||||
$_SESSION['logged_user'] = $user->all();
|
||||
// 跳转到其它授权才能访问的页面
|
||||
} else {
|
||||
$user = $_SESSION['logged_user'];
|
||||
}
|
||||
|
||||
var_dump($_SESSION['logged_user']);
|
||||
var_dump($user['openid']);
|
||||
```
|
||||
|
||||
如果你不想用默认的逻辑,你也可以自己使用下面单独的方法来完成授权的操作:
|
||||
|
Loading…
Reference in New Issue
Block a user