PHP code example of cncoders / thinkphp-auth
1. Go to this page and download the library: Download cncoders/thinkphp-auth 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/ */
cncoders / thinkphp-auth example snippets
use \think\facade\Route;
// 获取当前请求的版本号
$version = \think\facade\Request::header('version');
//实例化auth-api
$router = new \cncoders\auth\Router($version);
#包含的路由文件 必须放到非route目录下 可以市下面的其他目录内 会与TP内置的route冲突
$router->allows(['[<]1.0.0'])->