修改权限管理

This commit is contained in:
wuyanwen
2019-12-26 09:03:09 +08:00
parent 4a3f043166
commit 1dcce85c3a
8 changed files with 46 additions and 124 deletions

View File

@@ -3,6 +3,7 @@ namespace catchAdmin\permissions;
use app\Request;
use catchAdmin\permissions\model\Permissions;
use catcher\Code;
use catcher\exceptions\PermissionForbiddenException;
use think\helper\Str;
@@ -34,7 +35,7 @@ class PermissionsMiddleware
}
if (!$request->user()) {
throw new PermissionForbiddenException('Login is invalid', 10006);
throw new PermissionForbiddenException('Login is invalid', Code::LOST_LOGIN);
}
// toad
@@ -95,4 +96,4 @@ class PermissionsMiddleware
{
return ['login'];
}
}
}