【文件属性】:
文件名称:用户
文件大小:14KB
文件格式:ZIP
更新时间:2021-02-25 02:09:02
identity user yii3 PHP
Yii用户
该软件包处理与用户相关的功能:
登录和注销。
获取当前登录身份。
更改当前身份。
当前用户的访问检查。
根据请求cookie自动登录或“记住我”。
要求
PHP 7.4或更高版本。
安装
该软件包可以与composer一起安装:
composer require yiisoft/user --prefer-dist
一般用法
使用身份
...
自动登录
为了根据请求cookie的存在自动登录用户,请使用AutoLoginMiddleware 。
默认情况下,您应该在用户登录后在应用程序中手动设置cookie以自动登录:
public function login (
\ Psr \ Http \ Message \ ServerRequestInterface $ request ,
\ Psr \ Http \ Message \ Respo
【文件预览】:
user-master
----composer.json(2KB)
----config()
--------params.php(284B)
--------web.php(742B)
----src()
--------UserAuth.php(1KB)
--------Event()
--------AutoLoginMiddleware.php(4KB)
--------AutoLogin.php(2KB)
--------GuestIdentity.php(224B)
--------CurrentUser.php(10KB)
--------AutoLoginIdentityInterface.php(2KB)
----psalm.xml(444B)
----.phpunit-watcher.yml(200B)
----LICENSE.md(1KB)
----CHANGELOG.md(66B)
----.styleci.yml(2KB)
----README.md(3KB)
----infection.json.dist(244B)