From bc01a04dbd63d08355c85c508bd3c9ee9b5e5f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=B2=90=E6=98=A5?= <2581047041@qq.com> Date: Thu, 20 Apr 2023 06:55:31 +0000 Subject: [PATCH 1/5] =?UTF-8?q?update=20app/common/model/AdminAdmin.php.?= =?UTF-8?q?=20=E5=B0=86=E8=8F=9C=E5=8D=95=E9=87=8C=E9=9D=A2=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E6=8C=89=E9=92=AE=E6=8E=A7=E5=88=B6=E5=9C=A8=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=87=8C=E9=9D=A2=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 如沐春 <2581047041@qq.com> --- app/common/model/AdminAdmin.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/app/common/model/AdminAdmin.php b/app/common/model/AdminAdmin.php index 58123b2..bfa1c5d 100644 --- a/app/common/model/AdminAdmin.php +++ b/app/common/model/AdminAdmin.php @@ -88,10 +88,8 @@ class AdminAdmin extends Model if ($admin['id'] == 1){ $perms = AdminPermission::order('sort','asc')->select()->toArray(); foreach ($perms as $p){ - if($p['status'] == 1){ - $permissions[$p['id']] = $p; - $permissions[$p['id']]['href'] = is_url($p['href'])??$root.$p['href']; - } + $permissions[$p['id']] = $p; + $permissions[$p['id']]['href'] = is_url($p['href'])??$root.$p['href']; } if(env('APP_DEBUG')==true){ $permissions[0] = [ @@ -118,10 +116,8 @@ class AdminAdmin extends Model foreach ($admin['roles'] as $r) { if (isset($r['permissions']) && !empty($r['permissions'])) { foreach ($r['permissions'] as $p) { - if($p['status'] == 1){ - $permissions[$p['id']] = $p; - $permissions[$p['id']]['href'] = is_url($p['href'])??$root.$p['href']; - } + $permissions[$p['id']] = $p; + $permissions[$p['id']]['href'] = is_url($p['href'])??$root.$p['href']; } } } @@ -129,10 +125,8 @@ class AdminAdmin extends Model //处理直接权限 if (isset($admin['directPermissions']) && !empty($admin['directPermissions'])) { foreach ($admin['directPermissions'] as $p) { - if($p['status'] == 1){ - $permissions[$p['id']] = $p; - $permissions[$p['id']]['href'] = is_url($p['href'])??$root.$p['href']; - } + $permissions[$p['id']] = $p; + $permissions[$p['id']]['href'] = is_url($p['href'])??$root.$p['href']; } } $key = array_column($permissions, 'sort'); -- Gitee From 19224c7ce6d393a9d7676009efe047cfad7584b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=B2=90=E6=98=A5?= <2581047041@qq.com> Date: Thu, 20 Apr 2023 06:57:07 +0000 Subject: [PATCH 2/5] =?UTF-8?q?update=20app/admin/controller/Index.php.=20?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=98=BE=E7=A4=BA=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=EF=BC=8C=E5=B0=86=E9=9A=90=E8=97=8F=E7=9A=84=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 如沐春 <2581047041@qq.com> --- app/admin/controller/Index.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 857037f..ca6eb06 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -28,7 +28,14 @@ class Index extends Base // 菜单 public function menu(){ - return json(get_tree(Session::get('admin.menu'))); + $menu = Session::get('admin.menu'); + $newmenu = []; + foreach($menu as $k=>$v){ + if($v['status']==1){ + $newmenu[$k] = $v; + } + } + return json(get_tree($newmenu)); } // 欢迎页 -- Gitee From 89853c59cb4bd5262b73f49665a27a951e4caaf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=82=E7=A6=8F?= <2581047041@qq.com> Date: Tue, 11 Jul 2023 16:49:20 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=95=B0=E6=8D=AE=E5=BA=93=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/install/controller/Base.php | 6 ++++-- view/install/index/index.html | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/install/controller/Base.php b/app/install/controller/Base.php index e0b7048..2653f72 100644 --- a/app/install/controller/Base.php +++ b/app/install/controller/Base.php @@ -94,8 +94,10 @@ abstract class Base $return[$k] = $v; } } - $response = Response::create($return, 'json')->header($header); - throw new HttpResponseException($response); + echo json_encode($return,JSON_UNESCAPED_UNICODE); + exit; + // $response = Response::create($return, 'json')->header($header); + // throw new HttpResponseException($response); } /** diff --git a/view/install/index/index.html b/view/install/index/index.html index c297953..ec2a135 100644 --- a/view/install/index/index.html +++ b/view/install/index/index.html @@ -178,6 +178,7 @@ type: "POST", data: Object.assign(sql), async : false, + dataType:"json", success: function (res) { //验证通过 if (res.code==200){ @@ -198,6 +199,7 @@ type: "POST", data: data, async : false, + dataType:"json", success: function (res) { //验证通过 if (res.code==200){ @@ -238,6 +240,7 @@ $.ajax({ type: "POST", data: data, + dataType:"json", success: function (res) { layer.closeAll('loading'); //验证通过 -- Gitee From 541911641cec6ad3f39d975ee14f6e0a9840ac04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=82=E7=A6=8F?= <2581047041@qq.com> Date: Tue, 11 Jul 2023 16:49:37 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index ca6eb06..a265acf 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -31,7 +31,7 @@ class Index extends Base $menu = Session::get('admin.menu'); $newmenu = []; foreach($menu as $k=>$v){ - if($v['status']==1){ + if(!isset($v['status']) || $v['status']==1){ $newmenu[$k] = $v; } } -- Gitee From be2e5c9bdab1e267c718d06a38d499e83881b1d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=82=E7=A6=8F?= <2581047041@qq.com> Date: Wed, 12 Jul 2023 11:08:56 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=8F=82=E6=95=B0=E5=80=BC?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E7=B3=BB=E7=BB=9F=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=9A=84=E5=90=8E=E4=B8=8D=E8=83=BD=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=8F=82=E6=95=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/web.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/web.php b/config/web.php index f0f242b..1ecc9f9 100644 --- a/config/web.php +++ b/config/web.php @@ -26,4 +26,5 @@ return [ 'qiniu-Bucket' => '', 'qiniu-AK' => '', 'qiniu-SK' => '', + 'file-type' => '1', ]; \ No newline at end of file -- Gitee