pref: 增加服务类优化UI版面

This commit is contained in:
Ying
2023-06-19 14:32:30 +08:00
parent 27eda6f37f
commit 2b8f874450
148 changed files with 3933 additions and 9286 deletions

View File

@@ -1,8 +1,6 @@
<?php
namespace app\admin\middleware\system;
use app\common\library\Auth;
use think\facade\Cache;
use Webman\Http\Request;
use Webman\Http\Response;
use Webman\MiddlewareInterface;

View File

@@ -27,7 +27,7 @@ class AdminPermissions implements MiddlewareInterface
* 不需要鉴权的方法
* @var array
*/
protected array $noNeedAuth = [
protected array $noNeedLogin = [
'/Index/index',
'/Login/index',
'/Login/logout',
@@ -56,12 +56,12 @@ class AdminPermissions implements MiddlewareInterface
// 获取权限列表
$class = new \ReflectionClass($request->controller);
$properties = $class->getDefaultProperties();
$this->noNeedAuth = $properties['noNeedAuth'] ?? $this->noNeedAuth;
$this->noNeedLogin = $properties['noNeedLogin'] ?? $this->noNeedLogin;
// 控制器鉴权
$method = '/' . $controller . '/' . $action;
if (!in_array('*', $this->noNeedAuth)
&& !in_array(strtolower($method), array_map('strtolower', $this->noNeedAuth))) {
if (!in_array('*', $this->noNeedLogin)
&& !in_array(strtolower($method), array_map('strtolower', $this->noNeedLogin))) {
if (!Auth::instance()->SuperAdmin() && !Auth::instance()->check($method, get_admin_id())) {
if (request()->isAjax()) {
return json(['code' => 101, 'msg' => '没有权限']);