PHP code example of ezijing / ezijing-permission-plugins

1. Go to this page and download the library: Download ezijing/ezijing-permission-plugins 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/ */

    

ezijing / ezijing-permission-plugins example snippets




declare(strict_types=1);

return [
    'HOST' => env('PERMISSION_HOST', ''),
    'SECRET_ID' => env('PERMISSION_SECRET_ID', ''),
    'SECRET_KEY' => env('PERMISSION_SECRET_KEY', ''),
    'API' => [
        'ROUTES' => [
            'METHOD' => 'GET',
            'API' => '/api/v1/user/routes',
            'DESC' => '获取当前登录用户所有被允许访问的路由(后端使用,调用是强制Cookie写入TGC)',
        ],
    ],
];



declare(strict_types=1);

namespace App\Controller\Admin\V3\System;

use App\Controller\BaseController;
use Ezijing\PermissionPlugins\Middlewares\PermissionMiddleware;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\HttpServer\Annotation\Middlewares;

/**
 * 使用手册管理.
 *
 * @Controller(prefix="admin/v3/system")
 * @Middlewares({
 *     @Middleware(PermissionMiddleware::class)
 * })
 *
 */
class UserManualController extends BaseController
{}
shell
>  php bin/hyperf.php vendor:publish ezijing/ezijing-permission-plugins