mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-06 01:52:48 +08:00
推进管理员管理和权限管理
This commit is contained in:
@@ -68,4 +68,22 @@ class Admin extends Common
|
||||
|
||||
return $this->success('保存成功','Admin/edit');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$admin_list = AppAdmin::where('id','<>',1)->paginate();
|
||||
View::assign('list',$admin_list);
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
92
app/admin/controller/AdminGroup.php
Normal file
92
app/admin/controller/AdminGroup.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\model\AdminGroup as AppAdminGroup;
|
||||
use think\facade\View;
|
||||
use think\Request;
|
||||
|
||||
class AdminGroup extends Common
|
||||
{
|
||||
/**
|
||||
* 显示资源列表
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
$list = AppAdminGroup::select();
|
||||
View::assign('list',$list);
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示创建资源表单页.
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存新建的资源
|
||||
*
|
||||
* @param \think\Request $request
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function save(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示指定的资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function read($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示编辑资源表单页.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存更新的资源
|
||||
*
|
||||
* @param \think\Request $request
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
67
app/admin/controller/AdminPermission.php
Normal file
67
app/admin/controller/AdminPermission.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\model\AdminPermission as AppAdminPermission;
|
||||
use think\facade\View;
|
||||
use think\Request;
|
||||
|
||||
class AdminPermission extends Common
|
||||
{
|
||||
/**
|
||||
* 显示资源列表
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
|
||||
$list = AppAdminPermission::paginate();
|
||||
|
||||
View::assign('list',$list);
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存更新的资源
|
||||
*
|
||||
* @param \think\Request $request
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
$post_data = $request->post();
|
||||
|
||||
$model_permission = AppAdminPermission::find($id);
|
||||
|
||||
if(isset($post_data['url'])){
|
||||
$url_info = \explode('/',$post_data['url']);
|
||||
|
||||
$post_data['app'] = $url_info[0];
|
||||
$post_data['controller'] = $url_info[1];
|
||||
$post_data['action'] = $url_info[2];
|
||||
}
|
||||
|
||||
$model_permission->data($post_data);
|
||||
|
||||
$model_permission->save();
|
||||
|
||||
return json_message();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
5
app/admin/middleware.php
Normal file
5
app/admin/middleware.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'\app\middleware\PermissionRecord'
|
||||
];
|
||||
Reference in New Issue
Block a user