diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 857037f3e498605421a10289361e8b9816f4e4ad..a265acf0c28a725a617049bb1c8b86de60d0d9d6 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(!isset($v['status']) || $v['status']==1){ + $newmenu[$k] = $v; + } + } + return json(get_tree($newmenu)); } // 欢迎页 diff --git a/app/common/model/AdminAdmin.php b/app/common/model/AdminAdmin.php index 58123b2bd6a9040040f6ee5a800b9e30d44388e5..bfa1c5d63e034ecd81957b962f8e8c48cacf0708 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'); diff --git a/app/install/controller/Base.php b/app/install/controller/Base.php index e0b7048adc4ba914d8d52a1286518dcf42b30c97..2653f728260f70ceb89e8dfa8e41d1b0094be891 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/config/web.php b/config/web.php index f0f242b4e870536c6b3575754f362623e36c06b6..1ecc9f97d66c9924d1a9582a2c6442e566801d39 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 diff --git a/view/install/index/index.html b/view/install/index/index.html index c297953192a03727952847289db8c669225ed45e..ec2a1350aa1ee07af590b17ea59c3a1c705bc5ce 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'); //验证通过