Commit 95b68a5b authored by hangjun83's avatar hangjun83

openapi 震坤行

parent 94d80aca
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace App\Providers\Auth;
use App\Repositories\Enums\CacheEnum;
use App\Support\Traits\Helpers;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Auth\Authenticatable as UserContract;
use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Str;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
class AdminUsersProvider implements UserProvider
{
use Helpers;
protected $model = null;
public function __construct($app, $model)
{
if(!$model instanceof \Illuminate\Database\Eloquent\Model){
$class = '\\'.ltrim($model, '\\');
$this->model = new $class;
}else{
$this->model = $model;
}
}
/**
* Retrieve a user by their unique identifier.
*
* @param mixed $identifier
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function retrieveById($identifier)
{
// 只做根据identifier的值做查询用户操作
$user = $this->model->newQuery()
->where($this->model->getAuthIdentifierName(), $identifier)
->first();
if($user->status === 0 ){
throw new AuthenticationException('用户已被禁用,请联系管理员.');
}
return $user;
/*return Cache::remember($cacheKey, $cacheExpireTime, function () use ($identifier) {
return $this->model->newQuery()
->where($this->model->getAuthIdentifierName(), $identifier)
->first();
});*/
}
/**
* Retrieve a user by the given credentials.
*
* @param array $credentials
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function retrieveByCredentials(array $credentials)
{
if (empty($credentials)) {
throw new UnauthorizedHttpException('auth params error','参数缺少',null,ResponseCodeEnum::CLIENT_PARAMETER_ERROR);
}
$query = $this->model->newQuery();
foreach ($credentials as $key => $value) {
if (Str::contains($key, 'password')) {
$value = $this->model->encryptPassword($value);
//continue;
}
if (is_array($value) || $value instanceof Arrayable) {
$query->whereIn($key, $value);
} else {
$query->where($key, $value);
}
}
return $query->first();
}
/**
* Validate a user against the given credentials.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param array $credentials
* @return bool
*/
public function validateCredentials(UserContract $user, array $credentials)
{
$encodePassword = $this->model->encryptPassword($credentials['password']);
if($encodePassword !== $user->password){
throw new AuthenticationException('用户登陆密码错误,请重新输入.');
}
if($user->status === 0 ){
throw new AuthenticationException('用户已被禁用,请联系管理员.');
}
return true;
}
/**
* Retrieve a user by their unique identifier and "remember me" token.
*
* @param mixed $identifier
* @param string $token
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function retrieveByToken($identifier, $token)
{
return null;
}
/**
* Update the "remember me" token for the given user in storage.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param string $token
* @return void
*/
public function updateRememberToken(UserContract $user, $token)
{
}
}
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace App\Providers;
use App\Repositories\Enums\PermissionEnum;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;
use App\Providers\Auth\AdminUsersProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* Boot the authentication services for the application.
*/
public function boot()
{
//Gate::before(PermissionEnum::gateBeforeCallback());
$this->app['auth']->provider('superadmin', function ($app, array $config) {
return new AdminUsersProvider($app, $config['model']);
});
}
}
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace App\Repositories\Criteria;
use Illuminate\Database\Eloquent\Builder;
use App\Repositories\Criteria\Criteria;
class UserCriteria extends Criteria
{
protected function condition(Builder $query): void
{
if ($name = $this->request->get('nickname')) {
$query->where('nickname', '=', $name);
}
if ($email = $this->request->get('email')) {
$query->where('email', 'like', "%$email%");
}
if ($username = $this->request->get('username')) {
$query->where('username', '=', $username);
}
}
}
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace App\Repositories\Models;
use App\Repositories\Enums\RoleEnum;
use Database\Factories\UserFactory;
use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Laravel\Lumen\Auth\Authorizable;
use Spatie\Permission\Traits\HasRoles;
use Tymon\JWTAuth\Contracts\JWTSubject;
class AdminUsers extends Model implements AuthenticatableContract, AuthorizableContract, JWTSubject
{
use Authenticatable, Authorizable, HasFactory, HasRoles;
protected $table = 'admin_users';
protected $guard_name = 'api';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'username', 'nickname', 'password', 'email', 'token', 'is_admin', 'status'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [
];
/**
* Get the identifier that will be stored in the subject claim of the JWT.
*
* @return mixed
*/
public function getJWTIdentifier()
{
return $this->getKey();
}
/**
* Return a key value array, containing any custom claims to be added to the JWT.
*
* @return array
*/
public function getJWTCustomClaims()
{
return [];
}
public function isSuperAdmin() : bool
{
return $this->is_admin === 1 ? true : false;
}
/**
* 是否是非法禁止使用的用户 status == 0
* @return bool
*/
public function isUnusualUser() : bool
{
return $this->status === 0 ? true : false;
}
public function isOwnerOf(\Illuminate\Database\Eloquent\Model $model, string $key = 'user_id'): bool
{
if ($model instanceof User) {
return $this->id === $model->id;
}
return $this->id === $model->$key;
}
public function encryptPassword($hash) : string
{
$str = base64_encode($hash);
$encodePassword = md5(md5($str));
return $encodePassword;
}
}
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace App\Repositories\Models;
class Menus extends Model
{
protected $table = 'menus';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'menu_name','title','menu_path','menu_icon','parent_id','menu_type','component','status','sort','is_show','sys_default','created_by'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [
];
}
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace App\Repositories\Transformers;
use App\Repositories\Enums\PermissionEnum;
use App\Repositories\Models\Post;
use Illuminate\Support\Str;
use League\Fractal\TransformerAbstract;
class PostTransformer extends TransformerAbstract
{
protected $defaultIncludes = [
'author',
];
public function transform(Post $post)
{
return [
'id' => $post->id,
'title' => $post->title,
'body' => $this->checkColumnPermission() ? $post->body : Str::limit($post->body, 120), // 没有文章详情查看权限时,返回截取的部分内容
'published' => $post->published,
];
}
protected function checkColumnPermission()
{
return auth('api')->user()->can(PermissionEnum::ROUTE_POSTS_VIEW()->name);
}
public function includeAuthor(Post $post)
{
$author = $post->author;
return $this->item($author, new UserTransformer());
}
}
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace App\Repositories\Transformers;
use App\Repositories\Enums\PermissionEnum;
use App\Repositories\Models\User;
use League\Fractal\TransformerAbstract;
class UserTransformer extends TransformerAbstract
{
public function transform(User $user)
{
$data = [
'id' => $user->id,
'nickname' => $user->name,
'email' => $user->email,
];
if (! $this->checkColumnPermission()) {
$data['email'] = '**** ****';
}
return $data;
}
protected function checkColumnPermission()
{
return auth('api')->user()->can(PermissionEnum::DATA_USERS_COLUMN_EMAIL()->name);
}
}
......@@ -36,14 +36,18 @@ class BjsApiService extends PlatformAbstractService
{
try{
if($this->checkPlatformStatus()){
$params = [];
$params['CASNumber'] = $this->mergeApiMetaData($product);
/*$params = [];
$params['CASNumber'] = $this->mergeApiMetaData($product);*/
$uri = $this->platformInfo['platform_url'].'/api/BJS/GetStockPriceDataThree';
$response = $this->getPostClient($uri,$params,null,[
'Client_id' => $this->platformInfo['platform_params']['Client_id'],
'Client_secret' => $this->platformInfo['platform_params']['Client_secret']
],false);
$uri = $this->platformInfo['platform_url'].'/api/BJS/GetStockPriceDataThree?CASNumber='.$this->mergeApiMetaData($product);
$response = $this->clientRequest('get',
$uri,[
'auth' => [
'Client_id' => $this->platformInfo['platform_params']['Client_id'],
'Client_secret' => $this->platformInfo['platform_params']['Client_secret']
]
]);
return $this->apiResponse($response);
}
......
......@@ -18,7 +18,7 @@ trait HttpClientHelpers
return $options;
}
protected function getPostClient($uri, $paramsBody = [], $auth = null, $header = null, $multipart = null, $json = true)
protected function getPostClient($uri, $paramsBody = [], $auth = null, $header = null, $json = true)
{
$options = [];
if($json) {
......@@ -31,13 +31,6 @@ trait HttpClientHelpers
$options['form_params'] = $paramsBody;
}
if(!is_null($multipart)){
$options['multipart'] = [
'name' => 'file',
'contents' => $multipart
];
}
if($auth && is_array($auth)){
$options['auth'] = $auth;
}
......
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => env('AUTH_GUARD', 'api'),
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "token"
|
*/
'guards' => [
'api' => [
'driver' => 'jwt',
'provider' => 'users', // 与下面的 providers 中的 users 是对应的
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'superadmin',
'model' => \App\Repositories\Models\AdminUsers::class,
],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| Here you may set the options for resetting passwords including the view
| that is your password reset e-mail. You may also set the name of the
| table that maintains all of the reset tokens for your application.
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'passwords' => [
],
];
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'encrypted' => true,
],
],
'redis' => [
'driver' => 'redis',
'connection' => env('BROADCAST_REDIS_CONNECTION', 'default'),
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Laravel CORS Options
|--------------------------------------------------------------------------
|
| The allowed_methods and allowed_headers options are case-insensitive.
|
| You don't need to provide both allowed_origins and allowed_origins_patterns.
| If one of the strings passed matches, it is considered a valid origin.
|
| If ['*'] is provided to allowed_methods, allowed_origins or allowed_headers
| all methods / origins / headers are allowed.
|
*/
/*
* You can enable CORS for 1 or multiple paths.
* Example: ['api/*']
*/
'paths' => ['adminapi/*'],
/*
* Matches the request method. `['*']` allows all methods.
*/
'allowed_methods' => ['*'],
/*
* Matches the request origin. `['*']` allows all origins. Wildcards can be used, eg `*.mydomain.com`
*/
'allowed_origins' => ['*'],
/*
* Patterns that can be used with `preg_match` to match the origin.
*/
'allowed_origins_patterns' => [],
/*
* Sets the Access-Control-Allow-Headers response header. `['*']` allows all headers.
*/
'allowed_headers' => ['*'],
/*
* Sets the Access-Control-Expose-Headers response header with these headers.
*/
'exposed_headers' => [],
/*
* Sets the Access-Control-Max-Age response header when > 0.
*/
'max_age' => 0,
/*
* Sets the Access-Control-Allow-Credentials header.
*/
'supports_credentials' => false,
];
\ No newline at end of file
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
return [
'command_job' => [
'integle' => [
'topic' => '',
'producer' => '',
'consumer' => '',
'datetime' => ''
],
'wuxi' => [
]
],
];
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
return [
'models' => [
/*
* When using the "HasPermissions" trait from this package, we need to know which
* Eloquent model should be used to retrieve your permissions. Of course, it
* is often just the "Permission" model but you may use whatever you like.
*
* The model you want to use as a Permission model needs to implement the
* `Spatie\Permission\Contracts\Permission` contract.
*/
'permission' => Spatie\Permission\Models\Permission::class,
/*
* When using the "HasRoles" trait from this package, we need to know which
* Eloquent model should be used to retrieve your roles. Of course, it
* is often just the "Role" model but you may use whatever you like.
*
* The model you want to use as a Role model needs to implement the
* `Spatie\Permission\Contracts\Role` contract.
*/
'role' => Spatie\Permission\Models\Role::class,
],
'table_names' => [
/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your roles. We have chosen a basic
* default value but you may easily change it to any table you like.
*/
'roles' => 'roles',
/*
* When using the "HasPermissions" trait from this package, we need to know which
* table should be used to retrieve your permissions. We have chosen a basic
* default value but you may easily change it to any table you like.
*/
'permissions' => 'permissions',
/*
* When using the "HasPermissions" trait from this package, we need to know which
* table should be used to retrieve your models permissions. We have chosen a
* basic default value but you may easily change it to any table you like.
*/
'model_has_permissions' => 'model_has_permissions',
/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your models roles. We have chosen a
* basic default value but you may easily change it to any table you like.
*/
'model_has_roles' => 'model_has_roles',
/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your roles permissions. We have chosen a
* basic default value but you may easily change it to any table you like.
*/
'role_has_permissions' => 'role_has_permissions',
],
'column_names' => [
/*
* Change this if you want to name the related model primary key other than
* `model_id`.
*
* For example, this would be nice if your primary keys are all UUIDs. In
* that case, name this `model_uuid`.
*/
'model_morph_key' => 'model_id',
],
/*
* When set to true, the required permission names are added to the exception
* message. This could be considered an information leak in some contexts, so
* the default setting is false here for optimum safety.
*/
'display_permission_in_exception' => true,
/*
* When set to true, the required role names are added to the exception
* message. This could be considered an information leak in some contexts, so
* the default setting is false here for optimum safety.
*/
'display_role_in_exception' => true,
/*
* By default wildcard permission lookups are disabled.
*/
'enable_wildcard_permission' => false,
'cache' => [
/*
* By default all permissions are cached for 24 hours to speed up performance.
* When permissions or roles are updated the cache is flushed automatically.
*/
'expiration_time' => \DateInterval::createFromDateString('24 hours'),
/*
* The cache key used to store all permissions.
*/
'key' => 'spatie.permission.cache',
/*
* When checking for a permission against a model by passing a Permission
* instance to the check, this key determines what attribute on the
* Permissions model is used to cache against.
*
* Ideally, this should match your preferred way of checking permissions, eg:
* `$user->can('view-posts')` would be 'name'.
*/
'model_key' => 'name',
/*
* You may optionally indicate a specific cache driver to use for permission and
* role caching using any of the `store` drivers listed in the cache.php config
* file. Using 'default' here means to use the `default` set in cache.php.
*/
'store' => 'default',
],
];
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => realpath(storage_path('framework/views')),
];
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$api->version('v1', function($api) {
$api->group(['namespace'=>'App\Http\Controllers\V1\Auth','middleware' => ['api.auth','permissions'], 'providers' => 'jwt'], function($api) {
//用户相关
$api->post('/adminapi/user/add', ['permission' => 'user.add', 'uses'=>'AuthUserController@addUser']);
$api->post('/adminapi/user/edit', ['permission' => 'user.edit', 'uses'=>'AuthUserController@editUser']);
$api->get('/adminapi/user/info', ['uses'=>'AuthUserController@info']);
$api->post('/adminapi/auth/resetPassword', ['permission' => 'user.reset_password', 'uses'=>'AuthUserController@resetPassword']);
$api->get('/adminapi/user/listByPage', ['permission' => 'user.list.*', 'uses'=>'AuthUserController@listByPage']);
$api->post('/adminapi/user/disable/{id}', ['permission' => 'user.edit.status', 'uses'=>'AuthUserController@changeUserStatus']);
$api->post('/adminapi/user/enable/{id}', ['permission' => 'user.edit.status', 'uses'=>'AuthUserController@changeUserStatus']);
$api->post('/adminapi/user/delByIds', ['permission' => 'user.del.ids', 'uses'=>'AuthUserController@delUserByIds']);
});
//用户登陆
$api->group(['namespace'=>'App\Http\Controllers\V1\Auth'], function($api) {
$api->post('/adminapi/auth/login', ['uses'=>'AuthUserController@login']);
});
//用户登出
$api->group(['namespace'=>'App\Http\Controllers\V1\Auth','middleware' => ['permissions']], function($api) {
$api->get('/adminapi/auth/logout', ['uses'=>'AuthUserController@logout']);
});
});
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$api->version('v1', function($api) {
$api->group(['namespace'=>'App\Http\Controllers\V1','middleware' => ['api.auth','permissions'], 'providers' => 'jwt'], function($api) {
//菜单相关
$api->get('/adminapi/permission/menu/userRoleMenuList', ['uses'=>'PermissionsController@getUserRoleMenuList']);
$api->post('/adminapi/permission/menu/edit', ['permission' => 'menu.permission.edit', 'uses'=>'PermissionsController@editMenus']);
$api->post('/adminapi/permission/menu/subAdd', ['permission' => 'menu.permission.add', 'uses'=>'PermissionsController@addSubMenus']);
$api->post('/adminapi/permission/menu/del', ['permission' => 'menu.permission.del','uses'=>'PermissionsController@deleteMenus']);
$api->get('/adminapi/permission/menu/all', ['permission' => 'menu.permission.list', 'uses'=>'PermissionsController@getAllMenuList']);
//角色相关
$api->get('/adminapi/permission/role/getAllByPage', ['permission' => 'role.permission.list.*', 'uses'=>'PermissionsController@getAllByPage']);
$api->get('/adminapi/permission/role/getAllList', ['permission' => 'role.permission.list.view', 'uses'=>'PermissionsController@getAllList']);
$api->post('/adminapi/permission/role/add', ['permission' => 'role.permission.add', 'uses'=>'PermissionsController@addRole']);
$api->post('/adminapi/permission/role/edit', ['permission' => 'role.permission.edit', 'uses'=>'PermissionsController@editRole']);
$api->post('/adminapi/permission/role/delByIds', ['permission' => 'role.permission.del', 'uses'=>'PermissionsController@delByIds']);
$api->post('/adminapi/permission/role/editRolePermission', ['permission' => 'role.permission.edit', 'uses'=>'PermissionsController@editRolePermission']);
$api->post('/adminapi/permission/role/setDefault', ['permission' => 'role.permission.edit', 'uses'=>'PermissionsController@editRoleDefault']);
$api->get('/adminapi/permission/dictData/defaultButtonPermission', ['uses'=>'PermissionsController@getDefaultButtonPermission']);
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment