https://github.com/leegoway/yii2-uic
user center extension for Yii2 framework
https://github.com/leegoway/yii2-uic
uic yii2-framework yii2-uic
Last synced: 15 days ago
JSON representation
user center extension for Yii2 framework
- Host: GitHub
- URL: https://github.com/leegoway/yii2-uic
- Owner: leegoway
- License: bsd-3-clause
- Created: 2016-10-25T02:40:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-06T02:28:10.000Z (about 8 years ago)
- Last Synced: 2025-02-16T18:18:24.481Z (3 months ago)
- Topics: uic, yii2-framework, yii2-uic
- Language: PHP
- Size: 14.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yii2-uic
User center extension for Yii2 framework
包含功能:
* [登录] 接入用户中心的单点登录
* [权限校验] 接入用户中心的权限校验## Installation
The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/daixianceng/yii2-uic/blob/master/composer.json) for this extension's requirements and dependencies.To install, either run
```
$ php composer.phar require leegoway/yii2-uic "*"
```or add
```
"leegoway/yii2-uic": "*"
```to the ```require``` section of your `composer.json` file.
## Usage
```php
return [
'components' => [
'uicAuther' => [
'class' => 'leegoway\uic\Auther',
'domain' => 'autops.corp.elong.com',//cookie的domain属性
'path' => '/',//cookie的路径
'expire' => 7200 //超时时间
]
],
];
```then in your controller which need auth, then add the following code:
```php
use leegoway\uic\UicAuthFacade;...
use UicAuthFacade;```
Secondly, you can check permission like the following code:
```php
Yii::$app->uicAuther->checkPermission($permissionId, $organizationId, [$username]); //$username default current login username
```