From 0b2d4c7813beff2389b504669c3d6f4c2c1710a3 Mon Sep 17 00:00:00 2001 From: toogee Date: Tue, 7 Apr 2020 17:11:12 +0800 Subject: [PATCH] set user auth --- README.md | 5 +++-- app/admin/controller/Admin.php | 29 +++++++++++++++++++---------- app/install/data/taoler.sql | 2 ++ public/static/admin/modules/set.js | 4 ++-- view/admin/notice/index.html | 2 +- view/admin/set/user/info.html | 4 ++-- view/admin/set/user/repass.html | 4 ++-- view/admin/slider/index.html | 2 ++ 8 files changed, 33 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 26d1c4654..4350c1c 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,12 @@ 版本:TaoLer 1.0.0 日期:2020.1.1 官网:http://www.aieok.com + 测试:http://www.aieok.com/admin 账号test 密码test123 #### 项目地址 -gitee https://www.gitee.com/toogee/Taoler -github https://www.github.com/taoser/TaoLer +1. gitee https://www.gitee.com/toogee/Taoler +2. github https://www.github.com/taoser/TaoLer #### 介绍 diff --git a/app/admin/controller/Admin.php b/app/admin/controller/Admin.php index e45cb5e..223f161 100644 --- a/app/admin/controller/Admin.php +++ b/app/admin/controller/Admin.php @@ -135,8 +135,15 @@ class Admin extends AdminController } } } - //管理员资料更新 + //基本资料显示 public function info() + { + $admin = AdminModel::find(Session::get('admin_id')); + View::assign('admin',$admin); + return View::fetch('set/user/info'); + } + //管理员资料更新 + public function infoSet() { $admin = AdminModel::find(Session::get('admin_id')); if(Request::isAjax()){ @@ -149,14 +156,20 @@ class Admin extends AdminController } return json($res); } - View::assign('admin',$admin); - return View::fetch('set/user/info'); } - //改密码 + //显示改密码页面 public function repass() { - // + $admin = AdminModel::find(Session::get('admin_id')); + + View::assign('admin',$admin); + return View::fetch('set/user/repass'); + } + + //密码重设 + public function repassSet() + { $admin = AdminModel::find(Session::get('admin_id')); if(Request::isAjax()){ $data = Request::param(); @@ -180,11 +193,7 @@ class Admin extends AdminController } return json($res); } - - - } - View::assign('admin',$admin); - return View::fetch('set/user/repass'); + } } //清除缓存Cache diff --git a/app/install/data/taoler.sql b/app/install/data/taoler.sql index d843884..9df2cc4 100644 --- a/app/install/data/taoler.sql +++ b/app/install/data/taoler.sql @@ -184,6 +184,8 @@ INSERT INTO `tao_auth_rule` VALUES ('87', 'admin/AuthAccess/check', '审核管 INSERT INTO `tao_auth_rule` VALUES ('88', 'admin/Set/website', '网站信息保存', '1', '1', '2', '1', '', '0', '24', '', '1585819936', '1585820211', '0'); INSERT INTO `tao_auth_rule` VALUES ('89', 'admin/User/auth', '设置超级用户', '1', '1', '1', '1', '', '0', '22', '', '1578984801', '0', '0'); INSERT INTO `tao_auth_rule` VALUES ('90', 'admin/Forum/tagshot', '开启热点', '1', '1', '5', '1', '', '0', '15', '', '1585841826', '0', '0'); +INSERT INTO `tao_auth_rule` VALUES ('91', 'admin/Admin/infoSet', '资料设置', '1', '1', '3', '1', '', '0', '62', '', '1586245669', '0', '0'); +INSERT INTO `tao_auth_rule` VALUES ('92', 'admin/Admin/repassSet', '密码设置', '1', '1', '3', '1', '', '0', '64', '', '1586245727', '0', '0'); DROP TABLE IF EXISTS `tao_cate`; CREATE TABLE `tao_cate` ( diff --git a/public/static/admin/modules/set.js b/public/static/admin/modules/set.js index 2767782..f077987 100644 --- a/public/static/admin/modules/set.js +++ b/public/static/admin/modules/set.js @@ -126,7 +126,7 @@ layui.define(['form', 'upload'], function(exports){ admin.req({ type: 'post' - ,url: '/admin/admin/info' + ,url: '/admin/Admin/infoSet' ,data: obj.field ,success: function(res){ if(res.code == 0){ @@ -190,7 +190,7 @@ layui.define(['form', 'upload'], function(exports){ //提交修改 admin.req({ type: 'post' - ,url: '/admin/admin/repass' + ,url: '/admin/Admin/repassSet' ,data: obj.field ,success: function(res){ if(res.code == 0){ diff --git a/view/admin/notice/index.html b/view/admin/notice/index.html index 861f480..7cc6266 100644 --- a/view/admin/notice/index.html +++ b/view/admin/notice/index.html @@ -37,7 +37,7 @@
{if condition="checkRuleButton('admin/notice/add')"} - {/if} + {else /}{/if}
diff --git a/view/admin/set/user/info.html b/view/admin/set/user/info.html index e4c2769..2a8549b 100644 --- a/view/admin/set/user/info.html +++ b/view/admin/set/user/info.html @@ -72,10 +72,10 @@
- {if condition="checkRuleButton('admin/admin/info')"} + {if condition="checkRuleButton('admin/Admin/infoSet')"} {else /} - + {/if}
diff --git a/view/admin/set/user/repass.html b/view/admin/set/user/repass.html index 4f2bd7f..7f3de2f 100644 --- a/view/admin/set/user/repass.html +++ b/view/admin/set/user/repass.html @@ -31,10 +31,10 @@
- {if condition="checkRuleButton('admin/admin/info')"} + {if condition="checkRuleButton('admin/Admin/repassSet')"} {else /} - + {/if}
diff --git a/view/admin/slider/index.html b/view/admin/slider/index.html index f6b1517..1a32493 100644 --- a/view/admin/slider/index.html +++ b/view/admin/slider/index.html @@ -42,7 +42,9 @@ {$vo.slid_status ?'显示':'禁止'} 编辑 + {if condition="checkRuleButton('admin/Slider/delete')"} 删除 + {else /}删除{/if} {/volist}