2017 © Pedro Peláez
 

library ucclient

uc_client for Laravel5, Based on MyController/ucclient

image

tao2581/ucclient

uc_client for Laravel5, Based on MyController/ucclient

  • Thursday, January 11, 2018
  • by tao2581
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

UCClient for Laravel5

本项目基于 MyController/ucclient 做了一点儿微小的升级,感谢 wehnhew !, (*1)

增加注册账号时同步额外用户属性

  • role 用户角色
  • domain_user 域用户名
  • meta json 格式自定义信息 如: {student_number: 1002} 学号

安装

shell composer require mycontroller/ucclient, (*2)

配置

/config/app.php 文件中找到 providers 键,, (*3)

shell 'providers' => [ ... MyController\UCClient\UCenterService\UCenterServiceProvider::class, ... ];, (*4)

/config/app.php 文件中找到 aliases 键,, (*5)

shell 'aliases' => [ ... 'UCClient' => MyController\UCClient\Facades\UCClientFacade::class, ... ];, (*6)

如果想自定义配置, 可以运行以下命令将配置文件复制到 /config/uc-client.php , 之后就可以方便的自定义了, (*7)

shell php artisan config:publish, (*8)

使用

例如:获取用户名为wen的信息 shell $result = UCClient::execute('uc_get_user',['wen']); dd($result);, (*9)

关于SSO登录注销

您需要自己实现 UCenterSSOContract 接口, 并将 UCenterSSOContract的具体实现类 绑定至 UCenterSSOContract 接口。, (*10)

例如可以实现: ```shell <?php, (*11)

namespace App;, (*12)

use MyController\UCClient\Contracts\UCenterSSOContract;, (*13)

class MyUCenterSSO implements UCenterSSOContract { public function synLogin($uid, $username = '') { /** 同步登录代码 **/ }, (*14)

 public function synLogout()
 {
     /** 同步注销代码 **/
 }

} ```, (*15)

然后在 App\Providers\AppServiceProvider 的 register方法 里增加: shell $this->app->bind( \MyController\UCClient\Contracts\UCenterSSOContract::class, \App\MyUCenterSSO::class );, (*16)

避免开启了 barryvdh/laravel-debugbar 插件后影响 UCenterAPI 的输出结果

您需要自己实现 UCenterAPIExecuteFilterContract 接口, 并将 UCenterAPIExecuteFilterContract的具体实现类 绑定至 UCenterAPIExecuteFilterContract 接口。, (*17)

例如可以实现: ```shell <?php, (*18)

namespace App;, (*19)

use MyController\UCClient\Contracts\UCenterAPIExecuteFilterContract;, (*20)

class MyUCenterAPIExecuteFilter implements UCenterAPIExecuteFilterContract { public function beforeRun() { // }, (*21)

 public function afterRun()
 {
     //
     \Debugbar::disable(); //Runtime 关闭 debugbar
 }

} ```, (*22)

然后在 App\Providers\AppServiceProvider 的 register方法 里增加: shell $this->app->bind( \MyController\UCClient\Contracts\UCenterAPIExecuteFilterContract::class, \App\MyUCenterAPIExecuteFilter::class );, (*23)

License

MIT, (*24)

The Versions

11/01 2018

dev-master

9999999-dev https://github.com/mycontroller/ucclient

uc_client for Laravel5, Based on MyController/ucclient

  Sources   Download

MIT

The Requires

 

by wehnhew, MyController

laravel5 ucenter uc_client

01/11 2017

1.0.4

1.0.4.0 https://github.com/mycontroller/ucclient

uc_client for Laravel5, Based on MyController/ucclient

  Sources   Download

MIT

The Requires

 

by wehnhew, MyController

laravel5 ucenter uc_client

09/12 2016

dev-dev

dev-dev https://github.com/mycontroller/ucclient

uc_client for Laravel5, Based on wehnhew/laravel4-ucenter

  Sources   Download

MIT

The Requires

 

by wehnhew, MyController

laravel5 ucenter uc_client

09/12 2016

1.0.3

1.0.3.0 https://github.com/mycontroller/ucclient

uc_client for Laravel5, Based on wehnhew/laravel4-ucenter

  Sources   Download

MIT

The Requires

 

by wehnhew, MyController

laravel5 ucenter uc_client

01/11 2016

1.0.2

1.0.2.0 https://github.com/mycontroller/ucclient

uc_client for Laravel5, Based on wehnhew/laravel4-ucenter

  Sources   Download

MIT

The Requires

 

by wehnhew, MyController

laravel5 ucenter uc_client

20/10 2016

1.0.1

1.0.1.0 https://github.com/mycontroller/ucclient

uc_client for Laravel5, Based on wehnhew/laravel4-ucenter

  Sources   Download

MIT

The Requires

 

by wehnhew, MyController

laravel5 ucenter uc_client

03/09 2016

1.0.0

1.0.0.0 https://github.com/mycontroller/ucclient

uc_client for Laravel5, Based on wehnhew/laravel4-ucenter

  Sources   Download

MIT

The Requires

 

by wehnhew, MyController

laravel5 ucenter uc_client