From 33b581dcdca656615886eaaf038786384e6a1309 Mon Sep 17 00:00:00 2001 From: hdm Date: Tue, 31 Aug 2021 23:40:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E7=99=BB=E5=BD=95=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E7=9A=84=E6=A0=BC=E5=BC=8F=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?api=E8=AF=B7=E6=B1=82=E6=8E=A5=E5=8F=A3=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Admin.php | 12 ++-- app/admin/controller/Article.php | 14 +++-- app/admin/controller/Login.php | 2 +- app/admin/controller/Menu.php | 14 +++-- app/admin/controller/Role.php | 16 ----- app/admin/controller/Rule.php | 22 +++++-- app/admin/validate/AdminCheck.php | 27 ++++++--- app/admin/validate/ArticleCateCheck.php | 10 +--- app/admin/validate/ArticleCheck.php | 6 +- app/admin/validate/ConfCheck.php | 2 +- app/admin/validate/GroupCheck.php | 4 +- app/admin/validate/KeywordsCheck.php | 20 +------ app/admin/validate/MenuCheck.php | 8 +-- app/admin/validate/NavCheck.php | 4 +- app/admin/validate/RuleCheck.php | 8 +-- app/admin/validate/SitemapCateCheck.php | 2 +- app/admin/validate/SlideCheck.php | 4 +- app/admin/view/admin/add.html | 6 +- app/admin/view/article/add.html | 24 ++++---- app/admin/view/article/cate.html | 9 ++- app/admin/view/article/edit.html | 24 ++++---- app/admin/view/login/index.html | 4 +- app/admin/view/menu/index.html | 10 ++-- app/admin/view/rule/index.html | 10 ++-- app/home/controller/Login.php | 3 +- app/home/validate/UserCheck.php | 11 +++- app/home/view/common/header.html | 2 +- app/home/view/index/index.html | 76 ++++++++++++++++++++++++ app/home/view/index/logs.html | 27 +++++++++ app/home/view/login/index.html | 2 +- app/install/data/gougucms.sql | 6 +- public/index.php | 6 +- public/static/home/css/common.css | 19 +++--- public/static/home/css/index.css | 26 ++++++++ public/static/home/images/actrcle.png | Bin 0 -> 3969 bytes public/static/home/images/data.png | Bin 0 -> 5596 bytes public/static/home/images/function.png | Bin 0 -> 11253 bytes public/static/home/images/system.png | Bin 0 -> 5307 bytes public/static/home/images/user.png | Bin 0 -> 7473 bytes 39 files changed, 287 insertions(+), 153 deletions(-) create mode 100644 public/static/home/images/actrcle.png create mode 100644 public/static/home/images/data.png create mode 100644 public/static/home/images/function.png create mode 100644 public/static/home/images/system.png create mode 100644 public/static/home/images/user.png diff --git a/app/admin/controller/Admin.php b/app/admin/controller/Admin.php index 08bdea3..71f8de5 100644 --- a/app/admin/controller/Admin.php +++ b/app/admin/controller/Admin.php @@ -27,6 +27,7 @@ class Admin extends BaseController if (!empty($param['keywords'])) { $where[] = ['id|username|nickname|desc|mobile', 'like', '%' . $param['keywords'] . '%']; } + $where[] = ['status','>=',0]; $rows = empty($param['limit']) ? get_config(app . page_size) : $param['limit']; $admin = AdminList::where($where) ->order('create_time asc') @@ -212,11 +213,14 @@ class Admin extends BaseController public function delete() { $id = get_params("id"); - if ($id == 1) { - return to_assign(0, "系统拥有者,无法删除"); + if($id == 1){ + return to_assign(1, "超级管理员,不能删除"); } - if (Db::name('Admin')->delete($id) !== false) { - add_log('delete', $id, []); + $data['status'] = '-1'; + $data['id'] = $id; + $data['update_time'] = time(); + if (Db::name('Admin')->update($data) !== false) { + add_log('delete', $id); return to_assign(1, "删除管理员成功"); } else { return to_assign(0, "删除失败"); diff --git a/app/admin/controller/Article.php b/app/admin/controller/Article.php index 116c0b3..407ebc3 100644 --- a/app/admin/controller/Article.php +++ b/app/admin/controller/Article.php @@ -44,15 +44,17 @@ class Article extends BaseController if (request()->isAjax()) { $param = get_params(); if (!empty($param['id']) && $param['id'] > 0) { - try { - validate(ArticleCateCheck::class)->scene('edit')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(0, $e->getError()); - } $data[$param['field']] = $param['value']; $data['id'] = $param['id']; $data['update_time'] = time(); + if(!empty($data['title'])){ + try { + validate(ArticleCateCheck::class)->scene('edit')->check($data); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(0, $e->getError()); + } + } $res = ArticleCate::strict(false)->field(true)->update($data); if ($res) { add_log('edit', $data['id'], $data); diff --git a/app/admin/controller/Login.php b/app/admin/controller/Login.php index d7e9753..b153eb5 100644 --- a/app/admin/controller/Login.php +++ b/app/admin/controller/Login.php @@ -45,7 +45,7 @@ class Login if ($admin['pwd'] !== $param['pwd']) { return to_assign(0, '用户名或密码错误'); } - if ($admin['status'] == -1) { + if ($admin['status'] == 0) { return to_assign(0, '该用户禁止登录,请于系统所有者联系'); } $data = [ diff --git a/app/admin/controller/Menu.php b/app/admin/controller/Menu.php index 577a243..06c3d91 100644 --- a/app/admin/controller/Menu.php +++ b/app/admin/controller/Menu.php @@ -41,14 +41,16 @@ class Menu extends BaseController if (request()->isAjax()) { $param = get_params(); if ($param['id'] > 0) { - try { - validate(MenuCheck::class)->scene('edit')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(0, $e->getError()); - } $data[$param['field']] = $param['value']; $data['id'] = $param['id']; + if(!empty($data['title'])){ + try { + validate(MenuCheck::class)->scene('edit')->check($data); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(0, $e->getError()); + } + } Db::name('AdminMenu')->strict(false)->field(true)->update($data); add_log('edit', $param['id'], $data); } else { diff --git a/app/admin/controller/Role.php b/app/admin/controller/Role.php index e2ad112..43d77e7 100644 --- a/app/admin/controller/Role.php +++ b/app/admin/controller/Role.php @@ -65,14 +65,6 @@ class Role extends BaseController if ($param['id'] == 1) { return to_assign(0, '为了系统安全,该管理组不允许修改'); } - /* - if (!empty($param['rules'])) { - $param['rules'] = implode(',', $param['rules']); - } - if (!empty($param['menus'])) { - $param['menus'] = implode(',', $param['menus']); - } - */ Db::name('AdminGroup')->where(['id' => $param['id']])->strict(false)->field(true)->update($param); add_log('edit', $param['id'], $param); } else { @@ -82,14 +74,6 @@ class Role extends BaseController // 验证失败 输出错误信息 return to_assign(0, $e->getError()); } - /* - if (!empty($param['rules'])) { - $param['rules'] = implode(',', $param['rules']); - } - if (!empty($param['menus'])) { - $param['menus'] = implode(',', $param['menus']); - } - */ $gid = Db::name('AdminGroup')->strict(false)->field(true)->insertGetId($param); add_log('add', $gid, $param); } diff --git a/app/admin/controller/Rule.php b/app/admin/controller/Rule.php index 552ddcb..8ff366b 100644 --- a/app/admin/controller/Rule.php +++ b/app/admin/controller/Rule.php @@ -39,14 +39,24 @@ class Rule extends BaseController if (request()->isAjax()) { $param = get_params(); if ($param['id'] > 0) { - try { - validate(RuleCheck::class)->scene('edit')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(0, $e->getError()); - } $data[$param['field']] = $param['value']; $data['id'] = $param['id']; + if(!empty($data['title'])){ + try { + validate(RuleCheck::class)->scene('edit_title')->check($data); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(0, $e->getError()); + } + } + if(!empty($data['src'])){ + try { + validate(RuleCheck::class)->scene('edit_src')->check($data); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(0, $e->getError()); + } + } Db::name('AdminRule')->strict(false)->field(true)->update($data); add_log('edit', $param['id'], $data); } else { diff --git a/app/admin/validate/AdminCheck.php b/app/admin/validate/AdminCheck.php index fb78abd..556c096 100644 --- a/app/admin/validate/AdminCheck.php +++ b/app/admin/validate/AdminCheck.php @@ -11,11 +11,14 @@ use think\Validate; class AdminCheck extends Validate { + protected $regex = [ 'checkUser' => '/^[A-Za-z]{1}[A-Za-z0-9_-]{4,19}$/']; + protected $rule = [ - 'username' => 'require|unique:admin', - 'pwd' => 'require|confirm', - 'mobile' => 'require', - 'nickname' => 'require', + 'username' => 'require|regex:checkUser|unique:admin', + 'pwd' => 'require|min:6|confirm', + 'edit_pwd' => 'min:6|confirm', + 'mobile' => 'require|mobile', + 'nickname' => 'require|chsAlpha', 'group_id' => 'require', 'id' => 'require', 'status' => 'require|checkStatus:-1,1', @@ -24,23 +27,29 @@ class AdminCheck extends Validate protected $message = [ 'username.require' => '登录账号不能为空', + 'username.regex' => '登录账号必须是以字母开头,只能包含字母数字下划线和减号,5到20位', + 'username.unique' => '同样的登录账号已经存在', 'pwd.require' => '密码不能为空', + 'pwd.min' => '密码至少要6个字符', 'pwd.confirm' => '两次密码不一致', - 'username.unique' => '同样的登录账号已经存在!', + 'edit_pwd.min' => '密码至少要6个字符', + 'edit_pwd.confirm' => '两次密码不一致', 'mobile.require' => '手机不能为空', + 'mobile.mobile' => '手机格式错误', 'nickname.require' => '昵称不能为空', + 'nickname.chsAlpha' => '昵称只能是汉子和字母', 'group_id.require' => '至少要选择一个用户角色', 'id.require' => '缺少更新条件', 'status.require' => '状态为必选', - 'status.checkStatus' => '系统所有者不能被禁用!', + 'status.checkStatus' => '系统所有者不能被禁用', 'old_pwd.require' => '请提供旧密码', 'old_pwd.different' => '新密码不能和旧密码一样', ]; protected $scene = [ - 'add' => ['phone', 'nickname', 'group_id', 'pwd', 'username', 'status'], - 'edit' => ['phone', 'nickname', 'group_id', 'id', 'username.unique', 'status'], - 'editPersonal' => ['phone', 'nickname'], + 'add' => ['mobile', 'nickname', 'group_id', 'pwd', 'username', 'status'], + 'edit' => ['mobile', 'nickname', 'group_id', 'edit_pwd','id', 'username', 'status'], + 'editPersonal' => ['mobile', 'nickname'], 'editpwd' => ['old_pwd', 'pwd'], ]; diff --git a/app/admin/validate/ArticleCateCheck.php b/app/admin/validate/ArticleCateCheck.php index c03f506..92e8a29 100644 --- a/app/admin/validate/ArticleCateCheck.php +++ b/app/admin/validate/ArticleCateCheck.php @@ -13,21 +13,17 @@ class ArticleCateCheck extends Validate { protected $rule = [ 'title' => 'require|unique:article_cate', - 'pid' => 'require', 'id' => 'require', - 'field' => 'require', ]; protected $message = [ 'title.require' => '名称不能为空', - 'pid.require' => '父级分类为必选', - 'title.unique' => '同样的记录已经存在', + 'title.unique' => '同样的名称已经存在', 'id.require' => '缺少更新条件', - 'filed.require' => '缺少要更新的字段名', ]; protected $scene = [ - 'add' => ['title', 'pid'], - 'edit' => ['id', 'field', 'title.unique'], + 'add' => ['title'], + 'edit' => ['id', 'title'], ]; } diff --git a/app/admin/validate/ArticleCheck.php b/app/admin/validate/ArticleCheck.php index 10ec19b..c72538f 100644 --- a/app/admin/validate/ArticleCheck.php +++ b/app/admin/validate/ArticleCheck.php @@ -21,14 +21,14 @@ class ArticleCheck extends Validate protected $message = [ 'title.require' => '标题不能为空', + 'title.unique' => '同样的文章标题已经存在', 'article_cate_id.require' => '所属分类为必选', - 'title.unique' => '同样的记录已经存在!', 'id.require' => '缺少更新条件', 'status.require' => '状态为必选', ]; protected $scene = [ - 'add' => ['title', 'thumb', 'article_cate_id', 'content', 'status'], - 'edit' => ['title', 'thumb', 'article_cate_id', 'content', 'id', 'status'], + 'add' => ['title', 'article_cate_id', 'content', 'status'], + 'edit' => ['title', 'article_cate_id', 'content', 'id', 'status'], ]; } diff --git a/app/admin/validate/ConfCheck.php b/app/admin/validate/ConfCheck.php index e750f4f..0645e17 100644 --- a/app/admin/validate/ConfCheck.php +++ b/app/admin/validate/ConfCheck.php @@ -18,8 +18,8 @@ class ConfCheck extends Validate protected $message = [ 'title.require' => '配置名称不能为空', - 'name.require' => '配置标识不能为空', 'title.unique' => '同样的配置名称已经存在', + 'name.require' => '配置标识不能为空', 'name.unique' => '同样的配置标识已经存在', ]; } diff --git a/app/admin/validate/GroupCheck.php b/app/admin/validate/GroupCheck.php index 5bf5f25..b913c21 100644 --- a/app/admin/validate/GroupCheck.php +++ b/app/admin/validate/GroupCheck.php @@ -19,10 +19,10 @@ class GroupCheck extends Validate protected $message = [ 'title.require' => '名称不能为空', - 'title.unique' => '同样的记录已经存在!', + 'title.unique' => '同样的记录已经存在', 'id.require' => '缺少更新条件', 'status.require' => '状态为必选', - 'status.checkStatus' => '系统所有者组不能被禁用!', + 'status.checkStatus' => '系统所有者组不能被禁用', ]; protected $scene = [ diff --git a/app/admin/validate/KeywordsCheck.php b/app/admin/validate/KeywordsCheck.php index 87769b1..9c1dd2e 100644 --- a/app/admin/validate/KeywordsCheck.php +++ b/app/admin/validate/KeywordsCheck.php @@ -13,13 +13,13 @@ use think\Validate; class KeywordsCheck extends Validate { protected $rule = [ - 'title' => 'require|checkUnique', + 'title' => 'require|unique:keywords', 'id' => 'require', ]; protected $message = [ 'title.require' => '关键字名称不能为空', - 'title.checkUnique' => '同样的关键字名称已经存在', + 'title.unique' => '同样的关键字名称已经存在', 'id.require' => '缺少更新条件', ]; @@ -28,20 +28,4 @@ class KeywordsCheck extends Validate 'edit' => ['id', 'title'], ]; - //自定义验证规则 - protected function checkUnique($value, $rule, $data) - { - if (isset($data['id'])) { - $unique = Db::name('keywords')->where([['id', '<>', $data['id']], ['title', '=', $value], ['status', '>=', 0]])->value('id'); - } else { - $unique = Db::name('keywords')->where([['title', '=', $value], ['status', '>=', 0]])->value('id'); - } - - if ($unique) { - return false; - } else { - return true; - } - } - } diff --git a/app/admin/validate/MenuCheck.php b/app/admin/validate/MenuCheck.php index d889db1..a9a2a23 100644 --- a/app/admin/validate/MenuCheck.php +++ b/app/admin/validate/MenuCheck.php @@ -13,21 +13,17 @@ class MenuCheck extends Validate { protected $rule = [ 'title' => 'require|unique:admin_menu', - 'pid' => 'require', 'id' => 'require', - 'field' => 'require', ]; protected $message = [ 'title.require' => '菜单名称不能为空', - 'pid.require' => '父级菜单为必选', 'title.unique' => '同样的菜单名称已经存在', 'id.require' => '缺少更新条件', - 'filed.require' => '缺少要更新的字段名', ]; protected $scene = [ - 'add' => ['title', 'pid'], - 'edit' => ['id', 'field', 'title.unique'], + 'add' => ['title'], + 'edit' => ['id','title'], ]; } diff --git a/app/admin/validate/NavCheck.php b/app/admin/validate/NavCheck.php index 8345c8c..8ad9492 100644 --- a/app/admin/validate/NavCheck.php +++ b/app/admin/validate/NavCheck.php @@ -21,9 +21,9 @@ class NavCheck extends Validate protected $message = [ 'title.require' => '标题不能为空', + 'title.unique' => '同样的标题已经存在', 'name.require' => '标识不能为空', - 'title.unique' => '同样的记录已经存在!', - 'name.unique' => '同样的记录已经存在!', + 'name.unique' => '同样的标识已经存在', 'id.require' => '缺少更新条件', 'status.require' => '状态为必选', 'slide_id.require' => '缺少导航组ID', diff --git a/app/admin/validate/RuleCheck.php b/app/admin/validate/RuleCheck.php index 4a083cf..d0489ff 100644 --- a/app/admin/validate/RuleCheck.php +++ b/app/admin/validate/RuleCheck.php @@ -14,14 +14,11 @@ class RuleCheck extends Validate protected $rule = [ 'title' => 'require|unique:admin_rule', 'src' => 'unique:admin_rule', - 'pid' => 'require', 'id' => 'require', - 'field' => 'require', ]; protected $message = [ 'title.require' => '节点名称不能为空', - 'pid.require' => '父级节点为必选', 'title.unique' => '同样的节点名称已经存在', 'src.unique' => '同样的节点规则已经存在', 'id.require' => '缺少更新条件', @@ -29,7 +26,8 @@ class RuleCheck extends Validate ]; protected $scene = [ - 'add' => ['title', 'pid', 'src'], - 'edit' => ['id', 'field', 'title.unique', 'src.unique'], + 'add' => ['title','src'], + 'edit_title' => ['id', 'title'], + 'edit_src' => ['id', 'src'], ]; } diff --git a/app/admin/validate/SitemapCateCheck.php b/app/admin/validate/SitemapCateCheck.php index b5d78e1..4246f1b 100644 --- a/app/admin/validate/SitemapCateCheck.php +++ b/app/admin/validate/SitemapCateCheck.php @@ -18,7 +18,7 @@ class SitemapCateCheck extends Validate protected $message = [ 'name.require' => '名称不能为空', - 'name.unique' => '同样的记录已经存在!', + 'name.unique' => '同样的名称已经存在', 'id.require' => '缺少更新条件', ]; diff --git a/app/admin/validate/SlideCheck.php b/app/admin/validate/SlideCheck.php index fea818e..6b694d9 100644 --- a/app/admin/validate/SlideCheck.php +++ b/app/admin/validate/SlideCheck.php @@ -22,9 +22,9 @@ class SlideCheck extends Validate protected $message = [ 'title.require' => '标题不能为空', + 'title.unique' => '同样的标题已经存在', 'name.require' => '标识不能为空', - 'title.unique' => '同样的记录已经存在!', - 'name.unique' => '同样的记录已经存在!', + 'name.unique' => '同样的标识已经存在', 'id.require' => '缺少更新条件', 'status.require' => '状态为必选', 'img.require' => '请上传图片', diff --git a/app/admin/view/admin/add.html b/app/admin/view/admin/add.html index cc31e36..677accb 100644 --- a/app/admin/view/admin/add.html +++ b/app/admin/view/admin/add.html @@ -106,12 +106,12 @@ 密码 - + - 确认密码* + 确认密码 - + diff --git a/app/admin/view/article/add.html b/app/admin/view/article/add.html index 16aa267..4de6e13 100644 --- a/app/admin/view/article/add.html +++ b/app/admin/view/article/add.html @@ -18,20 +18,16 @@ {/volist} - 关键字 + 关键字* - - 属性 + 状态* - + + @@ -44,10 +40,14 @@ - 状态* + 属性 - - + diff --git a/app/admin/view/article/cate.html b/app/admin/view/article/cate.html index 269c352..a44f66a 100644 --- a/app/admin/view/article/cate.html +++ b/app/admin/view/article/cate.html @@ -11,7 +11,7 @@ {block name="body"}
- + 添加分类 + + 添加分类点击表格内容可编辑
@@ -67,8 +67,11 @@ type:'post', data:{id:obj.data.id,field:obj.field,value:obj.value}, success:function(res){ - if(res.code == 1){ - layer.msg(res.msg); + layer.msg(res.msg); + if(res.code == 0){ + setTimeout(function(){ + location.reload() + },2000) } } }) diff --git a/app/admin/view/article/edit.html b/app/admin/view/article/edit.html index 45e7eab..0947d41 100644 --- a/app/admin/view/article/edit.html +++ b/app/admin/view/article/edit.html @@ -19,20 +19,16 @@ {/volist} - 关键字 + 关键字* - - 属性 + 状态* - + + @@ -46,10 +42,14 @@ - 状态* + 属性 - - + diff --git a/app/admin/view/login/index.html b/app/admin/view/login/index.html index b248311..82afb19 100644 --- a/app/admin/view/login/index.html +++ b/app/admin/view/login/index.html @@ -51,10 +51,10 @@
- +
- +
diff --git a/app/admin/view/menu/index.html b/app/admin/view/menu/index.html index 472407a..9413182 100644 --- a/app/admin/view/menu/index.html +++ b/app/admin/view/menu/index.html @@ -13,7 +13,7 @@ {block name="body"}
- + 添加菜单 + + 添加菜单点击表格内容可编辑
@@ -63,9 +63,11 @@ type: 'post', data: { id: obj.data.id, field: obj.field, value: obj.value }, success: function (res) { - if (res.code == 1) { - layer.msg(res.msg); - setTimeout('location.reload()', 2000); + layer.msg(res.msg); + if(res.code == 0){ + setTimeout(function(){ + location.reload() + },2000) } } }) diff --git a/app/admin/view/rule/index.html b/app/admin/view/rule/index.html index fd7cf2e..47d8e48 100644 --- a/app/admin/view/rule/index.html +++ b/app/admin/view/rule/index.html @@ -13,7 +13,7 @@ {block name="body"}
- + 添加节点 + + 添加节点点击表格内容可编辑
@@ -63,9 +63,11 @@ type: 'post', data: { id: obj.data.id, field: obj.field, value: obj.value }, success: function (res) { - if (res.code == 1) { - layer.msg(res.msg); - setTimeout('location.reload()', 2000); + layer.msg(res.msg); + if(res.code == 0){ + setTimeout(function(){ + location.reload() + },2000) } } }) diff --git a/app/home/controller/Login.php b/app/home/controller/Login.php index b1f95ef..30daac4 100644 --- a/app/home/controller/Login.php +++ b/app/home/controller/Login.php @@ -36,6 +36,7 @@ class Login { $url = $_SERVER["HTTP_REFERER"]; //获取完整的来路URL $str = str_replace("http://","",$url); //去掉http:// + $str = str_replace("https://","",$str); //去掉https:// $strdomain = explode("/",$str); // 以“/”分开成数组 $domain = $strdomain[0]; //取第一个“/”以前的字符 add_user_log('install', '系统',0,['domain'=>$domain]); @@ -57,7 +58,7 @@ class Login return to_assign(0, $e->getError()); } - $user = Db::name('User')->where(['username' => $param['username']])->find(); + $user = Db::name('User')->where(['username' => $param['name']])->find(); if (empty($user)) { return to_assign(0, '用户名或密码错误'); } diff --git a/app/home/validate/UserCheck.php b/app/home/validate/UserCheck.php index 96a8617..1718cba 100644 --- a/app/home/validate/UserCheck.php +++ b/app/home/validate/UserCheck.php @@ -11,16 +11,21 @@ use think\Validate; class UserCheck extends Validate { + protected $regex = [ 'checkUser' => '/^[A-Za-z]{1}[A-Za-z0-9_-]{4,19}$/']; protected $rule = [ - 'username' => 'require', + 'name' => 'require', 'password' => 'require', + 'username' => 'require|regex:checkUser|unique:user', 'pwd' => 'require|min:6|confirm', 'captcha' => 'require|captcha', ]; protected $message = [ - 'username.require' => '账号不能为空', + 'name.require' => '账号不能为空', 'password.require' => '密码不能为空', + 'username.require' => '账号不能为空', + 'username.regex' => '账号必须是以字母开头,只能包含字母数字下划线和减号,5到20位', + 'username.unique' => '同样的登录账号已经存在', 'pwd.require' => '密码不能为空', 'pwd.min' => '密码必须6位以上', 'pwd.confirm' => '两次密码不一致', //confirm自动相互验证 @@ -29,7 +34,7 @@ class UserCheck extends Validate ]; protected $scene = [ - 'login' => ['username', 'password', 'captcha'], + 'login' => ['name', 'password', 'captcha'], 'reg' => ['username', 'pwd', 'captcha'], ]; diff --git a/app/home/view/common/header.html b/app/home/view/common/header.html index de95c54..bb67df1 100644 --- a/app/home/view/common/header.html +++ b/app/home/view/common/header.html @@ -6,7 +6,7 @@
+
+
+ + 轻巧的技术博客系统 +
    +
  • ● 基于勾股CMS二次开发,一脉相承
  • +
  • ● 简约、易用、轻快、内存低等特点
  • +
+
    +
  • ● 集成文章、动态、归档、访问统计等功能
  • +
  • ● 可做博客,工作室,自媒体等各类网站
  • +
+ 免费开源 +
+
+
+
功能矩阵
+
系统后台集成了主流的通用功能,如:登录验证、系统配置、操作日志管理、用户(组)管理、用户(组)权限、功能管理(后台菜单管理)、导航设置、网站地图、轮播广告、TAG关键字管理、文件上传、数据备份/还原、文章功能、用户管理、用户操作日志、用户注册/登录等。更多的个性化功能可以基于当前系统便捷做二次开发。
+
+
+ +
+
+
+
+ +

系统管理

+
+
    +
  • 系统配置
  • +
  • 功能菜单
  • +
  • 功能节点
  • +
  • 权限角色
  • +
  • 管 理 员
  • +
  • 操作日志
  • +
  • 系统配置
  • +
  • 数据备份
  • +
  • 数据还原
  • +
+
+
+
+ +

基础数据

+
+
    +
  • 导航设置
  • +
  • 网站地图
  • +
  • 轮播广告
  • +
  • SEO关键字
  • +
  • 搜索关键词
  • +
+
+
+
+ +

平台用户

+
+
    +
  • 用户列表
  • +
  • 操作记录
  • +
  • 操作日志
  • +
+
+
+
+ +

资讯中心

+
+
    +
  • 文章分类
  • +
  • 文章列表
  • +
+
+
+
{/block} diff --git a/app/home/view/index/logs.html b/app/home/view/index/logs.html index 29caba6..ef1167e 100644 --- a/app/home/view/index/logs.html +++ b/app/home/view/index/logs.html @@ -11,6 +11,33 @@

更新日志