mayunfeng / yii2-insideapi
insideapi for yii2
Installs: 79
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- mayunfeng/insideapi: ^3.10.6
- yiisoft/yii2: ^2.0
- yiisoft/yii2-redis: ^2.0
README
安装
composer require mayunfeng/yii2-insideapi
配置
在 config/main.php
中添加配置component
:
'components' => [ // ... 'insideapi' => [ 'class' => 'mayunfeng\EasyApi\EasyApi' 'config' => [] ], // ... ]
使用
1.登录
$model = new UserLogon([ 'phone' => 'phone', 'password' => 'password', 'type' => 200, ]); if ($model->logon()) { echo '登录成功'; } else { echo '登录失败'; }
2.调用api
$easyApi = Yii::$pp->easyApi; $easyApi->user->info()