From 533bb77b713df4d10220533550d6eb51ffecf9f9 Mon Sep 17 00:00:00 2001 From: liyukun <1099438829@qq.com> Date: Tue, 11 Jan 2022 00:04:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/BaseController.php | 5 +- app/admin/controller/Admin.php | 14 ++-- app/admin/controller/AdminAuth.php | 24 ++++--- app/admin/controller/AdminLog.php | 14 ++-- app/admin/controller/AdminNotify.php | 3 +- app/admin/controller/AdminRole.php | 21 +++--- .../controller/{Poster.php => Advert.php} | 60 +++++++++--------- app/admin/controller/Article.php | 21 +++--- app/admin/controller/Category.php | 16 +++-- app/admin/controller/Databases.php | 29 +++++---- app/admin/controller/Files.php | 9 ++- app/admin/controller/FriendLink.php | 17 +++-- app/admin/controller/Images.php | 27 ++++---- app/admin/controller/Index.php | 14 ++-- app/admin/controller/Invitation.php | 24 ++++--- app/admin/controller/Login.php | 21 +++--- app/admin/controller/Message.php | 12 ++-- app/admin/controller/SystemBasic.php | 2 +- app/admin/controller/SystemConfig.php | 28 ++++---- app/admin/controller/SystemConfigTab.php | 14 ++-- app/admin/controller/Theme.php | 5 +- app/admin/controller/User.php | 17 +++-- app/admin/extend/FormBuilder.php | 3 +- app/admin/view/admin_auth/index.html | 4 +- app/admin/view/admin_role/index.html | 4 +- app/admin/view/{poster => advert}/index.html | 30 ++++----- app/admin/view/article/add.html | 2 +- app/admin/view/article/edit.html | 2 +- app/admin/view/category/add.html | 2 +- app/admin/view/category/edit.html | 2 +- app/admin/view/category/index.html | 4 +- app/admin/view/databases/export.html | 2 +- app/admin/view/databases/import.html | 2 +- app/admin/view/images/index.html | 2 +- app/admin/view/public/404.html | 2 +- app/admin/view/public/error.html | 2 +- app/admin/view/public/notice.html | 1 - app/common.php | 15 +++-- app/common/constant/Data.php | 9 +++ app/event.php | 4 +- app/index/common.php | 4 +- app/middleware.php | 7 +- public/install/js/validate.js | 2 +- public/install/templates/step2.php | 2 +- public/install/templates/step4.php | 2 +- .../template/default/pc/article/article.html | 2 +- .../template/default/pc/index/applylink.html | 4 +- public/template/default/pc/index/index.html | 6 +- public/template/default/pc/js/index.js | 6 +- public/template/default/pc/js/tools.js | 1 - .../4cfa2e2d93855ca3d440d3628c416a16.jpg | Bin 1919593 -> 1919593 bytes .../759040d44046f0361446d12d1d91788c.jpg | Bin 1919593 -> 1919593 bytes .../a0e9a010674f6b47ac24a906d8763518.jpg | Bin 1919593 -> 1919593 bytes .../f1e744c5fbc5fef219fd3cecdff35acb.jpg | Bin 404022 -> 404022 bytes .../fdebd2bf797b89b82675476d2af416dd.jpg | Bin 1919593 -> 1919593 bytes 55 files changed, 306 insertions(+), 219 deletions(-) rename app/admin/controller/{Poster.php => Advert.php} (72%) rename app/admin/view/{poster => advert}/index.html (93%) diff --git a/app/BaseController.php b/app/BaseController.php index aced9ab..bca8683 100644 --- a/app/BaseController.php +++ b/app/BaseController.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace app; +use Exception; use think\App; use think\exception\HttpResponseException; use think\exception\ValidateException; @@ -22,7 +23,7 @@ abstract class BaseController /** * 应用实例 - * @var \think\App + * @var App */ protected $app; @@ -193,7 +194,7 @@ abstract class BaseController /** * 返回视图 * @return string - * @throws \Exception + * @throws Exception */ protected function fetch(string $template = '') { diff --git a/app/admin/controller/Admin.php b/app/admin/controller/Admin.php index e5233be..5360b02 100644 --- a/app/admin/controller/Admin.php +++ b/app/admin/controller/Admin.php @@ -7,8 +7,12 @@ use app\common\model\AdminRole as rModel; use app\common\model\User as userModel; use app\Request; use app\admin\extend\Util as Util; +use FormBuilder\Exception\FormBuilderException; use FormBuilder\Factory\Elm; use app\admin\extend\FormBuilder as Form; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; use think\Exception; use think\facade\Db; use think\facade\Route as Url; @@ -36,9 +40,9 @@ class Admin extends AuthController * 账号列表 * @param Request $request * @return - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function lst(Request $request) { @@ -59,7 +63,7 @@ class Admin extends AuthController * 添加账号 * @param Request $request * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function add(Request $request) { @@ -88,7 +92,7 @@ class Admin extends AuthController /** * 修改账号 * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function edit($id = "") { diff --git a/app/admin/controller/AdminAuth.php b/app/admin/controller/AdminAuth.php index 30748de..f11339e 100644 --- a/app/admin/controller/AdminAuth.php +++ b/app/admin/controller/AdminAuth.php @@ -4,10 +4,14 @@ namespace app\admin\controller; use app\common\model\AdminAuth as aModel; use app\Request; +use Exception; use FormBuilder\Exception\FormBuilderException; use app\admin\extend\Util as Util; use FormBuilder\Factory\Elm; use app\admin\extend\FormBuilder as Form; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; use think\facade\Route as Url; /** @@ -26,9 +30,9 @@ class AdminAuth extends AuthController * 权限列表 * @param Request $request * @return array - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function lst(Request $request) { @@ -44,10 +48,10 @@ class AdminAuth extends AuthController * @param int $pid * @return string * @throws FormBuilderException - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - * @throws \Exception + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException + * @throws Exception */ public function add($pid = 0) { @@ -72,9 +76,9 @@ class AdminAuth extends AuthController * @param int $id * @return string * @throws FormBuilderException - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function edit($id = 0) { diff --git a/app/admin/controller/AdminLog.php b/app/admin/controller/AdminLog.php index a79d158..b910cdb 100644 --- a/app/admin/controller/AdminLog.php +++ b/app/admin/controller/AdminLog.php @@ -5,6 +5,10 @@ namespace app\admin\controller; use app\common\model\AdminLog as lModel; use app\Request; use app\admin\extend\Util as Util; +use Exception; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; /** * 日志 @@ -18,7 +22,7 @@ class AdminLog extends AuthController /** * 主页 * @return string - * @throws \Exception + * @throws Exception */ public function index() { @@ -29,9 +33,9 @@ class AdminLog extends AuthController * 权限列表 * @param Request $request * @return array - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function lst(Request $request) { @@ -49,7 +53,7 @@ class AdminLog extends AuthController /** * 清空日志 * @param Request $request - * @throws \Exception + * @throws Exception */ public function empty(Request $request) { diff --git a/app/admin/controller/AdminNotify.php b/app/admin/controller/AdminNotify.php index 9b6492a..5d747d7 100644 --- a/app/admin/controller/AdminNotify.php +++ b/app/admin/controller/AdminNotify.php @@ -4,6 +4,7 @@ namespace app\admin\controller; use app\admin\extend\Util as Util; use app\common\model\AdminNotify as nModel; +use Exception; /** * 消息提醒 @@ -15,7 +16,7 @@ class AdminNotify extends AuthController /** * 列表 * @return mixed - * @throws \Exception + * @throws Exception */ public function index() { diff --git a/app/admin/controller/AdminRole.php b/app/admin/controller/AdminRole.php index 194123e..d052c3b 100644 --- a/app/admin/controller/AdminRole.php +++ b/app/admin/controller/AdminRole.php @@ -9,6 +9,9 @@ use FormBuilder\Exception\FormBuilderException; use app\admin\extend\Util as Util; use FormBuilder\Factory\Elm; use app\admin\extend\FormBuilder as Form; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; class AdminRole extends AuthController { @@ -21,9 +24,9 @@ class AdminRole extends AuthController * 角色列表 * @param Request $request * @return array - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function lst(Request $request) { @@ -35,9 +38,9 @@ class AdminRole extends AuthController * @param int $pid * @return string * @throws FormBuilderException - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function add($pid = 0) { @@ -57,9 +60,9 @@ class AdminRole extends AuthController * @param int $id * @return string * @throws FormBuilderException - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function edit($id = 0) { diff --git a/app/admin/controller/Poster.php b/app/admin/controller/Advert.php similarity index 72% rename from app/admin/controller/Poster.php rename to app/admin/controller/Advert.php index 486ff7f..968fe7b 100644 --- a/app/admin/controller/Poster.php +++ b/app/admin/controller/Advert.php @@ -3,35 +3,30 @@ namespace app\admin\controller; use app\admin\extend\FormBuilder as Form; +use app\admin\extend\Util as Util; use app\common\constant\Data; use app\common\model\Advert as aModel; use app\Request; -use app\admin\extend\Util as Util; +use Exception; +use FormBuilder\Exception\FormBuilderException; use FormBuilder\Factory\Elm; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; use think\facade\Route as Url; /** - * Class Poster + * Class Advert * @package app\admin\controller * @author 李玉坤 * @date 2021-07-26 17:53 */ -class Poster extends AuthController +class Advert extends AuthController { - /** - * 构造方法 初始化一些参数 - */ - public function initialize() - { - parent::initialize(); - //修正因为修改model名称和原来不能对应导致的model功能异常 - $this->model = new aModel(); - } - /** * 广告管理 * @return string - * @throws \Exception + * @throws Exception * @author 李玉坤 * @date 2021-02-19 11:53 */ @@ -40,13 +35,18 @@ class Poster extends AuthController return $this->fetch(); } + public function navList(Request $request) + { + return app("json")->layui(Data::ADVERT_NAV_LIST); + } + /** * 文章列表 * @param Request $request * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-02-15 23:26 */ @@ -67,7 +67,7 @@ class Poster extends AuthController * 添加广告 * @param Request $request * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function add(Request $request) { @@ -78,7 +78,7 @@ class Poster extends AuthController $form[] = Elm::input('sort', '排序')->col(10); $form[] = Elm::select('position', '位置')->options(function () { $options = []; - foreach (['顶部页签', '右侧广告位', '文章页面'] as $k => $v) { + foreach (Data::ADVERT_NAV_LIST as $k => $v) { $options[] = Elm::option($k, $v); } return $options; @@ -92,26 +92,26 @@ class Poster extends AuthController /** * 修改banner * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function edit($id = "") { if (!$id) return app("json")->fail("数据id不能为空"); - $ainfo = aModel::get($id); - if (!$ainfo) return app("json")->fail("没有该数据"); + $info = aModel::get($id); + if (!$info) return app("json")->fail("没有该数据"); $form = array(); - $form[] = Elm::input('title', '广告名称', $ainfo['title'])->col(10); - $form[] = Elm::input('url', '链接地址', $ainfo['url'])->col(10); - $form[] = Elm::frameImage('cover_path', '广告图片', Url::buildUrl('admin/images/index', array('fodder' => 'cover_path', 'limit' => 1)), $ainfo['cover_path'])->icon("ios-image")->width('96%')->height('440px')->col(10); - $form[] = Elm::input('sort', '排序', $ainfo['sort'])->col(10); - $form[] = Elm::select('position', '位置', $ainfo['position'])->options(function () { + $form[] = Elm::input('title', '广告名称', $info['title'])->col(10); + $form[] = Elm::input('url', '链接地址', $info['url'])->col(10); + $form[] = Elm::frameImage('cover_path', '广告图片', Url::buildUrl('admin/images/index', array('fodder' => 'cover_path', 'limit' => 1)), $info['cover_path'])->icon("ios-image")->width('96%')->height('440px')->col(10); + $form[] = Elm::input('sort', '排序', $info['sort'])->col(10); + $form[] = Elm::select('position', '位置', $info['position'])->options(function () { $options = []; - foreach (['顶部页签', '右侧广告位', '文章页面'] as $k => $v) { + foreach (Data::ADVERT_NAV_LIST as $k => $v) { $options[] = Elm::option($k, $v); } return $options; })->col(10); - $form[] = Elm::radio('status', '状态', $ainfo['status'])->options([['label' => '启用', 'value' => 1], ['label' => '冻结', 'value' => 0]])->col(10); + $form[] = Elm::radio('status', '状态', $info['status'])->options([['label' => '启用', 'value' => 1], ['label' => '冻结', 'value' => 0]])->col(10); $form = Form::make_post_form($form, url('save', ['id' => $id])->build()); $this->assign(compact('form')); return $this->fetch("public/form-builder"); @@ -129,7 +129,7 @@ class Poster extends AuthController ['title', ''], ['url', ''], ['cover_path', ''], - ['position', 0], + ['position', 1], ['sort', ''], ['status', 1], ]); diff --git a/app/admin/controller/Article.php b/app/admin/controller/Article.php index dd4ffd9..772c0b2 100644 --- a/app/admin/controller/Article.php +++ b/app/admin/controller/Article.php @@ -9,6 +9,9 @@ use app\common\model\DocumentArticle; use app\common\model\Comment as CommentModel; use app\Request; use app\admin\extend\Util as Util; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; use think\Exception; use think\facade\Log; @@ -33,9 +36,9 @@ class Article extends AuthController /** * 文章列表 * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-02-15 23:26 */ @@ -166,9 +169,9 @@ class Article extends AuthController * 新增文章 * @param $category_id * @return string - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-03-10 14:46 */ @@ -228,9 +231,9 @@ class Article extends AuthController /** * 文章评论列表 * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-11-03 23:28 */ diff --git a/app/admin/controller/Category.php b/app/admin/controller/Category.php index 261f88a..f24e2f7 100644 --- a/app/admin/controller/Category.php +++ b/app/admin/controller/Category.php @@ -7,6 +7,10 @@ use app\common\model\DocumentCategory as aModel; use app\common\model\DocumentCategoryContent; use app\Request; use app\admin\extend\Util as Util; +use Exception; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; /** * Class Article @@ -19,7 +23,7 @@ class Category extends AuthController /** * 分类 * @return string - * @throws \Exception + * @throws Exception * @author 李玉坤 * @date 2021-02-17 11:40 */ @@ -32,9 +36,9 @@ class Category extends AuthController * 权限列表 * @param Request $request * @return array - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function lst(Request $request) { @@ -108,7 +112,7 @@ class Category extends AuthController /** * 新增页 * @return string - * @throws \Exception + * @throws Exception */ public function add($pid = '') { @@ -135,7 +139,7 @@ class Category extends AuthController /** * 编辑页 * @return string - * @throws \Exception + * @throws Exception * @author 李玉坤 * @date 2021-02-20 17:00 */ diff --git a/app/admin/controller/Databases.php b/app/admin/controller/Databases.php index aa3da7b..39222d2 100644 --- a/app/admin/controller/Databases.php +++ b/app/admin/controller/Databases.php @@ -10,6 +10,11 @@ namespace app\admin\controller; use app\Request; +use Exception; +use FilesystemIterator; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; use think\facade\Db; use app\common\extend\Database; use app\admin\extend\Util as Util; @@ -24,7 +29,7 @@ class Databases extends AuthController * 数据库备份/还原列表 * @param null $type * @return string - * @throws \Exception + * @throws Exception * @author 李玉坤 * @date 2021-10-30 12:45 */ @@ -53,9 +58,9 @@ class Databases extends AuthController * 获取列表 * @param Request $request * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-10-31 0:12 */ @@ -74,8 +79,8 @@ class Databases extends AuthController mkdir($path, 0755, true); } $path = realpath($path); - $flag = \FilesystemIterator::KEY_AS_FILENAME; - $glob = new \FilesystemIterator($path, $flag); + $flag = FilesystemIterator::KEY_AS_FILENAME; + $glob = new FilesystemIterator($path, $flag); $list = array(); foreach ($glob as $name => $file) { @@ -166,9 +171,9 @@ class Databases extends AuthController /** * 删除备份文件 * @return mixed|void - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-10-30 13:31 */ @@ -187,9 +192,9 @@ class Databases extends AuthController /** * 备份数据库 * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-10-31 0:35 */ diff --git a/app/admin/controller/Files.php b/app/admin/controller/Files.php index 8fa8d93..cafbc81 100644 --- a/app/admin/controller/Files.php +++ b/app/admin/controller/Files.php @@ -6,6 +6,9 @@ namespace app\admin\controller; use app\common\model\Attachment; use app\admin\extend\storage\QcloudCoService; use app\admin\extend\Util as Util; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; use think\exception\ValidateException; use think\facade\Filesystem; use think\Request; @@ -15,9 +18,9 @@ class Files extends AuthController /** * 单个图片上传 * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function image() { diff --git a/app/admin/controller/FriendLink.php b/app/admin/controller/FriendLink.php index 5419a30..6856d8c 100644 --- a/app/admin/controller/FriendLink.php +++ b/app/admin/controller/FriendLink.php @@ -7,7 +7,12 @@ use app\common\model\FriendLink as aModel; use app\admin\extend\FormBuilder as Form; use app\Request; use app\admin\extend\Util as Util; +use Exception; +use FormBuilder\Exception\FormBuilderException; use FormBuilder\Factory\Elm; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; use think\facade\Route as Url; /** @@ -21,7 +26,7 @@ class FriendLink extends AuthController /** * 账号列表 * @return string - * @throws \Exception + * @throws Exception */ public function index() { @@ -32,9 +37,9 @@ class FriendLink extends AuthController * 文章列表 * @param Request $request * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-02-15 23:26 */ @@ -54,7 +59,7 @@ class FriendLink extends AuthController /** * 添加友链 * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function add() { @@ -73,7 +78,7 @@ class FriendLink extends AuthController /** * 修改友链 * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function edit($id = "") { diff --git a/app/admin/controller/Images.php b/app/admin/controller/Images.php index e20c9f4..78f560d 100644 --- a/app/admin/controller/Images.php +++ b/app/admin/controller/Images.php @@ -5,9 +5,14 @@ namespace app\admin\controller; use app\common\model\Attachment; use app\common\model\AttachmentCategory; +use Exception; +use FormBuilder\Exception\FormBuilderException; use FormBuilder\Factory\Elm; use app\admin\extend\FormBuilder as Form; use app\admin\extend\Util as Util; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; /** * Class Images @@ -28,9 +33,9 @@ class Images extends AuthController /** * @return array - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function category() { @@ -42,7 +47,7 @@ class Images extends AuthController * @param int $id * @param int $pid * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function addCategory($id = 0, $pid = 0) { @@ -65,8 +70,8 @@ class Images extends AuthController * 目录的修改 * @param $id * @return string - * @throws \FormBuilder\Exception\FormBuilderException - * @throws \Exception + * @throws FormBuilderException + * @throws Exception */ public function editCategory($id = 0, $pid = 0) { @@ -139,10 +144,10 @@ class Images extends AuthController /** * @param $id * @return string - * @throws \FormBuilder\Exception\FormBuilderException - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws FormBuilderException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function editImage($id) { @@ -185,7 +190,7 @@ class Images extends AuthController break; } return Attachment::del($id) ? app("json")->success("删除成功") : app("json")->fail("删除失败"); - } catch (\Exception $e) { + } catch (Exception $e) { return app("json")->fail("删除失败" . $e); } } diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index d1a530f..de92309 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -6,13 +6,17 @@ use app\common\model\AdminAuth; use app\common\model\AdminNotify; use app\Request; use app\admin\extend\Util as Util; +use Exception; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; class Index extends AuthController { /** * 后台首页 * @return string - * @throws \Exception + * @throws Exception */ public function index() { @@ -31,7 +35,7 @@ class Index extends AuthController /** * 控制台 * @return string - * @throws \Exception + * @throws Exception */ public function main() { @@ -40,9 +44,9 @@ class Index extends AuthController /** * 菜单 - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function menu() { diff --git a/app/admin/controller/Invitation.php b/app/admin/controller/Invitation.php index 93a7aa3..c8af5f6 100644 --- a/app/admin/controller/Invitation.php +++ b/app/admin/controller/Invitation.php @@ -5,6 +5,10 @@ namespace app\admin\controller; use app\common\model\InvitationCode as aModel; use app\Request; use app\admin\extend\Util as Util; +use Exception; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; /** * Class Invitation @@ -27,7 +31,7 @@ class Invitation extends AuthController /** * 邀请码列表 * @return string - * @throws \Exception + * @throws Exception * @author 李玉坤 * @date 2021-02-16 13:15 */ @@ -40,9 +44,9 @@ class Invitation extends AuthController * 文章列表 * @param Request $request * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-02-15 23:26 */ @@ -60,9 +64,9 @@ class Invitation extends AuthController * 保存修改 * @param string $id * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-02-20 14:32 */ @@ -92,9 +96,9 @@ class Invitation extends AuthController * 批量添加 * @param string $id * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-02-20 14:35 */ diff --git a/app/admin/controller/Login.php b/app/admin/controller/Login.php index dc87577..17841a6 100644 --- a/app/admin/controller/Login.php +++ b/app/admin/controller/Login.php @@ -5,6 +5,11 @@ namespace app\admin\controller; use app\common\model\Admin as adminModel; use app\admin\extend\Util as Util; +use Exception; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; +use think\Response; class Login extends AuthController { @@ -17,7 +22,7 @@ class Login extends AuthController /** * 登录 * @return string - * @throws \Exception + * @throws Exception */ public function login() { @@ -27,9 +32,9 @@ class Login extends AuthController /** * 验证登录 * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function verify() { @@ -45,7 +50,7 @@ class Login extends AuthController /** * 注册 * @return string - * @throws \Exception + * @throws Exception */ public function register() { @@ -55,7 +60,7 @@ class Login extends AuthController /** * 忘记密码 * @return string - * @throws \Exception + * @throws Exception */ public function forget() { @@ -65,7 +70,7 @@ class Login extends AuthController /** * 退出登陆 * @return mixed - * @throws \Exception + * @throws Exception */ public function logout() { @@ -74,7 +79,7 @@ class Login extends AuthController /** * 验证码 - * @return \think\Response + * @return Response */ public function captcha() { diff --git a/app/admin/controller/Message.php b/app/admin/controller/Message.php index 1c4ed54..d57e4b2 100644 --- a/app/admin/controller/Message.php +++ b/app/admin/controller/Message.php @@ -5,6 +5,10 @@ namespace app\admin\controller; use app\common\model\MessageForm as aModel; use app\Request; use app\admin\extend\Util as Util; +use Exception; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; /** * Class Message @@ -27,7 +31,7 @@ class Message extends AuthController /** * 留言管理 * @return string - * @throws \Exception + * @throws Exception * @author 李玉坤 * @date 2021-02-19 11:53 */ @@ -40,9 +44,9 @@ class Message extends AuthController * 留言列表 * @param Request $request * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException * @author 李玉坤 * @date 2021-02-19 11:54 */ diff --git a/app/admin/controller/SystemBasic.php b/app/admin/controller/SystemBasic.php index 451f0da..983f5ed 100644 --- a/app/admin/controller/SystemBasic.php +++ b/app/admin/controller/SystemBasic.php @@ -20,7 +20,7 @@ class SystemBasic extends BaseController * @param string $title 标题 * @param int $duration 持续时间 * @return mixed - * @throws \Exception + * @throws Exception */ protected function failedNotice($msg = '操作失败', $backUrl = 0, $info = '', $duration = 3) { diff --git a/app/admin/controller/SystemConfig.php b/app/admin/controller/SystemConfig.php index 19645f7..f539980 100644 --- a/app/admin/controller/SystemConfig.php +++ b/app/admin/controller/SystemConfig.php @@ -6,9 +6,15 @@ use app\common\constant\Data; use app\common\model\SystemConfig as cModel; use app\common\model\SystemConfigTab as tModel; use app\Request; +use Exception; +use FormBuilder\Exception\FormBuilderException; use FormBuilder\Factory\Elm; use app\admin\extend\FormBuilder as Form; use app\admin\extend\Util as Util; +use Psr\SimpleCache\InvalidArgumentException; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; /** * 系统配置 @@ -21,9 +27,9 @@ class SystemConfig extends AuthController * 基础配置 * @param int $tab_id * @return string - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function base($tab_id = 1) { @@ -48,7 +54,7 @@ class SystemConfig extends AuthController /** * @param Request $request * @return - * @throws \Psr\SimpleCache\InvalidArgumentException + * @throws InvalidArgumentException */ public function clearCache(Request $request) { @@ -67,9 +73,9 @@ class SystemConfig extends AuthController * 列表 * @param int $tab_id * @return string - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function lst(Request $request) { @@ -85,7 +91,7 @@ class SystemConfig extends AuthController * 列表 * @param int $tab_id * @return string - * @throws \Exception + * @throws Exception */ public function index($tab_id = 0) { @@ -97,7 +103,7 @@ class SystemConfig extends AuthController * 添加 * @param Request $request * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function add(Request $request) { @@ -123,7 +129,7 @@ class SystemConfig extends AuthController * 修改 * @param Request $request * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function edit($id = '') { @@ -198,7 +204,7 @@ class SystemConfig extends AuthController foreach ($request->param() as $k => $v) cModel::editValueByFormName($k, $v); cache(Data::DATA_SYSTEM_CONFIG, null);//清除缓存 return app("json")->success("操作成功"); - } catch (\Exception $e) { + } catch (Exception $e) { return app("json")->fail("操作失败"); } diff --git a/app/admin/controller/SystemConfigTab.php b/app/admin/controller/SystemConfigTab.php index 3d11846..705ead2 100644 --- a/app/admin/controller/SystemConfigTab.php +++ b/app/admin/controller/SystemConfigTab.php @@ -4,11 +4,15 @@ namespace app\admin\controller; use app\Request; +use FormBuilder\Exception\FormBuilderException; use FormBuilder\Factory\Elm; use app\admin\extend\FormBuilder as Form; use app\admin\extend\Util as Util; use app\common\model\SystemConfigTab as tModel; use app\common\model\SystemConfig as cModel; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; /** * 管理员配置 @@ -42,7 +46,7 @@ class SystemConfigTab extends AuthController * 添加 * @param Request $request * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function add(Request $request) { @@ -59,7 +63,7 @@ class SystemConfigTab extends AuthController * 修改 * @param Request $request * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function edit($id = '') { @@ -104,9 +108,9 @@ class SystemConfigTab extends AuthController * 重写删除 * @param Request $request * @return mixed|void - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function del(Request $request) { diff --git a/app/admin/controller/Theme.php b/app/admin/controller/Theme.php index a2ab73d..4e4e9e9 100644 --- a/app/admin/controller/Theme.php +++ b/app/admin/controller/Theme.php @@ -5,6 +5,7 @@ namespace app\admin\controller; use app\common\model\SystemConfig as cModel; use app\Request; use app\admin\extend\Util as Util; +use Exception; /** * Class Theme @@ -17,7 +18,7 @@ class Theme extends AuthController /** * 主题列表 * @return string - * @throws \Exception + * @throws Exception * @author 李玉坤 * @date 2021-02-17 11:40 */ @@ -53,7 +54,7 @@ class Theme extends AuthController /** * 更新主题 * @return string - * @throws \Exception + * @throws Exception * @author 李玉坤 * @date 2021-02-17 11:40 */ diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index 28c26c7..fa976f8 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -5,8 +5,13 @@ namespace app\admin\controller; use app\common\model\User as aModel; use app\Request; use app\admin\extend\Util as Util; +use Exception; +use FormBuilder\Exception\FormBuilderException; use FormBuilder\Factory\Elm; use app\admin\extend\FormBuilder as Form; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; use think\facade\Route as Url; /** @@ -21,7 +26,7 @@ class User extends AuthController /** * 账号列表 * @return string - * @throws \Exception + * @throws Exception */ public function index() { @@ -32,9 +37,9 @@ class User extends AuthController * 账号列表 * @param Request $request * @return - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function lst(Request $request) { @@ -55,7 +60,7 @@ class User extends AuthController * 添加账号 * @param Request $request * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function add(Request $request) { @@ -76,7 +81,7 @@ class User extends AuthController /** * 修改账号 * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public function edit($id = "") { diff --git a/app/admin/extend/FormBuilder.php b/app/admin/extend/FormBuilder.php index 02ae9d7..608ca42 100644 --- a/app/admin/extend/FormBuilder.php +++ b/app/admin/extend/FormBuilder.php @@ -3,6 +3,7 @@ namespace app\admin\extend; +use FormBuilder\Exception\FormBuilderException; use FormBuilder\Form\IviewForm; /** @@ -17,7 +18,7 @@ class FormBuilder * @param $rule * @param $url * @return string - * @throws \FormBuilder\Exception\FormBuilderException + * @throws FormBuilderException */ public static function make_post_form($rule, $url) { diff --git a/app/admin/view/admin_auth/index.html b/app/admin/view/admin_auth/index.html index 8bc1e96..36ab4eb 100644 --- a/app/admin/view/admin_auth/index.html +++ b/app/admin/view/admin_auth/index.html @@ -246,7 +246,7 @@ datas[i].check = checked; selectChilds(datas, datas[i], id, pid, checked); } - ; + } } @@ -256,7 +256,7 @@ datas[i].check = true; selectParentChecked(datas, datas[i], id, pid); } - ; + } } diff --git a/app/admin/view/admin_role/index.html b/app/admin/view/admin_role/index.html index 93d7107..592a57c 100644 --- a/app/admin/view/admin_role/index.html +++ b/app/admin/view/admin_role/index.html @@ -180,7 +180,7 @@ datas[i].check = checked; selectChilds(datas, datas[i], id, pid, checked); } - ; + } } @@ -190,7 +190,7 @@ datas[i].check = true; selectParentChecked(datas, datas[i], id, pid); } - ; + } } diff --git a/app/admin/view/poster/index.html b/app/admin/view/advert/index.html similarity index 93% rename from app/admin/view/poster/index.html rename to app/admin/view/advert/index.html index d639920..ad3f2e6 100644 --- a/app/admin/view/poster/index.html +++ b/app/admin/view/advert/index.html @@ -44,7 +44,7 @@
@@ -60,9 +60,14 @@
{include file="public/footer"/} - + \ No newline at end of file diff --git a/app/admin/view/public/error.html b/app/admin/view/public/error.html index fbff22c..7d32ae4 100644 --- a/app/admin/view/public/error.html +++ b/app/admin/view/public/error.html @@ -49,6 +49,6 @@ - + \ No newline at end of file diff --git a/app/admin/view/public/notice.html b/app/admin/view/public/notice.html index aa20ecf..4639bba 100644 --- a/app/admin/view/public/notice.html +++ b/app/admin/view/public/notice.html @@ -76,6 +76,5 @@ {/if} - \ No newline at end of file diff --git a/app/common.php b/app/common.php index 2694a9f..a05878f 100644 --- a/app/common.php +++ b/app/common.php @@ -2,6 +2,9 @@ use app\common\model\SystemConfig; use app\common\constant\Data; +use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; +use think\db\exception\ModelNotFoundException; // 应用公共文件 if (!function_exists('system_config_more')) { @@ -9,9 +12,9 @@ if (!function_exists('system_config_more')) { * 获取系统配置值 * @param array $formNames * @return array - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ function system_config_more(array $formNames): array { @@ -65,9 +68,9 @@ if (!function_exists('system_config')) { * 获取系统配置值 * @param string $formName * @return string - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ function system_config(string $formName): string { diff --git a/app/common/constant/Data.php b/app/common/constant/Data.php index be5828f..5d0b1e4 100644 --- a/app/common/constant/Data.php +++ b/app/common/constant/Data.php @@ -16,6 +16,15 @@ class Data const DATA_SYSTEM_CONFIG = 'data_system_config'; //系统配置 const DATA_ADVERT = 'data_advert'; //广告 + //广告位 + const ADVERT_NAV_LIST = [ + 1 => '主页banner', + 2 => '主页推荐位置', + 3 => '主页右侧广告位', + 4 => '文章banner', + 5 => '文章右侧广告位置', + ]; + //后台用户sessionKey const SESSION_KEY_ADMIN_ID = 'admin_id'; const SESSION_KEY_ADMIN_INFO = 'admin_info'; diff --git a/app/event.php b/app/event.php index 7a29917..b808427 100644 --- a/app/event.php +++ b/app/event.php @@ -1,5 +1,7 @@ [ ], @@ -13,6 +15,6 @@ return [ ], 'subscribe' => [ - \app\admin\subscribes\AdminSubscribe::class, // 操作记录 + AdminSubscribe::class, // 操作记录 ], ]; diff --git a/app/index/common.php b/app/index/common.php index 80c7cf5..b018e5b 100644 --- a/app/index/common.php +++ b/app/index/common.php @@ -578,14 +578,14 @@ function tpl_get_friend_link($type, $row) */ function tpl_get_advert($type, $row) { - $advertList = cache('DATA_ADVERT' . '_' . $type); + $advertList = cache(Data::DATA_ADVERT . '_' . $type); if ($advertList === null) { if ($type > 0) { $advertList = Db::name('advert')->where('position', $type)->where('status', 1)->order('sort desc')->limit($row)->select(); } else { $advertList = Db::name('advert')->where('status', 1)->order('sort desc')->limit($row)->select(); } - cache('DATA_ADVERT' . '_' . $type, $advertList); + cache(Data::DATA_ADVERT . '_' . $type, $advertList); } $advertListTemp = []; foreach ($advertList as $key => $item) { diff --git a/app/middleware.php b/app/middleware.php index ddfe4d8..faa3aac 100644 --- a/app/middleware.php +++ b/app/middleware.php @@ -1,10 +1,13 @@ 重新检测 0){?> - 下一步 + 下一步 下一步 diff --git a/public/install/templates/step4.php b/public/install/templates/step4.php index 8584e30..0ea5c9a 100644 --- a/public/install/templates/step4.php +++ b/public/install/templates/step4.php @@ -21,7 +21,7 @@
-
 正在安装...
+
 正在安装...