PHP code example of zhoufanqq / sso-client

1. Go to this page and download the library: Download zhoufanqq/sso-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zhoufanqq / sso-client example snippets


  'providers' => [

    /*
     * Application Service Providers...
     */
       App\Providers\AppServiceProvider::class,
       App\Providers\AuthServiceProvider::class,
       App\Providers\EventServiceProvider::class,
       App\Providers\RouteServiceProvider::class,
    // ...

    // 添加 FIS 的 Provider
    zhoufanqq\ssoClient\ssoClientServiceProvider::class,

  ],
  
  

  'aliases' => [

    'View' => Illuminate\Support\Facades\View::class,
    'Curl' => Ixudra\Curl\Facades\Curl::class,

    // ...

    
    'ssoClient' => zhoufanqq\ssoClient\Facades\ssoClient::class,
  ],
  
 php
     use ssoClient;
     
        /**
         * Handle an incoming request.
         *
         * @param  \Illuminate\Http\Request  $request
         * @param  \Closure  $next
         * @return mixed
         */
        public function handle($request, Closure $next)
        {
            if (!ssoClient::isLogin()) {
                return redirect('login-path');
            }
            return $next($request);
        }