Skip to content

Commit 1ab314c

Browse files
committed
fix
1 parent 72ffbec commit 1ab314c

26 files changed

Lines changed: 139 additions & 173 deletions

publish/admin.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
<?php
22

33
declare(strict_types=1);
4-
54
/**
65
* This file is part of Hyperf.plus
76
*
87
* @link https://www.hyperf.plus
98
* @document https://doc.hyperf.plus
109
* @contact 4213509@qq.com
11-
* @license https://github.com/hyperf/hyperf-plus/blob/master/LICENSE
10+
* @license https://github.com/hyperf-plus/admin/blob/master/LICENSE
1211
*/
13-
12+
use HPlus\Admin\Middleware\AuthMiddleware;
1413
use HPlus\Admin\Model\Admin\Administrator;
1514
use HPlus\Admin\Model\Admin\Menu;
1615
use HPlus\Admin\Model\Admin\Permission;
1716
use HPlus\Admin\Model\Admin\Role;
18-
use HPlus\Admin\Middleware\AuthMiddleware;
19-
use HPlus\Admin\Middleware\LogsMiddleware;
2017

2118
return [
2219
//后台名称 null不显示

publish/auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @link https://www.hyperf.plus
88
* @document https://doc.hyperf.plus
99
* @contact 4213509@qq.com
10-
* @license https://github.com/hyperf/hyperf-plus/blob/master/LICENSE
10+
* @license https://github.com/hyperf-plus/admin/blob/master/LICENSE
1111
*/
1212
use HPlus\Admin\Model\Admin\Administrator;
1313
use Qbhy\HyperfAuth\Provider\EloquentProvider;

publish/file.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @link https://www.hyperf.plus
88
* @document https://doc.hyperf.plus
99
* @contact 4213509@qq.com
10-
* @license https://github.com/hyperf/hyperf-plus/blob/master/LICENSE
10+
* @license https://github.com/hyperf-plus/admin/blob/master/LICENSE
1111
*/
1212
return [
1313
'default' => 'local',

src/Admin.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* @contact 4213509@qq.com
1010
* @license https://github.com/hyperf-plus/admin/blob/master/LICENSE
1111
*/
12-
1312
namespace HPlus\Admin;
1413

1514
use HPlus\Admin\Exception\ValidateException;
@@ -27,6 +26,7 @@ class Admin
2726
public static $metaTitle;
2827

2928
protected $authManager;
29+
3030
/**
3131
* @var AuthGuard
3232
*/
@@ -54,7 +54,7 @@ public function title()
5454

5555
public function menu(Authenticatable $user)
5656
{
57-
if (!$user instanceof Authenticatable) {
57+
if (! $user instanceof Authenticatable) {
5858
return [];
5959
}
6060
$menuClass = config('admin.database.menu_model');
@@ -67,7 +67,7 @@ public function menu(Authenticatable $user)
6767
$permissionIds = $user->allPermissions()->pluck('id')->toArray();
6868
$userRolesIds = $user->roles()->pluck('id')->toArray();
6969
$isAdministrator = $user->isAdministrator();
70-
$list = $menuModel->get()->filter(function ($item) use ($user, $permissionIds, $userRolesIds, $isAdministrator) {
70+
$list = $menuModel->get()->filter(function ($item) use ($permissionIds, $userRolesIds, $isAdministrator) {
7171
if ($isAdministrator) {
7272
return 1;
7373
}
@@ -77,7 +77,7 @@ public function menu(Authenticatable $user)
7777
return 1;
7878
}
7979
}
80-
$permissions = (array)$item->permission;
80+
$permissions = (array) $item->permission;
8181
foreach ($permissions as $permissionId) {
8282
if (in_array($permissionId, $permissionIds)) {
8383
return 1;
@@ -97,7 +97,7 @@ public function validatorData(array $all, $rules, $message = [])
9797
{
9898
$validator = Validator::make($all, $rules, $message);
9999
if ($validator->fails()) {
100-
throw new ValidateException(422, (string)$validator->errors()->first());
100+
throw new ValidateException(422, (string) $validator->errors()->first());
101101
}
102102
return $validator;
103103
}

src/ConfigProvider.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
*/
1212
namespace HPlus\Admin;
1313

14-
use HPlus\Admin\Contracts\PermissionInterface;
15-
use HPlus\Admin\Library\Permission;
16-
use HPlus\Admin\Listener\PermissionListener;
17-
1814
class ConfigProvider
1915
{
2016
public function __invoke(): array

src/Controller/Logs.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* @contact 4213509@qq.com
1010
* @license https://github.com/hyperf-plus/admin/blob/master/LICENSE
1111
*/
12-
1312
namespace HPlus\Admin\Controller;
1413

1514
use HPlus\Admin\Model\Admin\OperationLog;
@@ -20,7 +19,6 @@
2019
use HPlus\UI\Components\Grid\Avatar;
2120
use HPlus\UI\Components\Grid\Route;
2221
use HPlus\UI\Components\Grid\Tag;
23-
use HPlus\UI\Components\Widgets\Button;
2422
use HPlus\UI\Components\Widgets\Dialog;
2523
use HPlus\UI\Components\Widgets\Markdown;
2624
use HPlus\UI\Form;
@@ -60,9 +58,9 @@ protected function grid()
6058
$dialog->title('查看请求头信息');
6159
$dialog->slot(function (Content $content) use ($row) {
6260
$code = "```json\n";
63-
$code .= json_encode($row->header, JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT);
61+
$code .= json_encode($row->header, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
6462
$code .= "\n```";
65-
$content->body(Markdown::make($code)->style("height:60vh;"));
63+
$content->body(Markdown::make($code)->style('height:60vh;'));
6664
});
6765
});
6866
$actions->add($action);
@@ -73,9 +71,9 @@ protected function grid()
7371
$dialog->title('查看提交参数信息');
7472
$dialog->slot(function (Content $content) use ($row) {
7573
$code = "```json\n";
76-
$code .= json_encode($row->request, JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT);
74+
$code .= json_encode($row->request, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
7775
$code .= "\n```";
78-
$content->body(Markdown::make($code)->style("height:60vh;"));
76+
$content->body(Markdown::make($code)->style('height:60vh;'));
7977
});
8078
});
8179
$actions->add($action);
@@ -87,9 +85,9 @@ protected function grid()
8785
$dialog->title('查看响应结果');
8886
$dialog->slot(function (Content $content) use ($row) {
8987
$code = "```json\n";
90-
$code .= json_encode($row->result ,JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT);
88+
$code .= json_encode($row->result, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
9189
$code .= "\n```";
92-
$content->body(Markdown::make($code)->style("height:60vh;"));
90+
$content->body(Markdown::make($code)->style('height:60vh;'));
9391
});
9492
});
9593
$actions->add($action);
@@ -100,7 +98,7 @@ protected function grid()
10098
});
10199

102100
$grid->filter(function (Grid\Filter $filter) {
103-
$user_id = (int)request('user_id');
101+
$user_id = (int) request('user_id');
104102
$filter->equal('user_id')->component(Select::make($user_id)->placeholder('请选择用户')->options(function () {
105103
$user_ids = OperationLog::query()->groupBy('user_id')->get(['user_id'])->pluck('user_id')->toArray();
106104
/*@var Model $userModel */

src/Controller/Menu.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* @contact 4213509@qq.com
1010
* @license https://github.com/hyperf-plus/admin/blob/master/LICENSE
1111
*/
12-
1312
namespace HPlus\Admin\Controller;
1413

1514
use HPlus\Admin\Service\AuthService;
@@ -20,7 +19,6 @@
2019
use HPlus\UI\Components\Form\IconChoose;
2120
use HPlus\UI\Components\Form\InputNumber;
2221
use HPlus\UI\Components\Form\Select;
23-
use HPlus\UI\Components\Grid\Boole;
2422
use HPlus\UI\Components\Grid\Icon;
2523
use HPlus\UI\Components\Grid\Tag;
2624
use HPlus\UI\Form;
@@ -96,8 +94,8 @@ protected function form()
9694
$form->item('icon', '图标')->component(IconChoose::make())->ignoreEmpty();
9795
$form->item('uri', 'URI')->required()
9896
->help('可以输入搜索')
99-
->component(Select::make()->filterable()->allowCreate("")
100-
->remote(route('menu/route')))->inputWidth(450);
97+
->component(Select::make()->filterable()->allowCreate('')
98+
->remote(route('menu/route')))->inputWidth(450);
10199
$form->item('order', '排序')->component(InputNumber::make(1)->min(0));
102100
$form->item('is_menu', '设为菜单')->component(CSwitch::make(0));
103101
$form->item('roles', '角色')->component(Select::make()->block()->multiple()->options(function () use ($roleModel) {
@@ -107,7 +105,6 @@ protected function form()
107105
}));
108106
//编辑前置钩子
109107
$form->editing(function (Form $form) {
110-
111108
});
112109
//提交后钩子,这里是接收到提交的表单数据,可进行修改,这里回调结束修改后才进入model保存
113110
$form->saving(function (Form $form) {

src/Controller/Permissions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ protected function form($isEdit = false)
9191
$form->item('path', '授权节点')
9292
->help('可以输入搜索')
9393
->component(Select::make()->filterable()
94-
->remote(route('permissions/route'))->multiple())->inputWidth(450);
94+
->remote(route('permissions/route'))->multiple())->inputWidth(450);
9595
return $form;
9696
}
9797

0 commit comments

Comments
 (0)