From 5fb45fc57ca2fb7ca2392ea87652495ff9a5f71d Mon Sep 17 00:00:00 2001 From: tensent Date: Mon, 17 Feb 2020 23:43:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common.php | 10 +- app/controller/Admin.php | 233 +++++++++++++++++++++++++- app/controller/admin/Action.php | 36 ++-- app/controller/admin/Ad.php | 38 ++--- app/controller/admin/Addons.php | 54 +++--- app/controller/admin/Attribute.php | 40 ++--- app/controller/admin/Channel.php | 24 +-- app/controller/admin/Client.php | 44 ++--- app/controller/admin/Config.php | 45 ++--- app/controller/admin/Content.php | 38 ++--- app/controller/admin/Group.php | 49 +++--- app/controller/admin/Index.php | 23 +-- app/controller/admin/Link.php | 19 +-- app/controller/admin/Menu.php | 43 +++-- app/controller/admin/Model.php | 14 +- app/controller/admin/Seo.php | 22 +-- app/controller/admin/Upload.php | 6 +- app/controller/admin/User.php | 50 +++--- app/model/Member.php | 8 +- app/model/Menu.php | 2 +- extend/.gitignore | 2 - extend/doc/Doc.php | 135 +++++++++++++++ public/favicon.ico | Bin 1150 -> 9662 bytes view/admin/action/detail.html | 2 +- view/admin/action/index.html | 2 +- view/admin/action/log.html | 2 +- view/admin/ad/index.html | 2 +- view/admin/ad/lists.html | 2 +- view/admin/addons/add.html | 2 +- view/admin/addons/hooks.html | 2 +- view/admin/addons/index.html | 2 +- view/admin/attribute/index.html | 2 +- view/admin/category/edit.html | 2 +- view/admin/category/edit_channel.html | 2 +- view/admin/category/index.html | 2 +- view/admin/category/operate.html | 2 +- view/admin/channel/edit.html | 2 +- view/admin/channel/index.html | 2 +- view/admin/channel/sort.html | 2 +- view/admin/client/add.html | 2 +- view/admin/client/index.html | 2 +- view/admin/config/edit.html | 2 +- view/admin/config/group.html | 2 +- view/admin/config/index.html | 2 +- view/admin/config/themes.html | 2 +- view/admin/content/index.html | 2 +- view/admin/database/export.html | 2 +- view/admin/database/import.html | 2 +- view/admin/form/attr.html | 2 +- view/admin/form/detail_alumn.html | 2 +- view/admin/form/index.html | 2 +- view/admin/form/list_alumn.html | 2 +- view/admin/group/access.html | 2 +- view/admin/group/auth.html | 2 +- view/admin/group/index.html | 2 +- view/admin/link/index.html | 2 +- view/admin/menu/edit.html | 2 +- view/admin/menu/import.html | 2 +- view/admin/menu/index.html | 2 +- view/admin/menu/sort.html | 2 +- view/admin/model/add.html | 2 +- view/admin/model/edit.html | 2 +- view/admin/model/index.html | 2 +- view/admin/public/base.html | 10 +- view/admin/public/edit.html | 2 +- view/admin/public/footer.html | 23 ++- view/admin/public/header.html | 2 +- view/admin/public/tool.html | 2 +- view/admin/seo/index.html | 2 +- view/admin/seo/rewrite.html | 2 +- view/admin/user/auth.html | 2 +- view/admin/user/editpwd.html | 2 +- view/admin/user/index.html | 6 +- 73 files changed, 711 insertions(+), 357 deletions(-) delete mode 100755 extend/.gitignore create mode 100644 extend/doc/Doc.php diff --git a/app/common.php b/app/common.php index 4399d0be..3bfbb7e8 100755 --- a/app/common.php +++ b/app/common.php @@ -7,6 +7,7 @@ // | Author: molong // +---------------------------------------------------------------------- // 应用公共文件 +use think\facade\Session; define("SENTCMS_VERSION", '4.0.20200217'); @@ -14,9 +15,16 @@ define("SENTCMS_VERSION", '4.0.20200217'); * */ function is_login() { - return false; + $user = Session::get('userInfo'); + return $user['uid']; } +function is_administrator() { + return true; +} + +function hook() {} + /** * 获取客户端IP地址 * @param integer $type 返回类型 0 返回IP地址 1 返回IPV4地址数字 diff --git a/app/controller/Admin.php b/app/controller/Admin.php index 0c2f2e14..9a575035 100755 --- a/app/controller/Admin.php +++ b/app/controller/Admin.php @@ -8,6 +8,8 @@ // +---------------------------------------------------------------------- namespace app\controller; +use app\model\Menu; + /** * @title 后端公共模块 */ @@ -32,7 +34,236 @@ class Admin extends Base { protected function initialize() { $url = str_replace(".", "/", strtolower($this->request->controller())) . '/' . $this->request->action(); if (!is_login() and !in_array($url, array('admin/index/login', 'admin/index/logout', 'admin/index/verify'))) { - $this->redirect('admin/index/login'); + $this->redirect('/admin/index/login'); + } + + if (!in_array($url, array('admin/index/login', 'admin/index/logout', 'admin/index/verify'))) { + + // 是否是超级管理员 + define('IS_ROOT', is_administrator()); + if (!IS_ROOT && \think\Config::get('admin_allow_ip')) { + // 检查IP地址访问 + if (!in_array(get_client_ip(), explode(',', \think\Config::get('admin_allow_ip')))) { + $this->error('403:禁止访问'); + } + } + + // 检测系统权限 + if (!IS_ROOT) { + $access = $this->accessControl(); + if (false === $access) { + $this->error('403:禁止访问'); + } elseif (null === $access) { + $dynamic = $this->checkDynamic(); //检测分类栏目有关的各项动态权限 + if ($dynamic === null) { + //检测访问权限 + if (!$this->checkRule($this->url_path, array('in', '1,2'))) { + $this->error('未授权访问!'); + } else { + // 检测分类及内容有关的各项动态权限 + $dynamic = $this->checkDynamic(); + if (false === $dynamic) { + $this->error('未授权访问!'); + } + } + } elseif ($dynamic === false) { + $this->error('未授权访问!'); + } + } + } + //菜单设置 + $this->getMenu(); + // $this->setMeta(); + // $this->data['__menu__'] = ['main' => [], 'child' => []]; + $this->data['meta_title'] = $this->getCurrentTitle(); } } + + /** + * 权限检测 + * @param string $rule 检测的规则 + * @param string $mode check模式 + * @return boolean + * @author 朱亚杰 + */ + final protected function checkRule($rule, $type = AuthRule::rule_url, $mode = 'url') { + static $Auth = null; + if (!$Auth) { + $Auth = new \com\Auth(); + } + if (!$Auth->check($rule, session('user_auth.uid'), $type, $mode)) { + return false; + } + return true; + } + + /** + * 检测是否是需要动态判断的权限 + * @return boolean|null + * 返回true则表示当前访问有权限 + * 返回false则表示当前访问无权限 + * 返回null,则表示权限不明 + * + * @author 朱亚杰 + */ + protected function checkDynamic() { + if (IS_ROOT) { + return true; //管理员允许访问任何页面 + } + return null; //不明,需checkRule + } + + /** + * action访问控制,在 **登陆成功** 后执行的第一项权限检测任务 + * + * @return boolean|null 返回值必须使用 `===` 进行判断 + * + * 返回 **false**, 不允许任何人访问(超管除外) + * 返回 **true**, 允许任何管理员访问,无需执行节点权限检测 + * 返回 **null**, 需要继续执行节点权限检测决定是否允许访问 + * @author 朱亚杰 + */ + final protected function accessControl() { + $allow = \think\Config::get('allow_visit'); + $deny = \think\Config::get('deny_visit'); + $check = strtolower($this->request->controller() . '/' . $this->request->action()); + if (!empty($deny) && in_array_case($check, $deny)) { + return false; //非超管禁止访问deny中的方法 + } + if (!empty($allow) && in_array_case($check, $allow)) { + return true; + } + return null; //需要检测节点权限 + } + + protected function getMenu() { + $hover_url = str_replace(".", "/", strtolower($this->request->controller())); + $controller = str_replace(".", "/", strtolower($this->request->controller())); + $menu = array( + 'main' => array(), + 'child' => array(), + ); + $where['pid'] = 0; + $where['hide'] = 0; + $where['type'] = 'admin'; + if (!config('develop_mode')) { + // 是否开发者模式 + $where['is_dev'] = 0; + } + $row = Menu::where($where)->order('sort asc')->field('id,title,url,icon,"" as style')->select(); + foreach ($row as $key => $value) { + //此处用来做权限判断 + if (!IS_ROOT && !$this->checkRule($value['url'], 2, null)) { + unset($menu['main'][$value['id']]); + continue; //继续循环 + } + if ($controller == $value['url']) { + $value['style'] = "active"; + } + $menu['main'][$value['id']] = $value; + } + + // 查找当前子菜单 + $pid = Menu::where("pid !=0 AND url like '%{$hover_url}%'")->value('pid'); + $id = Menu::where("pid = 0 AND url like '%{$hover_url}%'")->value('id'); + $pid = $pid ? $pid : $id; + if (strtolower($hover_url) == 'admin/content' || strtolower($hover_url) == 'admin/attribute') { + //内容管理菜单 + $pid = Menu::where("pid =0 AND url like '%admin/category%'")->value('id'); + } + if ($pid) { + $map['pid'] = $pid; + $map['hide'] = 0; + $map['type'] = 'admin'; + $row = Menu::field("id,title,url,icon,`group`,pid,'' as style")->where($map)->order('sort asc')->select(); + foreach ($row as $key => $value) { + if (IS_ROOT || $this->checkRule($value['url'], 2, null)) { + if ($controller == $value['url']) { + $menu['main'][$value['pid']]['style'] = "active"; + $value['style'] = "active"; + } + $menu['child'][$value['group']][] = $value; + } + } + } + $this->data['__menu__'] = $menu; + } + + protected function getContentMenu() { + $model = \think\Loader::model('Model'); + $list = array(); + $map = array( + 'status' => array('gt', 0), + ); + $list = $model::where($map)->field("name,id,title,icon,'' as 'style'")->select(); + + //判断是否有模型权限 + $models = AuthGroup::getAuthModels(session('user_auth.uid')); + foreach ($list as $key => $value) { + if (IS_ROOT || in_array($value['id'], $models)) { + if ('admin/content/index' == $this->request->path() && input('model_id') == $value['id']) { + $value['style'] = "active"; + } + $value['url'] = "admin/content/index?model_id=" . $value['id']; + $value['title'] = $value['title'] . "管理"; + $value['icon'] = $value['icon'] ? $value['icon'] : 'file'; + $menu[] = $value; + } + } + if (!empty($menu)) { + $this->assign('extend_menu', array('内容管理' => $menu)); + } + } + + protected function getAddonsMenu() { + $model = db('Addons'); + $list = array(); + $map = array( + 'isinstall' => array('gt', 0), + 'status' => array('gt', 0), + ); + $list = $model->field("name,id,title,'' as 'style'")->where($map)->select(); + + $menu = array(); + foreach ($list as $key => $value) { + $class = "\\addons\\" . strtolower($value['name']) . "\\controller\\Admin"; + if (is_file(ROOT_PATH . '/addons/' . strtolower($value['name']) . "/controller/Admin.php")) { + $action = get_class_methods($class); + $value['url'] = "admin/addons/execute?mc=" . strtolower($value['name']) . "&ac=" . $action[0]; + $menu[$key] = $value; + } + } + if (!empty($menu)) { + $this->assign('extend_menu', array('管理插件' => $menu)); + } + } + + protected function getCurrentTitle() { + $mate = ''; + $controller = strtr(strtolower($this->request->controller()), '.', '\\'); + $action = $this->request->action(); + $class = "\\app\\controller\\" . $controller; + if (class_exists($class)) { + $reflection = new \ReflectionClass($class); + $group_doc = $this->Parser($reflection->getDocComment()); + if(isset($group_doc['title'])){ + $mate = $group_doc['title']; + } + $method = $reflection->getMethods(\ReflectionMethod::IS_FINAL | \ReflectionMethod::IS_PUBLIC); + foreach ($method as $key => $v) { + if($action == $v->name){ + $title_doc = $this->Parser($v->getDocComment()); + if(isset($title_doc['title'])){ + $mate = $title_doc['title']; + } + } + } + } + return $mate; + } + + protected function Parser($text) { + $doc = new \doc\Doc(); + return $doc->parse($text); + } } \ No newline at end of file diff --git a/app/controller/admin/Action.php b/app/controller/admin/Action.php index b10236d3..f75204a1 100644 --- a/app/controller/admin/Action.php +++ b/app/controller/admin/Action.php @@ -7,8 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; /** * @title 行为管理 @@ -26,8 +26,8 @@ class Action extends Admin { $order = "id desc"; //获取列表数据 $list = model('Action')->where($map)->order($order)->paginate(10, false, array( - 'query' => $this->request->param() - )); + 'query' => $this->request->param(), + )); // 记录当前列表页的cookie Cookie('__forward__', $_SERVER['REQUEST_URI']); @@ -47,7 +47,7 @@ class Action extends Admin { public function add() { $model = model('Action'); if ($this->request->isPost()) { - $data = input('post.'); + $data = input('post.'); $result = $model->save($data); if (false != $result) { action_log('add_action', 'Action', $result, session('user_auth.uid')); @@ -72,7 +72,7 @@ class Action extends Admin { public function edit($id = null) { $model = model('Action'); if ($this->request->isPost()) { - $data = input('post.'); + $data = input('post.'); $result = $model->save($data, array('id' => $data['id'])); if ($result !== false) { action_log('edit_action', 'Action', $id, session('user_auth.uid')); @@ -86,7 +86,7 @@ class Action extends Admin { return $this->error("非法操作!"); } $data = array( - 'info' => $info, + 'info' => $info, 'keyList' => $model->fieldlist, ); $this->assign($data); @@ -105,7 +105,7 @@ class Action extends Admin { return $this->error("非法操作!", ''); } $map['id'] = array('IN', $id); - $result = db('Action')->where($map)->delete(); + $result = db('Action')->where($map)->delete(); if ($result) { action_log('delete_action', 'Action', $id, session('user_auth.uid')); return $this->success('删除成功!'); @@ -123,10 +123,10 @@ class Action extends Admin { if (empty($id)) { return $this->error("非法操作!", ''); } - $status = input('get.status', '', 'trim,intval'); - $message = !$status ? '禁用' : '启用'; + $status = input('get.status', '', 'trim,intval'); + $message = !$status ? '禁用' : '启用'; $map['id'] = array('IN', $id); - $result = db('Action')->where($map)->setField('status', $status); + $result = db('Action')->where($map)->setField('status', $status); if ($result !== false) { action_log('setstatus_action', 'Action', $id, session('user_auth.uid')); return $this->success('设置' . $message . '状态成功!'); @@ -168,12 +168,12 @@ class Action extends Admin { $info = $model::get($id); - $info['title'] = get_action($info['action_id'], 'title'); - $info['user_id'] = get_username($info['user_id']); - $info['action_ip'] = long2ip($info['action_ip']); + $info['title'] = get_action($info['action_id'], 'title'); + $info['user_id'] = get_username($info['user_id']); + $info['action_ip'] = long2ip($info['action_ip']); $info['create_time'] = date('Y-m-d H:i:s', $info['create_time']); - $data = array( - 'info' => $info, + $data = array( + 'info' => $info, 'keyList' => $model->keyList, ); $this->assign($data); @@ -192,7 +192,7 @@ class Action extends Admin { return $this->error("非法操作!", ''); } $map['id'] = array('IN', $id); - $res = db('ActionLog')->where($map)->delete(); + $res = db('ActionLog')->where($map)->delete(); if ($res !== false) { action_log('delete_actionlog', 'ActionLog', $id, session('user_auth.uid')); return $this->success('删除成功!'); @@ -200,7 +200,7 @@ class Action extends Admin { return $this->error('删除失败!'); } } - + /** * @title 清空日志 */ diff --git a/app/controller/admin/Ad.php b/app/controller/admin/Ad.php index 75cc45be..42d6e5e7 100644 --- a/app/controller/admin/Ad.php +++ b/app/controller/admin/Ad.php @@ -7,8 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; /** * @title 广告管理 @@ -21,7 +21,7 @@ class Ad extends Admin { public function _initialize() { parent::_initialize(); - $this->ad = db('Ad'); + $this->ad = db('Ad'); $this->adplace = db('AdPlace'); } @@ -29,12 +29,12 @@ class Ad extends Admin { * @title 广告位管理 */ public function index() { - $map = array(); + $map = array(); $order = "id desc"; $list = db('AdPlace')->where($map)->order($order)->paginate(10, false, array( - 'query' => $this->request->param() - )); + 'query' => $this->request->param(), + )); $data = array( 'list' => $list, 'page' => $list->render(), @@ -51,14 +51,14 @@ class Ad extends Admin { $place = model('AdPlace'); if ($this->request->isPost()) { $result = $place->change(); - if (!empty($_POST['name'])){ + if (!empty($_POST['name'])) { $result = $place->change(); if ($result) { return $this->success("添加成功!"); } else { return $this->error($place->getError()); - } - }else{ + } + } else { return $this->error("标识不能为空!"); } } else { @@ -89,7 +89,7 @@ class Ad extends Admin { return $this->error("非法操作!"); } $data = array( - 'info' => $info, + 'info' => $info, 'keyList' => $place->keyList, ); $this->assign($data); @@ -108,7 +108,7 @@ class Ad extends Admin { return $this->error("非法操作!"); } $map['id'] = array('IN', $id); - $result = $this->adplace->where($map)->delete(); + $result = $this->adplace->where($map)->delete(); if ($result) { return $this->success("删除成功!"); } else { @@ -121,13 +121,13 @@ class Ad extends Admin { */ public function lists($id = null) { $map['place_id'] = $id; - $order = "id desc"; + $order = "id desc"; $list = db('Ad')->where($map)->order($order)->paginate(10, false, array( - 'query' => $this->request->param() - )); + 'query' => $this->request->param(), + )); $data = array( - 'id' => $id, + 'id' => $id, 'list' => $list, 'page' => $list->render(), ); @@ -150,8 +150,8 @@ class Ad extends Admin { } } else { $info['place_id'] = $id; - $data = array( - 'info' => $info, + $data = array( + 'info' => $info, 'keyList' => $ad->keyList, ); $this->assign($data); @@ -178,7 +178,7 @@ class Ad extends Admin { return $this->error("非法操作!"); } $data = array( - 'info' => $info, + 'info' => $info, 'keyList' => $ad->keyList, ); $this->assign($data); @@ -197,7 +197,7 @@ class Ad extends Admin { return $this->error("非法操作!"); } $map['id'] = array('IN', $id); - $result = db('ad')->where($map)->delete(); + $result = db('ad')->where($map)->delete(); if ($result) { return $this->success("删除成功!"); } else { diff --git a/app/controller/admin/Addons.php b/app/controller/admin/Addons.php index 57b339f8..7ac6076a 100644 --- a/app/controller/admin/Addons.php +++ b/app/controller/admin/Addons.php @@ -7,8 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; /** * @title 插件管理 @@ -23,7 +23,7 @@ class Addons extends Admin { //加入菜单 $this->getAddonsMenu(); $this->addons = model('Addons'); - $this->hooks = db('Hooks'); + $this->hooks = db('Hooks'); } /** * @title 插件列表 @@ -33,8 +33,8 @@ class Addons extends Admin { $this->addons->refresh(); } $list = $this->addons->order('id desc')->paginate(25, false, array( - 'query' => $this->request->param() - )); + 'query' => $this->request->param(), + )); // 记录当前列表页的cookie Cookie('__forward__', $_SERVER['REQUEST_URI']); @@ -83,10 +83,10 @@ class Addons extends Admin { */ public function install() { $addon_name = input('addon_name', '', 'trim,ucfirst'); - $class = get_addon_class($addon_name); + $class = get_addon_class($addon_name); if (class_exists($class)) { $addons = new $class; - $info = $addons->info; + $info = $addons->info; if (!$info || !$addons->checkInfo()) { //检测信息的正确性 return $this->error('插件信息缺失'); @@ -126,7 +126,7 @@ class Addons extends Admin { public function enable() { $id = input('id'); cache('hooks', null); - $model = model('Addons'); + $model = model('Addons'); $result = $model::where(array('id' => $id))->update(array('status' => 1)); if ($result) { return $this->success('启用成功'); @@ -141,7 +141,7 @@ class Addons extends Admin { public function disable() { $id = input('id'); cache('hooks', null); - $model = model('Addons'); + $model = model('Addons'); $result = $model::where(array('id' => $id))->update(array('status' => 0)); if ($result) { return $this->success('禁用成功'); @@ -166,7 +166,7 @@ class Addons extends Admin { $class = get_addon_class($info['name']); $keyList = array(); - $data = array( + $data = array( 'keyList' => $keyList, ); $this->assign($data); @@ -186,15 +186,15 @@ class Addons extends Admin { * @param string $addons 插件简介 */ public function existHook($str, $addons, $msg = '') { - $hook_mod = db('Hooks'); + $hook_mod = db('Hooks'); $where['name'] = $str; - $gethook = $hook_mod->where($where)->find(); + $gethook = $hook_mod->where($where)->find(); if (!$gethook || empty($gethook) || !is_array($gethook)) { - $data['name'] = $str; + $data['name'] = $str; $data['description'] = $msg; - $data['type'] = 1; + $data['type'] = 1; $data['update_time'] = time(); - $data['addons'] = $addons; + $data['addons'] = $addons; if (false !== $hook_mod->create($data)) { $hook_mod->add(); } @@ -206,7 +206,7 @@ class Addons extends Admin { * @param string $hook 钩子名称 */ public function deleteHook($hook) { - $model = db('hooks'); + $model = db('hooks'); $condition = array( 'name' => $hook, ); @@ -219,11 +219,11 @@ class Addons extends Admin { */ public function hooks() { - $map = array(); + $map = array(); $order = "id desc"; - $list = model('Hooks')->where($map)->order($order)->paginate(10, false, array( - 'query' => $this->request->param() - )); + $list = model('Hooks')->where($map)->order($order)->paginate(10, false, array( + 'query' => $this->request->param(), + )); // 记录当前列表页的cookie Cookie('__forward__', $_SERVER['REQUEST_URI']); @@ -251,7 +251,7 @@ class Addons extends Admin { } } else { $keylist = $hooks->getaddons(); - $data = array( + $data = array( 'keyList' => $keylist, ); $this->assign($data); @@ -273,10 +273,10 @@ class Addons extends Admin { return $this->error($hooks->getError()); } } else { - $info = db('Hooks')->find($id); + $info = db('Hooks')->find($id); $keylist = $hooks->getaddons($info['addons']); - $data = array( - 'info' => $info, + $data = array( + 'info' => $info, 'keyList' => $keylist, ); $this->assign($data); @@ -289,9 +289,9 @@ class Addons extends Admin { * @title 删除钩子 */ public function delhook() { - $id = $this->getArrayParam('id'); + $id = $this->getArrayParam('id'); $map['id'] = array('IN', $id); - $result = $this->hooks->where($map)->delete(); + $result = $this->hooks->where($map)->delete(); if ($result !== false) { return $this->success('删除成功'); } else { @@ -304,7 +304,7 @@ class Addons extends Admin { */ public function updateHook() { $hookModel = D('Hooks'); - $data = $hookModel->create(); + $data = $hookModel->create(); if ($data) { if ($data['id']) { $flag = $hookModel->save($data); diff --git a/app/controller/admin/Attribute.php b/app/controller/admin/Attribute.php index d7c8c949..98de4b14 100644 --- a/app/controller/admin/Attribute.php +++ b/app/controller/admin/Attribute.php @@ -7,8 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; /** * @title 字段管理 @@ -30,19 +30,19 @@ class Attribute extends Admin { $this->attr[$key] = $value[0]; } $this->validate_rule = array( - 0 => '请选择', - 'regex' => '正则验证', - 'function' => '函数验证', - 'unique' => '唯一验证', - 'length' => '长度验证', - 'in' => '验证在范围内', - 'notin' => '验证不在范围内', - 'between' => '区间验证', + 0 => '请选择', + 'regex' => '正则验证', + 'function' => '函数验证', + 'unique' => '唯一验证', + 'length' => '长度验证', + 'in' => '验证在范围内', + 'notin' => '验证不在范围内', + 'between' => '区间验证', 'notbetween' => '不在区间验证', ); $this->auto_type = array(0 => '请选择', 'function' => '函数', 'field' => '字段', 'string' => '字符串'); - $this->the_time = array(0 => '请选择', '3' => '始 终', '1' => '新 增', '2' => '编 辑'); - $this->field = $this->getField(); + $this->the_time = array(0 => '请选择', '3' => '始 终', '1' => '新 增', '2' => '编 辑'); + $this->field = $this->getField(); } /** @@ -54,13 +54,13 @@ class Attribute extends Admin { return $this->error('非法操作!'); } $list = model('Attribute')->where('model_id', $model_id)->order('id desc')->paginate(25, false, array( - 'query' => $this->request->param() - )); + 'query' => $this->request->param(), + )); $data = array( - 'list' => $list, + 'list' => $list, 'model_id' => $model_id, - 'page' => $list->render(), + 'page' => $list->render(), ); $this->assign($data); $this->setMeta('字段管理'); @@ -81,7 +81,7 @@ class Attribute extends Admin { } } else { $data = array( - 'info' => array('model_id' => $model_id), + 'info' => array('model_id' => $model_id), 'fieldGroup' => $this->field, ); $this->assign($data); @@ -96,7 +96,7 @@ class Attribute extends Admin { */ public function edit($id = '', $model_id = '') { if ($this->request->isPost()) { - $result = $this->model->validate('attribute.edit')->save($this->request->param(), array('id'=>$id)); + $result = $this->model->validate('attribute.edit')->save($this->request->param(), array('id' => $id)); if ($result) { return $this->success("修改成功!", url('Attribute/index', array('model_id' => $model_id))); } else { @@ -105,7 +105,7 @@ class Attribute extends Admin { } else { $info = db('Attribute')->find($id); $data = array( - 'info' => $info, + 'info' => $info, 'fieldGroup' => $this->field, ); $this->assign($data); @@ -134,7 +134,7 @@ class Attribute extends Admin { return $this->error($this->model->getError()); } } - + //字段编辑所需字段 protected function getField() { return array( diff --git a/app/controller/admin/Channel.php b/app/controller/admin/Channel.php index 54d269c0..79e41d86 100644 --- a/app/controller/admin/Channel.php +++ b/app/controller/admin/Channel.php @@ -7,8 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; /** * @title 频道管理 @@ -26,9 +26,9 @@ class Channel extends Admin { public function index($type = 0) { /* 获取频道列表 */ //$map = array('status' => array('gt', -1), 'pid'=>$pid); - $map = array('status' => array('gt', -1)); + $map = array('status' => array('gt', -1)); if ($type) { - $map['type'] = $type; + $map['type'] = $type; } $list = db('Channel')->where($map)->order('sort asc,id asc')->column('*', 'id'); @@ -41,7 +41,7 @@ class Channel extends Admin { $data = array( 'tree' => $list, - 'type' => $type + 'type' => $type, ); $this->assign($data); $this->setMeta('导航管理'); @@ -64,7 +64,7 @@ class Channel extends Admin { public function add() { if ($this->request->isPost()) { $Channel = model('Channel'); - $data = $this->request->post(); + $data = $this->request->post(); if ($data) { $id = $Channel->save($data); if ($id) { @@ -100,7 +100,7 @@ class Channel extends Admin { public function edit($id = 0) { if ($this->request->isPost()) { $Channel = model('Channel'); - $data = $this->request->post(); + $data = $this->request->post(); if ($data) { if (false !== $Channel->save($data, array('id' => $data['id']))) { //记录行为 @@ -149,9 +149,9 @@ class Channel extends Admin { $map = array('id' => array('in', $id)); if (db('Channel')->where($map)->delete()) { - //删除category中的ismenu字段记录 - $map = array('ismenu' => array('in', $id)); - db('Category')->where($map)->setField('ismenu',0); + //删除category中的ismenu字段记录 + $map = array('ismenu' => array('in', $id)); + db('Category')->where($map)->setField('ismenu', 0); //记录行为 action_log('update_channel', 'channel', $id, session('user_auth.uid')); return $this->success('删除成功'); @@ -201,14 +201,14 @@ class Channel extends Admin { * @title 设置状态 */ public function setStatus() { - $id = array_unique((array) input('ids', 0)); + $id = array_unique((array) input('ids', 0)); $status = input('status', '0', 'trim'); if (empty($id)) { return $this->error('请选择要操作的数据!'); } - $map = array('id' => array('in', $id)); + $map = array('id' => array('in', $id)); $result = db('Channel')->where($map)->update(array('status' => $status)); if ($result) { return $this->success("操作成功!"); diff --git a/app/controller/admin/Client.php b/app/controller/admin/Client.php index 0edeb86b..ba8fdf99 100644 --- a/app/controller/admin/Client.php +++ b/app/controller/admin/Client.php @@ -7,8 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; /** * @title 客户端管理 @@ -23,70 +23,70 @@ class Client extends Admin { /** * @title 客户端列表 */ - public function index(){ + public function index() { $list = $this->model->paginate(25, false, array( - 'query' => $this->request->param() - )); + 'query' => $this->request->param(), + )); $data = array( - 'list' => $list, - 'page' => $list->render() + 'list' => $list, + 'page' => $list->render(), ); $this->assign($data); $this->setMeta('客户端列表'); return $this->fetch(); } - + /** * @title 添加客户端 */ - public function add(\think\Request $request){ + public function add(\think\Request $request) { if ($this->request->isPost()) { $data = $request->param(); $result = $this->model->validate(true)->save($data); if (false !== $result) { return $this->success('成功添加', url('client/index')); - }else{ + } else { return $this->error($this->model->getError()); } - }else{ - $info['appid'] = rand_string(10, 1); //八位数字appid - $info['appsecret'] = rand_string(32); //32位数字加字母秘钥 + } else { + $info['appid'] = rand_string(10, 1); //八位数字appid + $info['appsecret'] = rand_string(32); //32位数字加字母秘钥 $data = array( - 'info' => $info + 'info' => $info, ); $this->assign($data); $this->setMeta('添加客户端'); return $this->fetch('add'); } } - + /** * @title 编辑客户端 */ - public function edit(\think\Request $request){ + public function edit(\think\Request $request) { if ($this->request->isPost()) { $data = $request->param(); - $result = $this->model->validate(true)->save($data, array('id'=>$request->param('id'))); + $result = $this->model->validate(true)->save($data, array('id' => $request->param('id'))); if (false !== $result) { return $this->success('修改添加', url('client/index')); - }else{ + } else { return $this->error($this->model->getError()); } - }else{ + } else { $info = $this->model->where('id', $request->param('id'))->find(); $data = array( - 'info' => $info + 'info' => $info, ); $this->assign($data); $this->setMeta('编辑客户端'); return $this->fetch('add'); } } - + /** * @title 删除客户端 */ - public function del(\think\Request $request){ + public function del(\think\Request $request) { } } \ No newline at end of file diff --git a/app/controller/admin/Config.php b/app/controller/admin/Config.php index 94e1a8f6..fcfba6c4 100644 --- a/app/controller/admin/Config.php +++ b/app/controller/admin/Config.php @@ -7,8 +7,9 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; +use app\model\Config as ConfigM; /** * @title 配置管理 @@ -17,7 +18,7 @@ class Config extends Admin { public function _initialize() { parent::_initialize(); - $this->model = model('Config'); + $this->model = new ConfigM(); } /** @@ -26,9 +27,9 @@ class Config extends Admin { */ public function index() { $group = input('group', 0, 'trim'); - $name = input('name', '', 'trim'); + $name = input('name', '', 'trim'); /* 查询条件初始化 */ - $map = array('status' => 1); + $map = array('status' => 1); if ($group) { $map['group'] = $group; } @@ -38,17 +39,17 @@ class Config extends Admin { } $list = $this->model->where($map)->order('id desc')->paginate(25, false, array( - 'query' => $this->request->param() - )); + 'query' => $this->request->param(), + )); // 记录当前列表页的cookie Cookie('__forward__', $_SERVER['REQUEST_URI']); $data = array( - 'group' => config('config_group_list'), + 'group' => config('config_group_list'), 'config_type' => config('config_config_list'), - 'page' => $list->render(), - 'group_id' => $group, - 'list' => $list, + 'page' => $list->render(), + 'group_id' => $group, + 'list' => $list, ); $this->assign($data); @@ -62,7 +63,7 @@ class Config extends Admin { public function group($id = 1) { if ($this->request->isPost()) { $config = $this->request->post('config/a'); - $model = model('Config'); + $model = model('Config'); foreach ($config as $key => $value) { $model->where(array('name' => $key))->setField('value', $value); } @@ -71,12 +72,12 @@ class Config extends Admin { return $this->success("更新成功!"); } else { $type = config('config_group_list'); - $list = db("Config")->where(array('status' => 1, 'group' => $id))->field('id,name,title,extra,value,remark,type')->order('sort')->select(); + $list = (new ConfigM())->where(array('status' => 1, 'group' => $id))->field('id,name,title,extra,value,remark,type')->order('sort')->select(); if ($list) { - $this->assign('list', $list); + $this->data['list'] = $list; } - $this->assign('id', $id); - $this->setMeta($type[$id] . '设置'); + // $this->assign('id', $id); + // $this->setMeta($type[$id] . '设置'); return $this->fetch(); } } @@ -88,7 +89,7 @@ class Config extends Admin { public function add() { if ($this->request->isPost()) { $config = model('Config'); - $data = $this->request->post(); + $data = $this->request->post(); if ($data) { $id = $config->validate(true)->save($data); if ($id) { @@ -116,7 +117,7 @@ class Config extends Admin { public function edit($id = 0) { if ($this->request->isPost()) { $config = model('Config'); - $data = $this->request->post(); + $data = $this->request->post(); if ($data) { $result = $config->validate('Config.edit')->save($data, array('id' => $data['id'])); if (false !== $result) { @@ -224,9 +225,9 @@ class Config extends Admin { $pc = config('pc_themes'); $mobile = config('mobile_themes'); $data = array( - 'pc' => $pc, + 'pc' => $pc, 'mobile' => $mobile, - 'list' => $list, + 'list' => $list, ); $this->assign($data); @@ -238,12 +239,12 @@ class Config extends Admin { * @title 设置主题 * @return json */ - public function setthemes($name, $id){ + public function setthemes($name, $id) { $result = db('Config')->where('name', $name . '_themes')->setField('value', $id); if (false !== $result) { \think\Cache::clear(); return $this->success('设置成功!'); - }else{ + } else { return $this->error('设置失败!'); } } diff --git a/app/controller/admin/Content.php b/app/controller/admin/Content.php index b2c11aff..ac42b266 100644 --- a/app/controller/admin/Content.php +++ b/app/controller/admin/Content.php @@ -7,9 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; - +namespace app\controller\admin; +use app\controller\Admin; /** * @title 内容管理 @@ -20,7 +19,7 @@ class Content extends Admin { parent::_initialize(); $this->getContentMenu(); $this->model_id = $model_id = $this->request->param('model_id'); - $list = db('Model')->column('*', 'id'); + $list = db('Model')->column('*', 'id'); if (empty($list[$model_id])) { return $this->error("无此模型!"); @@ -43,14 +42,13 @@ class Content extends Admin { return $this->error("列表定义不正确!", url('admin/model/edit', array('id' => $this->modelInfo['id']))); } $grid_list = get_grid_list($this->modelInfo['list_grid']); - $order = "id desc"; - $map = $this->buildMap(); - $field = array_filter($grid_list['fields']); - + $order = "id desc"; + $map = $this->buildMap(); + $field = array_filter($grid_list['fields']); $list = $this->model->where($map)->order($order)->paginate($this->modelInfo['list_row'], false, array( - 'query' => $this->request->param() - )); + 'query' => $this->request->param(), + )); $data = array( 'grid' => $grid_list, @@ -86,7 +84,7 @@ class Content extends Admin { 'model_id' => $this->modelInfo['id'], ); $data = array( - 'info' => $info, + 'info' => $info, 'fieldGroup' => $this->getField($this->modelInfo), ); if ($this->modelInfo['template_add']) { @@ -106,7 +104,7 @@ class Content extends Admin { */ public function edit($id) { if ($this->request->isPost()) { - $result = $this->model->save($this->request->param(), array('id'=> $id)); + $result = $this->model->save($this->request->param(), array('id' => $id)); if ($result !== false) { //记录行为 action_log('update_content', 'content', $result, session('auth_user.uid')); @@ -123,8 +121,8 @@ class Content extends Admin { return $this->error($this->model->getError()); } $info['model_id'] = $this->modelInfo['id']; - $data = array( - 'info' => $info, + $data = array( + 'info' => $info, 'fieldGroup' => $this->getField($this->modelInfo), ); if ($this->modelInfo['template_edit']) { @@ -150,7 +148,7 @@ class Content extends Admin { } $map['id'] = array('IN', $id); - $result = $this->model->where($map)->delete(); + $result = $this->model->where($map)->delete(); if (false !== $result) { //记录行为 @@ -167,7 +165,7 @@ class Content extends Admin { */ public function status($id, $status) { $map['id'] = $id; - $result = $this->model->where($map)->setField('status', $status); + $result = $this->model->where($map)->setField('status', $status); if (false !== $result) { return $this->success("操作成功!"); } else { @@ -181,7 +179,7 @@ class Content extends Admin { */ public function settop($id, $is_top) { $map['id'] = $id; - $result = $this->model->where($map)->setField('is_top', $is_top); + $result = $this->model->where($map)->setField('is_top', $is_top); if (false !== $result) { return $this->success("操作成功!"); } else { @@ -205,7 +203,7 @@ class Content extends Admin { } //获得数组的第一条数组 - $rows = model('Attribute')->getFieldlist($map, 'id'); + $rows = model('Attribute')->getFieldlist($map, 'id'); if (!empty($rows)) { foreach ($rows as $key => $value) { $list[$value['group_id']][] = $value; @@ -213,7 +211,7 @@ class Content extends Admin { foreach ($field_group as $key => $value) { $fields[$value] = isset($list[$key]) ? $list[$key] : array(); } - }else{ + } else { $fields = array(); } return $fields; @@ -224,7 +222,7 @@ class Content extends Admin { * @return [array] [查询条件] */ protected function buildMap() { - $map = array(); + $map = array(); $data = $this->request->param(); foreach ($data as $key => $value) { if ($value) { diff --git a/app/controller/admin/Group.php b/app/controller/admin/Group.php index 451969df..aecfc65c 100644 --- a/app/controller/admin/Group.php +++ b/app/controller/admin/Group.php @@ -7,8 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; /** * @title 用户组管理 @@ -22,7 +22,7 @@ class Group extends Admin { public function _initialize() { parent::_initialize(); $this->group = model('AuthGroup'); - $this->rule = model('AuthRule'); + $this->rule = model('AuthRule'); } /** @@ -32,8 +32,8 @@ class Group extends Admin { $map['module'] = $type; $list = db('AuthGroup')->where($map)->order('id desc')->paginate(10, false, array( - 'query' => $this->request->param() - )); + 'query' => $this->request->param(), + )); $data = array( 'list' => $list, @@ -58,7 +58,7 @@ class Group extends Admin { } } else { $data = array( - 'info' => array('module' => $type, 'status' => 1), + 'info' => array('module' => $type, 'status' => 1), 'keyList' => $this->group->keyList, ); $this->assign($data); @@ -84,7 +84,7 @@ class Group extends Admin { } else { $info = $this->group->where(array('id' => $id))->find(); $data = array( - 'info' => $info, + 'info' => $info, 'keyList' => $this->group->keyList, ); $this->assign($data); @@ -93,14 +93,13 @@ class Group extends Admin { } } - /** * @title 编辑用户组单字段 */ public function editable() { - $pk = input('pk', '', 'trim,intval'); - $name = input('name', '', 'trim'); - $value = input('value', '', 'trim'); + $pk = input('pk', '', 'trim,intval'); + $name = input('name', '', 'trim'); + $value = input('value', '', 'trim'); $result = $this->group->where(array('id' => $pk))->setField($name, $value); if ($result) { return $this->success("删除成功!"); @@ -109,7 +108,6 @@ class Group extends Admin { } } - /** * @title 删除用户组 */ @@ -126,7 +124,6 @@ class Group extends Admin { } } - /** * @title 权限节点 */ @@ -134,8 +131,8 @@ class Group extends Admin { $map['module'] = $type; $list = db('AuthRule')->where($map)->order('id desc')->paginate(15, false, array( - 'query' => $this->request->param() - )); + 'query' => $this->request->param(), + )); $data = array( 'list' => $list, @@ -164,8 +161,8 @@ class Group extends Admin { return $this->error("非法操作!"); } if ($this->request->isPost()) { - $rule = $this->request->post('rule/a', array()); - $extend_rule = $this->request->post('extend_rule/a', array()); + $rule = $this->request->post('rule/a', array()); + $extend_rule = $this->request->post('extend_rule/a', array()); $extend_result = $rule_result = false; //扩展权限 $extend_data = array(); @@ -179,7 +176,7 @@ class Group extends Admin { $extend_result = db('AuthExtend')->insertAll($extend_data); } if ($rule) { - $rules = implode(',', $rule); + $rules = implode(',', $rule); $rule_result = $this->group->where(array('id' => $id))->setField('rules', $rules); } @@ -192,7 +189,7 @@ class Group extends Admin { $group = $this->group->where(array('id' => $id))->find(); $map['module'] = $group['module']; - $row = db('AuthRule')->where($map)->order('id desc')->select(); + $row = db('AuthRule')->where($map)->order('id desc')->select(); $list = array(); foreach ($row as $key => $value) { @@ -205,12 +202,12 @@ class Group extends Admin { ->select(); //扩展权限 $extend_auth = db('AuthExtend')->where(array('group_id' => $id, 'type' => 2))->column('extend_id'); - $data = array( - 'list' => $list, - 'model' => $model, + $data = array( + 'list' => $list, + 'model' => $model, 'extend_auth' => $extend_auth, - 'auth_list' => explode(',', $group['rules']), - 'id' => $id, + 'auth_list' => explode(',', $group['rules']), + 'id' => $id, ); $this->assign($data); $this->setMeta('授权'); @@ -231,7 +228,7 @@ class Group extends Admin { } } else { $data = array( - 'info' => array('module' => $type, 'status' => 1), + 'info' => array('module' => $type, 'status' => 1), 'keyList' => $this->rule->keyList, ); $this->assign($data); @@ -257,7 +254,7 @@ class Group extends Admin { } $info = $this->rule->find($id); $data = array( - 'info' => $info, + 'info' => $info, 'keyList' => $this->rule->keyList, ); $this->assign($data); diff --git a/app/controller/admin/Index.php b/app/controller/admin/Index.php index 212392a9..67094fe1 100755 --- a/app/controller/admin/Index.php +++ b/app/controller/admin/Index.php @@ -10,6 +10,7 @@ namespace app\controller\admin; use app\controller\Admin; use app\model\Member; +use think\facade\Session; /** * @title 后端公共模块 @@ -39,20 +40,14 @@ class Index extends Admin { return $this->error('验证码错误!', ''); } - $userinfo = $user->login($this->request); - if ($userinfo) { - // return $this->success('登录成功!', url('admin/index/index')); - } else { - print_r($user->error); - // switch ($uid) { - // case -1:$error = '用户不存在或被禁用!'; - // break; //系统级别禁用 - // case -2:$error = '密码错误!'; - // break; - // default:$error = '未知错误!'; - // break; // 0-接口参数错误(调试阶段使用) - // } - return $this->error($error, ''); + try { + $userinfo = $user->login($this->request); + if ($userinfo) { + Session::set('userInfo', $userinfo); + return $this->success('登录成功!', url('/admin/index/index')); + } + } catch (Exception $e) { + return $this->error($e->getError(), ''); } } else { return $this->fetch(); diff --git a/app/controller/admin/Link.php b/app/controller/admin/Link.php index 59a03e4c..0557e5a4 100644 --- a/app/controller/admin/Link.php +++ b/app/controller/admin/Link.php @@ -7,8 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; /** * @title 友情链接 @@ -23,9 +23,9 @@ class Link extends Admin { $map = array(); $order = "id desc"; - $list = db('Link')->where($map)->order($order)->paginate(10, false, array( - 'query' => $this->request->param() - )); + $list = db('Link')->where($map)->order($order)->paginate(10, false, array( + 'query' => $this->request->param(), + )); $data = array( 'list' => $list, @@ -64,13 +64,12 @@ class Link extends Admin { } } - /** * @title 修改链接 */ public function edit() { $link = model('Link'); - $id = input('id', '', 'trim,intval'); + $id = input('id', '', 'trim,intval'); if ($this->request->isPost()) { $data = input('post.'); if ($data) { @@ -84,12 +83,12 @@ class Link extends Admin { return $this->error($link->getError()); } } else { - $map = array('id' => $id); + $map = array('id' => $id); $info = db('Link')->where($map)->find(); $data = array( 'keyList' => $link->keyList, - 'info' => $info, + 'info' => $info, ); $this->assign($data); $this->setMeta("编辑友链"); @@ -107,7 +106,7 @@ class Link extends Admin { } $link = db('Link'); - $map = array('id' => array('IN', $id)); + $map = array('id' => array('IN', $id)); $result = $link->where($map)->delete(); if ($result) { return $this->success("删除成功!"); diff --git a/app/controller/admin/Menu.php b/app/controller/admin/Menu.php index 424d6149..42f5948e 100644 --- a/app/controller/admin/Menu.php +++ b/app/controller/admin/Menu.php @@ -7,9 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; - +namespace app\controller\admin; +use app\controller\Admin; /** * @title 菜单管理 @@ -24,9 +23,9 @@ class Menu extends Admin { * @title 菜单列表 */ public function index() { - $map = array(); + $map = array(); $title = trim(input('get.title')); - $list = db("Menu")->where($map)->field(true)->order('sort asc,id asc')->column('*', 'id'); + $list = db("Menu")->where($map)->field(true)->order('sort asc,id asc')->column('*', 'id'); int_to_string($list, array('hide' => array(1 => '是', 0 => '否'), 'is_dev' => array(1 => '是', 0 => '否'))); if (!empty($list)) { @@ -58,7 +57,7 @@ class Menu extends Admin { if ($this->request->isPost()) { $Menu = model('Menu'); $data = input('post.'); - $id = $Menu->save($data); + $id = $Menu->save($data); if ($id) { session('admin_menu_list', null); //记录行为 @@ -70,7 +69,7 @@ class Menu extends Admin { } else { $this->assign('info', array('pid' => input('pid'))); $menus = db('Menu')->select(); - $tree = new \com\Tree(); + $tree = new \com\Tree(); $menus = $tree->toFormatTree($menus); if (!empty($menus)) { $menus = array_merge(array(0 => array('id' => 0, 'title_show' => '顶级菜单')), $menus); @@ -103,9 +102,9 @@ class Menu extends Admin { } else { $info = array(); /* 获取数据 */ - $info = db('Menu')->field(true)->find($id); + $info = db('Menu')->field(true)->find($id); $menus = db('Menu')->field(true)->select(); - $tree = new \com\Tree(); + $tree = new \com\Tree(); $menus = $tree->toFormatTree($menus); $menus = array_merge(array(0 => array('id' => 0, 'title_show' => '顶级菜单')), $menus); @@ -171,10 +170,10 @@ class Menu extends Admin { $add_pid = $menuModel->add( array( 'title' => $value['title'], - 'url' => $value['url'], - 'pid' => $pid, - 'hide' => isset($value['hide']) ? (int) $value['hide'] : 0, - 'tip' => isset($value['tip']) ? $value['tip'] : '', + 'url' => $value['url'], + 'pid' => $pid, + 'hide' => isset($value['hide']) ? (int) $value['hide'] : 0, + 'tip' => isset($value['tip']) ? $value['tip'] : '', 'group' => $value['group'], ) ); @@ -186,8 +185,8 @@ class Menu extends Admin { public function import() { if ($this->request->isPost()) { - $tree = input('post.tree'); - $lists = explode(PHP_EOL, $tree); + $tree = input('post.tree'); + $lists = explode(PHP_EOL, $tree); $menuModel = db('Menu'); if ($lists == array()) { return $this->error('请按格式填写批量导入的菜单,至少一个菜单'); @@ -197,14 +196,14 @@ class Menu extends Admin { $record = explode('|', $value); if (count($record) == 4) { $menuModel->add(array( - 'title' => $record[0], - 'url' => $record[1], - 'pid' => $record[2], - 'sort' => 0, - 'hide' => 0, - 'tip' => '', + 'title' => $record[0], + 'url' => $record[1], + 'pid' => $record[2], + 'sort' => 0, + 'hide' => 0, + 'tip' => '', 'is_dev' => 0, - 'group' => $record[3], + 'group' => $record[3], )); } } diff --git a/app/controller/admin/Model.php b/app/controller/admin/Model.php index 0b86e51d..f2003245 100644 --- a/app/controller/admin/Model.php +++ b/app/controller/admin/Model.php @@ -7,8 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; /** * @title 模型管理 @@ -29,9 +29,9 @@ class Model extends Admin { $map = array('status' => array('gt', -1)); $order = "id desc"; - $list = $this->model->where($map)->order($order)->paginate(10, false, array( - 'query' => $this->request->param() - )); + $list = $this->model->where($map)->order($order)->paginate(10, false, array( + 'query' => $this->request->param(), + )); $data = array( 'list' => $list, @@ -98,9 +98,9 @@ class Model extends Admin { $fields = array(); } $data = array( - 'info' => $info, + 'info' => $info, 'field_group' => $field_group, - 'fields' => $fields, + 'fields' => $fields, ); $this->assign($data); $this->setMeta('编辑模型'); diff --git a/app/controller/admin/Seo.php b/app/controller/admin/Seo.php index e49995c6..5e83d6b6 100644 --- a/app/controller/admin/Seo.php +++ b/app/controller/admin/Seo.php @@ -7,8 +7,8 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; /** * @title SEO管理 @@ -20,7 +20,7 @@ class Seo extends Admin { public function _initialize() { parent::_initialize(); - $this->seo = model('SeoRule'); + $this->seo = model('SeoRule'); $this->rewrite = model('Rewrite'); } @@ -32,8 +32,8 @@ class Seo extends Admin { $map = array('status' => array('EGT', 0)); $list = $this->seo->where($map)->order('sort asc')->paginate(10, false, array( - 'query' => $this->request->param() - )); + 'query' => $this->request->param(), + )); $data = array( 'list' => $list, @@ -49,7 +49,7 @@ class Seo extends Admin { */ public function add() { if ($this->request->isPost()) { - $data = $this->request->post(); + $data = $this->request->post(); $result = $this->seo->save($data); if ($result) { return $this->success("添加成功!"); @@ -71,7 +71,7 @@ class Seo extends Admin { */ public function edit($id = null) { if ($this->request->isPost()) { - $data = $this->request->post(); + $data = $this->request->post(); $result = $this->seo->save($data, array('id' => $data['id'])); if (false !== $result) { return $this->success("修改成功!"); @@ -79,10 +79,10 @@ class Seo extends Admin { return $this->error("修改失败!"); } } else { - $id = input('id', '', 'trim,intval'); + $id = input('id', '', 'trim,intval'); $info = $this->seo->where(array('id' => $id))->find(); $data = array( - 'info' => $info, + 'info' => $info, 'keyList' => $this->seo->keyList, ); $this->assign($data); @@ -155,10 +155,10 @@ class Seo extends Admin { return $this->error(model('Rewrite')->getError()); } } else { - $id = input('id', '', 'trim,intval'); + $id = input('id', '', 'trim,intval'); $info = db('Rewrite')->where(array('id' => $id))->find(); $data = array( - 'info' => $info, + 'info' => $info, 'keyList' => $this->rewrite->keyList, ); $this->assign($data); diff --git a/app/controller/admin/Upload.php b/app/controller/admin/Upload.php index 8a27854e..c44a0476 100644 --- a/app/controller/admin/Upload.php +++ b/app/controller/admin/Upload.php @@ -7,14 +7,14 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; class Upload extends Admin { public function _empty() { $controller = controller('common/Upload'); - $action = $this->request->action(); + $action = $this->request->action(); return $controller->$action(); } } \ No newline at end of file diff --git a/app/controller/admin/User.php b/app/controller/admin/User.php index 9a15e3b8..d85688d3 100644 --- a/app/controller/admin/User.php +++ b/app/controller/admin/User.php @@ -7,9 +7,10 @@ // | Author: molong // +---------------------------------------------------------------------- -namespace app\admin\controller; -use app\common\controller\Admin; +namespace app\controller\admin; +use app\controller\Admin; +use app\model\Member; /** * @title 用户管理 */ @@ -19,29 +20,25 @@ class User extends Admin { * @title 用户列表 * @author 麦当苗儿 */ - public function index() { + public function index(Member $member) { $param = $this->request->param(); - $map['status'] = array('egt', 0); + $map[] = ['status', '>=', 0]; if (isset($param['nickname']) && $param['nickname']) { $map['nickname'] = array('like', '%' . $param['nickname'] . '%'); - } + } if (isset($param['username']) && $param['username']) { $map['username'] = array('like', '%' . (string) $param['nickname'] . '%'); } $order = "uid desc"; - $list = model('Member')->where($map)->order($order) + $list = $member->where($map)->order($order) ->paginate(15, false, array( - 'param' => $param + 'param' => $param, )); - $data = array( - 'list' => $list, - 'page' => $list->render(), - 'param' => $param - ); - $this->assign($data); - $this->setMeta('用户信息'); + $this->data['list'] = $list; + $this->data['page'] = $list->render(); + return $this->fetch(); } @@ -90,7 +87,7 @@ class User extends Admin { $info = $this->getUserinfo(); $data = array( - 'info' => $info, + 'info' => $info, 'keyList' => $model->editfield, ); $this->assign($data); @@ -111,14 +108,13 @@ class User extends Admin { return $this->success('删除用户成功!'); } - /** * @title 用户授权 * @author colin */ public function auth() { $access = model('AuthGroupAccess'); - $group = model('AuthGroup'); + $group = model('AuthGroup'); if ($this->request->isPost()) { $uid = input('uid', '', 'trim,intval'); $access->where(array('uid' => $uid))->delete(); @@ -127,7 +123,7 @@ class User extends Admin { $group_id = input($key, '', 'trim,intval'); if ($group_id) { $add = array( - 'uid' => $uid, + 'uid' => $uid, 'group_id' => $group_id, ); $access->save($add); @@ -135,8 +131,8 @@ class User extends Admin { } return $this->success("设置成功!"); } else { - $uid = input('id', '', 'trim,intval'); - $row = $group::select(); + $uid = input('id', '', 'trim,intval'); + $row = $group::select(); $auth = $access::where(array('uid' => $uid))->select(); $auth_list = array(); @@ -147,9 +143,9 @@ class User extends Admin { $list[$value['module']][] = $value; } $data = array( - 'uid' => $uid, + 'uid' => $uid, 'auth_list' => $auth_list, - 'list' => $list, + 'list' => $list, ); $this->assign($data); $this->setMeta("用户分组"); @@ -166,9 +162,9 @@ class User extends Admin { */ private function getUserinfo($uid = null, $pass = null, $errormsg = null) { $user = model('Member'); - $uid = $uid ? $uid : input('id'); + $uid = $uid ? $uid : input('id'); //如果无UID则修改当前用户 - $uid = $uid ? $uid : session('user_auth.uid'); + $uid = $uid ? $uid : session('user_auth.uid'); $map['uid'] = $uid; if ($pass != null) { unset($map); @@ -199,13 +195,13 @@ class User extends Admin { //密码验证 $User = new UserApi(); - $uid = $User->login(UID, $password, 4); + $uid = $User->login(UID, $password, 4); if ($uid == -2) { return $this->error('密码不正确'); } $Member = model('Member'); - $data = $Member->create(array('nickname' => $nickname)); + $data = $Member->create(array('nickname' => $nickname)); if (!$data) { return $this->error($Member->getError()); } @@ -213,7 +209,7 @@ class User extends Admin { $res = $Member->where(array('uid' => $uid))->save($data); if ($res) { - $user = session('user_auth'); + $user = session('user_auth'); $user['username'] = $data['nickname']; session('user_auth', $user); session('user_auth_sign', data_auth_sign($user)); diff --git a/app/model/Member.php b/app/model/Member.php index e3697dd7..5a18ccbc 100644 --- a/app/model/Member.php +++ b/app/model/Member.php @@ -68,11 +68,11 @@ class Member extends Model { $map['mobile'] = $username; break; default: - $this->error = "参数错误"; + throw new \think\Exception('参数错误', 10006); return false; //参数错误 } if (!$username) { - $this->error = "用户名不能为空"; + throw new \think\Exception('用户名不能为空', 10006); return false; } @@ -84,11 +84,11 @@ class Member extends Model { $this->record($user); return $user->append(array('access_token', 'avatar'))->visible($this->loginVisible)->toArray(); //登录成功,返回用户信息 } else { - $this->error = "密码错误"; + throw new \think\Exception('密码错误', 10006); return false; //密码错误 } } else { - $this->error = "用户不存在或被禁用"; + throw new \think\Exception('用户不存在或被禁用', 10006); return false; } } diff --git a/app/model/Menu.php b/app/model/Menu.php index 0e7ea667..53b1cb7c 100644 --- a/app/model/Menu.php +++ b/app/model/Menu.php @@ -13,7 +13,7 @@ namespace app\model; * 菜单模型类 * @author molong */ -class Menu extends \app\common\model\Base { +class Menu extends \think\Model { protected $type = array( 'id' => 'integer', diff --git a/extend/.gitignore b/extend/.gitignore deleted file mode 100755 index c96a04f0..00000000 --- a/extend/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/extend/doc/Doc.php b/extend/doc/Doc.php new file mode 100644 index 00000000..23f61c7c --- /dev/null +++ b/extend/doc/Doc.php @@ -0,0 +1,135 @@ + +// +---------------------------------------------------------------------- + +namespace doc; + +Class Doc{ + + private $params = array (); + /** + * 解析注释 + * @param string $doc + * @return array + */ + public function parse($doc = '') { + if ($doc == '' || !$doc) { + return $this->params; + } + // Get the comment + if (preg_match ( '#^/\*\*(.*)\*/#s', $doc, $comment ) === false) + return $this->params; + $comment = trim ( $comment [1] ); + // Get all the lines and strip the * from the first character + if (preg_match_all ( '#^\s*\*(.*)#m', $comment, $lines ) === false) + return $this->params; + $this->parseLines ( $lines [1] ); + return $this->params; + } + + private function parseLines($lines) { + $desc = []; + foreach ( $lines as $line ) { + $parsedLine = $this->parseLine ( $line ); // Parse the line + if ($parsedLine === false && ! isset ( $this->params ['description'] )) { + if (isset ( $desc )) { + // Store the first line in the short description + $this->params ['description'] = implode ( PHP_EOL, $desc ); + } + $desc = array (); + } elseif ($parsedLine !== false) { + $desc [] = $parsedLine; // Store the line in the long description + } + } + $desc = implode ( ' ', $desc ); + if (! empty ( $desc )) + $this->params ['long_description'] = $desc; + } + + private function parseLine($line) { + // trim the whitespace from the line + $line = trim ( $line ); + if (empty ( $line )) + return false; // Empty line + if (strpos ( $line, '@' ) === 0) { + if (strpos ( $line, ' ' ) > 0) { + // Get the parameter name + $param = substr ( $line, 1, strpos ( $line, ' ' ) - 1 ); + $value = substr ( $line, strlen ( $param ) + 2 ); // Get the value + } else { + $param = substr ( $line, 1 ); + $value = ''; + } + // Parse the line and return false if the parameter is valid + if ($this->setParam ( $param, $value )) + return false; + } + return $line; + } + + private function setParam($param, $value) { + if ($param == 'param' || $param == 'header') + $value = $this->formatParam( $value ); + if ($param == 'class') + list ( $param, $value ) = $this->formatClass ( $value ); + if($param == 'return' || $param == 'param' || $param == 'header'){ + $this->params [$param][] = $value; + }else if (empty ( $this->params [$param] )) { + $this->params [$param] = $value; + } else { + $this->params [$param] = $this->params [$param] . $value; + } + return true; + } + + private function formatClass($value) { + $r = preg_split ( "[\(|\)]", $value ); + if (is_array ( $r )) { + $param = $r [0]; + parse_str ( $r [1], $value ); + foreach ( $value as $key => $val ) { + $val = explode ( ',', $val ); + if (count ( $val ) > 1) + $value [$key] = $val; + } + } else { + $param = 'Unknown'; + } + return array ( + $param, + $value + ); + } + + private function formatParam($string) { + $string = $string." "; + if(preg_match_all('/(\w+):(.*?)[\s\n]/s', $string, $meatchs)){ + $param = []; + foreach ($meatchs[1] as $key=>$value){ + $param[$meatchs[1][$key]] = $this->getParamType($meatchs[2][$key]); + } + return $param; + }else{ + return ''.$string; + } + } + private function getParamType($type){ + $typeMaps = [ + 'string' => '字符串', + 'int' => '整型', + 'float' => '浮点型', + 'boolean' => '布尔型', + 'date' => '日期', + 'array' => '数组', + 'fixed' => '固定值', + 'enum' => '枚举类型', + 'object' => '对象', + ]; + return array_key_exists($type,$typeMaps) ? $typeMaps[$type] : $type; + } +} \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico index e71815a6618c6ef19c78d27840b8995fb2521499..08e450025ce384de236ffc48eb52429b8f70196d 100755 GIT binary patch literal 9662 zcmeI2e{2(F7{}k1W*c*Elbo(;Iu)Ek~(^x077nUTooQ9+=&NAHO-vVP2A4ZAm0>i5{P zQy;{QpZbB$p@6c>>&6ospNBuYxblnOuL<(olHjY`|3Usv#DUS$Ry_&)+Sfd96X)?& zJuq)U>z3W~TR-0ZMC+Ey1*bpSn8(}JAqNyw|IpWzMqxv$`&Mmg)9qgn3;i*P1JB(6 zo`FdVKe+nA`s0&lHm_fFvLgEx@B7AW2SS)Z*fHMU{GpC4sy~^WarpX+kGTKZiM-Su z{anC*R6RdsU*7!AqhsJ{KDD^sn=sYY_b%qqrF|Zn`2(LiUrW#osiH&9Pk&5Fa|aG% zJ!r_WAElz?x7whuHI19$aoLY55=_kFQEVoS0O&e%K`z=Y`airaKqa zttI{Z#Vs3C7M!kJhP<<5UTf8{e7^b;%rDg+ysehOA^()kI&^Km?d#82Q$(HW>Md8d zj-uy(=G2GzVEz`YLgam8`2L03=icN-Ve68;O`*C@X%bHzIGc(bi`;U*dP6(^>nGmJ z1owCFuZlWpIKRY$_?+gtxmt-kybb%r$yoDKX85}&vcJP?hsgC0*uDv8Rr-u;_QafD zb6u+7f2@hgjlK#c=I}PGpPKQ=|8Uctb2P_#U{Auo6Zu6nb8A`n2ZA{vO&(X2BLcP&NU;jz!Pt2A%2XF%1O)C}`~2h|>!%Uw;M#r3t%a(unVTKN$pfu*aDCo`r&*ES*UEn9We zG}n4%9p(}Gv0+sFQa?M006PZe3Sl3~q%m%|s1dfVL9wZh&o<@{ofB)Uwm-SpLk> zR6nb!v4huW%KuT+(~KYfNBhtU6Tz*lv0 zywUHh(HYh|?z1c0@67)r)xuph=31|s^q9qZIaF(7Oe45WI&CDTbSz3QLVUzvCuxLq zP)#JHnd$^W>{JcmnuSw1P89!^G)oli^cdPKYlo~pNk0(>sLnL(lr&vdV%RDjlhASS zJTcVB?ZJLzf+*dGq{;e%Nbk?MnSy74&~ehl4q1cTS)#0ivik3%Lw0GrG%+|{qO22S eHONYAGEbr?jW^0qLBBQ2e(azMzcN2F?tcJ9+;p7) literal 1150 zcmbVMSx8i26uv?4_SAEaJq7BFqqJE;Q9TBc5JYcLIgSmPnyr-jk`K{>ZB(>aLWVXo z*9E63a&I$RrZR03EEi&&_1^#9`}O_*AViPd;mm*e&-u>z&UX%1)0XhJY?;RY723X~ znzmfiw3Reo@g{fAL(}N{_i=@Ma0M%r6$X8HFcE zpG~1@_%Y6ow1ksJIN%eE0)m_g-8Gd#K%-r;7XvI$t0gLrlUMS(*o zV$Y+$Ct(SJ+L5c+)7OmI%nVG$!vbteaep>7ij6%r*#F`@;?!a~HIJfDIkr7LrT7TO z8Pus^>>;*w*WwO!6s7@#wJgVkVE+^G7)ra2;Ldm_p8Ob6`0br_NQk8JTkP3k{J^jG z*cCa8vT!3JGaq0ucb3{&JkLiTVfXWMD5q9ZyH%ZD)V;jPIT^6ouVd%VG`X~V*0H+F zhl^v6kP#Mn+6Yg-!rHDH>fs|^>X)1U?nncMSj%CIp#G9el3d=+e!&L43iV_6ITI5d zQv>h>y$V~X^k*JwD7m;pl{iR^$K%uN!-g$vq?qse=KxBm_3+$BoO#pw7gpx+aR#|L z%6Dm{!D`%_jIeKm8ajyn9!EZFoOpW+Tl5oZR|^>D;?7A9ZiV-%JuQ#*owco@x{a zD-|ENtov7tOFzK5r}KRMSHhkEb!7aa$$nhqBKuHtV!cJ5I+?Si!w-Hm{`)ye
diff --git a/view/admin/action/index.html b/view/admin/action/index.html index 27475554..0d397892 100644 --- a/view/admin/action/index.html +++ b/view/admin/action/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/action/log.html b/view/admin/action/log.html index e4cbd832..b049f84b 100644 --- a/view/admin/action/log.html +++ b/view/admin/action/log.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/ad/index.html b/view/admin/ad/index.html index 56e723e6..5807c3c8 100644 --- a/view/admin/ad/index.html +++ b/view/admin/ad/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/ad/lists.html b/view/admin/ad/lists.html index edb02c1e..4ea1df79 100644 --- a/view/admin/ad/lists.html +++ b/view/admin/ad/lists.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/addons/add.html b/view/admin/addons/add.html index 71a35457..ae1c2da9 100644 --- a/view/admin/addons/add.html +++ b/view/admin/addons/add.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/addons/hooks.html b/view/admin/addons/hooks.html index 379f76d4..1ca2e82f 100644 --- a/view/admin/addons/hooks.html +++ b/view/admin/addons/hooks.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/addons/index.html b/view/admin/addons/index.html index 4e6e8283..fd161fba 100644 --- a/view/admin/addons/index.html +++ b/view/admin/addons/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/attribute/index.html b/view/admin/attribute/index.html index 485027aa..8b496f6f 100644 --- a/view/admin/attribute/index.html +++ b/view/admin/attribute/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/category/edit.html b/view/admin/category/edit.html index e3c88d75..1bdac53b 100644 --- a/view/admin/category/edit.html +++ b/view/admin/category/edit.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/category/edit_channel.html b/view/admin/category/edit_channel.html index aa1a713e..81a50a9d 100644 --- a/view/admin/category/edit_channel.html +++ b/view/admin/category/edit_channel.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/category/index.html b/view/admin/category/index.html index 487c23b3..da86e1ec 100644 --- a/view/admin/category/index.html +++ b/view/admin/category/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/category/operate.html b/view/admin/category/operate.html index 576e313d..4e51b688 100644 --- a/view/admin/category/operate.html +++ b/view/admin/category/operate.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/channel/edit.html b/view/admin/channel/edit.html index d4681b2b..385bd74a 100644 --- a/view/admin/channel/edit.html +++ b/view/admin/channel/edit.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/channel/index.html b/view/admin/channel/index.html index 805e37ea..75dd65c7 100644 --- a/view/admin/channel/index.html +++ b/view/admin/channel/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/channel/sort.html b/view/admin/channel/sort.html index 03bcdacb..8210cc7c 100644 --- a/view/admin/channel/sort.html +++ b/view/admin/channel/sort.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/client/add.html b/view/admin/client/add.html index bdb93ec2..ae262376 100644 --- a/view/admin/client/add.html +++ b/view/admin/client/add.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/client/index.html b/view/admin/client/index.html index ab10f9ee..9058cb6e 100644 --- a/view/admin/client/index.html +++ b/view/admin/client/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/config/edit.html b/view/admin/config/edit.html index a0c8dc12..b0305ee6 100644 --- a/view/admin/config/edit.html +++ b/view/admin/config/edit.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/config/group.html b/view/admin/config/group.html index bec7485b..6eb2e912 100644 --- a/view/admin/config/group.html +++ b/view/admin/config/group.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/config/index.html b/view/admin/config/index.html index d5f8824d..a5e269b4 100644 --- a/view/admin/config/index.html +++ b/view/admin/config/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/config/themes.html b/view/admin/config/themes.html index 672e3760..aa9571cc 100644 --- a/view/admin/config/themes.html +++ b/view/admin/config/themes.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/content/index.html b/view/admin/content/index.html index c7650b14..a5f18093 100644 --- a/view/admin/content/index.html +++ b/view/admin/content/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/database/export.html b/view/admin/database/export.html index 217243ac..c52e283d 100644 --- a/view/admin/database/export.html +++ b/view/admin/database/export.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/database/import.html b/view/admin/database/import.html index 2e1c02d7..fd48bcc0 100644 --- a/view/admin/database/import.html +++ b/view/admin/database/import.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/form/attr.html b/view/admin/form/attr.html index 57b1df84..323ff387 100644 --- a/view/admin/form/attr.html +++ b/view/admin/form/attr.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/form/detail_alumn.html b/view/admin/form/detail_alumn.html index 7a28c935..a999e500 100644 --- a/view/admin/form/detail_alumn.html +++ b/view/admin/form/detail_alumn.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/form/index.html b/view/admin/form/index.html index 59b94325..3b5dcc74 100644 --- a/view/admin/form/index.html +++ b/view/admin/form/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/form/list_alumn.html b/view/admin/form/list_alumn.html index f22fc779..a74e366a 100644 --- a/view/admin/form/list_alumn.html +++ b/view/admin/form/list_alumn.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/group/access.html b/view/admin/group/access.html index a31a2a78..dff2a424 100644 --- a/view/admin/group/access.html +++ b/view/admin/group/access.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/group/auth.html b/view/admin/group/auth.html index 12f2529f..bf653420 100644 --- a/view/admin/group/auth.html +++ b/view/admin/group/auth.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/group/index.html b/view/admin/group/index.html index 708bbc35..16b49992 100644 --- a/view/admin/group/index.html +++ b/view/admin/group/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/link/index.html b/view/admin/link/index.html index 34c4c11a..5d5f1698 100644 --- a/view/admin/link/index.html +++ b/view/admin/link/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/menu/edit.html b/view/admin/menu/edit.html index 077cced5..b2a48fe8 100644 --- a/view/admin/menu/edit.html +++ b/view/admin/menu/edit.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/menu/import.html b/view/admin/menu/import.html index 78626a34..c8bd3261 100644 --- a/view/admin/menu/import.html +++ b/view/admin/menu/import.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/menu/index.html b/view/admin/menu/index.html index aa0ec07d..052ff89b 100644 --- a/view/admin/menu/index.html +++ b/view/admin/menu/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/menu/sort.html b/view/admin/menu/sort.html index 944cf140..113ce62d 100644 --- a/view/admin/menu/sort.html +++ b/view/admin/menu/sort.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/model/add.html b/view/admin/model/add.html index 9c92b6b7..a37f884e 100644 --- a/view/admin/model/add.html +++ b/view/admin/model/add.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/model/edit.html b/view/admin/model/edit.html index 2da957e1..961f7f5a 100644 --- a/view/admin/model/edit.html +++ b/view/admin/model/edit.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="style"} {/block} diff --git a/view/admin/model/index.html b/view/admin/model/index.html index 98d0a790..283fd274 100644 --- a/view/admin/model/index.html +++ b/view/admin/model/index.html @@ -1,4 +1,4 @@ -{extend name="public/base"/} +{extend name="admin/public/base"/} {block name="body"}
diff --git a/view/admin/public/base.html b/view/admin/public/base.html index 5d6209f2..76352489 100644 --- a/view/admin/public/base.html +++ b/view/admin/public/base.html @@ -11,12 +11,12 @@