小优化

This commit is contained in:
liyukun 2022-01-11 00:04:45 +08:00
parent b9356b3a2f
commit 533bb77b71
55 changed files with 306 additions and 219 deletions

View File

@ -3,6 +3,7 @@ declare (strict_types=1);
namespace app; namespace app;
use Exception;
use think\App; use think\App;
use think\exception\HttpResponseException; use think\exception\HttpResponseException;
use think\exception\ValidateException; use think\exception\ValidateException;
@ -22,7 +23,7 @@ abstract class BaseController
/** /**
* 应用实例 * 应用实例
* @var \think\App * @var App
*/ */
protected $app; protected $app;
@ -193,7 +194,7 @@ abstract class BaseController
/** /**
* 返回视图 * 返回视图
* @return string * @return string
* @throws \Exception * @throws Exception
*/ */
protected function fetch(string $template = '') protected function fetch(string $template = '')
{ {

View File

@ -7,8 +7,12 @@ use app\common\model\AdminRole as rModel;
use app\common\model\User as userModel; use app\common\model\User as userModel;
use app\Request; use app\Request;
use app\admin\extend\Util as Util; use app\admin\extend\Util as Util;
use FormBuilder\Exception\FormBuilderException;
use FormBuilder\Factory\Elm; use FormBuilder\Factory\Elm;
use app\admin\extend\FormBuilder as Form; 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\Exception;
use think\facade\Db; use think\facade\Db;
use think\facade\Route as Url; use think\facade\Route as Url;
@ -36,9 +40,9 @@ class Admin extends AuthController
* 账号列表 * 账号列表
* @param Request $request * @param Request $request
* @return * @return
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function lst(Request $request) public function lst(Request $request)
{ {
@ -59,7 +63,7 @@ class Admin extends AuthController
* 添加账号 * 添加账号
* @param Request $request * @param Request $request
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function add(Request $request) public function add(Request $request)
{ {
@ -88,7 +92,7 @@ class Admin extends AuthController
/** /**
* 修改账号 * 修改账号
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function edit($id = "") public function edit($id = "")
{ {

View File

@ -4,10 +4,14 @@ namespace app\admin\controller;
use app\common\model\AdminAuth as aModel; use app\common\model\AdminAuth as aModel;
use app\Request; use app\Request;
use Exception;
use FormBuilder\Exception\FormBuilderException; use FormBuilder\Exception\FormBuilderException;
use app\admin\extend\Util as Util; use app\admin\extend\Util as Util;
use FormBuilder\Factory\Elm; use FormBuilder\Factory\Elm;
use app\admin\extend\FormBuilder as Form; 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; use think\facade\Route as Url;
/** /**
@ -26,9 +30,9 @@ class AdminAuth extends AuthController
* 权限列表 * 权限列表
* @param Request $request * @param Request $request
* @return array * @return array
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function lst(Request $request) public function lst(Request $request)
{ {
@ -44,10 +48,10 @@ class AdminAuth extends AuthController
* @param int $pid * @param int $pid
* @return string * @return string
* @throws FormBuilderException * @throws FormBuilderException
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @throws \Exception * @throws Exception
*/ */
public function add($pid = 0) public function add($pid = 0)
{ {
@ -72,9 +76,9 @@ class AdminAuth extends AuthController
* @param int $id * @param int $id
* @return string * @return string
* @throws FormBuilderException * @throws FormBuilderException
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function edit($id = 0) public function edit($id = 0)
{ {

View File

@ -5,6 +5,10 @@ namespace app\admin\controller;
use app\common\model\AdminLog as lModel; use app\common\model\AdminLog as lModel;
use app\Request; use app\Request;
use app\admin\extend\Util as Util; 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 * @return string
* @throws \Exception * @throws Exception
*/ */
public function index() public function index()
{ {
@ -29,9 +33,9 @@ class AdminLog extends AuthController
* 权限列表 * 权限列表
* @param Request $request * @param Request $request
* @return array * @return array
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function lst(Request $request) public function lst(Request $request)
{ {
@ -49,7 +53,7 @@ class AdminLog extends AuthController
/** /**
* 清空日志 * 清空日志
* @param Request $request * @param Request $request
* @throws \Exception * @throws Exception
*/ */
public function empty(Request $request) public function empty(Request $request)
{ {

View File

@ -4,6 +4,7 @@ namespace app\admin\controller;
use app\admin\extend\Util as Util; use app\admin\extend\Util as Util;
use app\common\model\AdminNotify as nModel; use app\common\model\AdminNotify as nModel;
use Exception;
/** /**
* 消息提醒 * 消息提醒
@ -15,7 +16,7 @@ class AdminNotify extends AuthController
/** /**
* 列表 * 列表
* @return mixed * @return mixed
* @throws \Exception * @throws Exception
*/ */
public function index() public function index()
{ {

View File

@ -9,6 +9,9 @@ use FormBuilder\Exception\FormBuilderException;
use app\admin\extend\Util as Util; use app\admin\extend\Util as Util;
use FormBuilder\Factory\Elm; use FormBuilder\Factory\Elm;
use app\admin\extend\FormBuilder as Form; 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 class AdminRole extends AuthController
{ {
@ -21,9 +24,9 @@ class AdminRole extends AuthController
* 角色列表 * 角色列表
* @param Request $request * @param Request $request
* @return array * @return array
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function lst(Request $request) public function lst(Request $request)
{ {
@ -35,9 +38,9 @@ class AdminRole extends AuthController
* @param int $pid * @param int $pid
* @return string * @return string
* @throws FormBuilderException * @throws FormBuilderException
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function add($pid = 0) public function add($pid = 0)
{ {
@ -57,9 +60,9 @@ class AdminRole extends AuthController
* @param int $id * @param int $id
* @return string * @return string
* @throws FormBuilderException * @throws FormBuilderException
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function edit($id = 0) public function edit($id = 0)
{ {

View File

@ -3,35 +3,30 @@
namespace app\admin\controller; namespace app\admin\controller;
use app\admin\extend\FormBuilder as Form; use app\admin\extend\FormBuilder as Form;
use app\admin\extend\Util as Util;
use app\common\constant\Data; use app\common\constant\Data;
use app\common\model\Advert as aModel; use app\common\model\Advert as aModel;
use app\Request; use app\Request;
use app\admin\extend\Util as Util; use Exception;
use FormBuilder\Exception\FormBuilderException;
use FormBuilder\Factory\Elm; 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; use think\facade\Route as Url;
/** /**
* Class Poster * Class Advert
* @package app\admin\controller * @package app\admin\controller
* @author 李玉坤 * @author 李玉坤
* @date 2021-07-26 17:53 * @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 * @return string
* @throws \Exception * @throws Exception
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-19 11:53 * @date 2021-02-19 11:53
*/ */
@ -40,13 +35,18 @@ class Poster extends AuthController
return $this->fetch(); return $this->fetch();
} }
public function navList(Request $request)
{
return app("json")->layui(Data::ADVERT_NAV_LIST);
}
/** /**
* 文章列表 * 文章列表
* @param Request $request * @param Request $request
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-15 23:26 * @date 2021-02-15 23:26
*/ */
@ -67,7 +67,7 @@ class Poster extends AuthController
* 添加广告 * 添加广告
* @param Request $request * @param Request $request
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function add(Request $request) public function add(Request $request)
{ {
@ -78,7 +78,7 @@ class Poster extends AuthController
$form[] = Elm::input('sort', '排序')->col(10); $form[] = Elm::input('sort', '排序')->col(10);
$form[] = Elm::select('position', '位置')->options(function () { $form[] = Elm::select('position', '位置')->options(function () {
$options = []; $options = [];
foreach (['顶部页签', '右侧广告位', '文章页面'] as $k => $v) { foreach (Data::ADVERT_NAV_LIST as $k => $v) {
$options[] = Elm::option($k, $v); $options[] = Elm::option($k, $v);
} }
return $options; return $options;
@ -92,26 +92,26 @@ class Poster extends AuthController
/** /**
* 修改banner * 修改banner
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function edit($id = "") public function edit($id = "")
{ {
if (!$id) return app("json")->fail("数据id不能为空"); if (!$id) return app("json")->fail("数据id不能为空");
$ainfo = aModel::get($id); $info = aModel::get($id);
if (!$ainfo) return app("json")->fail("没有该数据"); if (!$info) return app("json")->fail("没有该数据");
$form = array(); $form = array();
$form[] = Elm::input('title', '广告名称', $ainfo['title'])->col(10); $form[] = Elm::input('title', '广告名称', $info['title'])->col(10);
$form[] = Elm::input('url', '链接地址', $ainfo['url'])->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)), $ainfo['cover_path'])->icon("ios-image")->width('96%')->height('440px')->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', '排序', $ainfo['sort'])->col(10); $form[] = Elm::input('sort', '排序', $info['sort'])->col(10);
$form[] = Elm::select('position', '位置', $ainfo['position'])->options(function () { $form[] = Elm::select('position', '位置', $info['position'])->options(function () {
$options = []; $options = [];
foreach (['顶部页签', '右侧广告位', '文章页面'] as $k => $v) { foreach (Data::ADVERT_NAV_LIST as $k => $v) {
$options[] = Elm::option($k, $v); $options[] = Elm::option($k, $v);
} }
return $options; return $options;
})->col(10); })->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()); $form = Form::make_post_form($form, url('save', ['id' => $id])->build());
$this->assign(compact('form')); $this->assign(compact('form'));
return $this->fetch("public/form-builder"); return $this->fetch("public/form-builder");
@ -129,7 +129,7 @@ class Poster extends AuthController
['title', ''], ['title', ''],
['url', ''], ['url', ''],
['cover_path', ''], ['cover_path', ''],
['position', 0], ['position', 1],
['sort', ''], ['sort', ''],
['status', 1], ['status', 1],
]); ]);

View File

@ -9,6 +9,9 @@ use app\common\model\DocumentArticle;
use app\common\model\Comment as CommentModel; use app\common\model\Comment as CommentModel;
use app\Request; use app\Request;
use app\admin\extend\Util as Util; 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\Exception;
use think\facade\Log; use think\facade\Log;
@ -33,9 +36,9 @@ class Article extends AuthController
/** /**
* 文章列表 * 文章列表
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-15 23:26 * @date 2021-02-15 23:26
*/ */
@ -166,9 +169,9 @@ class Article extends AuthController
* 新增文章 * 新增文章
* @param $category_id * @param $category_id
* @return string * @return string
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-03-10 14:46 * @date 2021-03-10 14:46
*/ */
@ -228,9 +231,9 @@ class Article extends AuthController
/** /**
* 文章评论列表 * 文章评论列表
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-11-03 23:28 * @date 2021-11-03 23:28
*/ */

View File

@ -7,6 +7,10 @@ use app\common\model\DocumentCategory as aModel;
use app\common\model\DocumentCategoryContent; use app\common\model\DocumentCategoryContent;
use app\Request; use app\Request;
use app\admin\extend\Util as Util; 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 * Class Article
@ -19,7 +23,7 @@ class Category extends AuthController
/** /**
* 分类 * 分类
* @return string * @return string
* @throws \Exception * @throws Exception
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-17 11:40 * @date 2021-02-17 11:40
*/ */
@ -32,9 +36,9 @@ class Category extends AuthController
* 权限列表 * 权限列表
* @param Request $request * @param Request $request
* @return array * @return array
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function lst(Request $request) public function lst(Request $request)
{ {
@ -108,7 +112,7 @@ class Category extends AuthController
/** /**
* 新增页 * 新增页
* @return string * @return string
* @throws \Exception * @throws Exception
*/ */
public function add($pid = '') public function add($pid = '')
{ {
@ -135,7 +139,7 @@ class Category extends AuthController
/** /**
* 编辑页 * 编辑页
* @return string * @return string
* @throws \Exception * @throws Exception
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-20 17:00 * @date 2021-02-20 17:00
*/ */

View File

@ -10,6 +10,11 @@
namespace app\admin\controller; namespace app\admin\controller;
use app\Request; 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 think\facade\Db;
use app\common\extend\Database; use app\common\extend\Database;
use app\admin\extend\Util as Util; use app\admin\extend\Util as Util;
@ -24,7 +29,7 @@ class Databases extends AuthController
* 数据库备份/还原列表 * 数据库备份/还原列表
* @param null $type * @param null $type
* @return string * @return string
* @throws \Exception * @throws Exception
* @author 李玉坤 * @author 李玉坤
* @date 2021-10-30 12:45 * @date 2021-10-30 12:45
*/ */
@ -53,9 +58,9 @@ class Databases extends AuthController
* 获取列表 * 获取列表
* @param Request $request * @param Request $request
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-10-31 0:12 * @date 2021-10-31 0:12
*/ */
@ -74,8 +79,8 @@ class Databases extends AuthController
mkdir($path, 0755, true); mkdir($path, 0755, true);
} }
$path = realpath($path); $path = realpath($path);
$flag = \FilesystemIterator::KEY_AS_FILENAME; $flag = FilesystemIterator::KEY_AS_FILENAME;
$glob = new \FilesystemIterator($path, $flag); $glob = new FilesystemIterator($path, $flag);
$list = array(); $list = array();
foreach ($glob as $name => $file) { foreach ($glob as $name => $file) {
@ -166,9 +171,9 @@ class Databases extends AuthController
/** /**
* 删除备份文件 * 删除备份文件
* @return mixed|void * @return mixed|void
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-10-30 13:31 * @date 2021-10-30 13:31
*/ */
@ -187,9 +192,9 @@ class Databases extends AuthController
/** /**
* 备份数据库 * 备份数据库
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-10-31 0:35 * @date 2021-10-31 0:35
*/ */

View File

@ -6,6 +6,9 @@ namespace app\admin\controller;
use app\common\model\Attachment; use app\common\model\Attachment;
use app\admin\extend\storage\QcloudCoService; use app\admin\extend\storage\QcloudCoService;
use app\admin\extend\Util as Util; 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\exception\ValidateException;
use think\facade\Filesystem; use think\facade\Filesystem;
use think\Request; use think\Request;
@ -15,9 +18,9 @@ class Files extends AuthController
/** /**
* 单个图片上传 * 单个图片上传
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function image() public function image()
{ {

View File

@ -7,7 +7,12 @@ use app\common\model\FriendLink as aModel;
use app\admin\extend\FormBuilder as Form; use app\admin\extend\FormBuilder as Form;
use app\Request; use app\Request;
use app\admin\extend\Util as Util; use app\admin\extend\Util as Util;
use Exception;
use FormBuilder\Exception\FormBuilderException;
use FormBuilder\Factory\Elm; 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; use think\facade\Route as Url;
/** /**
@ -21,7 +26,7 @@ class FriendLink extends AuthController
/** /**
* 账号列表 * 账号列表
* @return string * @return string
* @throws \Exception * @throws Exception
*/ */
public function index() public function index()
{ {
@ -32,9 +37,9 @@ class FriendLink extends AuthController
* 文章列表 * 文章列表
* @param Request $request * @param Request $request
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-15 23:26 * @date 2021-02-15 23:26
*/ */
@ -54,7 +59,7 @@ class FriendLink extends AuthController
/** /**
* 添加友链 * 添加友链
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function add() public function add()
{ {
@ -73,7 +78,7 @@ class FriendLink extends AuthController
/** /**
* 修改友链 * 修改友链
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function edit($id = "") public function edit($id = "")
{ {

View File

@ -5,9 +5,14 @@ namespace app\admin\controller;
use app\common\model\Attachment; use app\common\model\Attachment;
use app\common\model\AttachmentCategory; use app\common\model\AttachmentCategory;
use Exception;
use FormBuilder\Exception\FormBuilderException;
use FormBuilder\Factory\Elm; use FormBuilder\Factory\Elm;
use app\admin\extend\FormBuilder as Form; use app\admin\extend\FormBuilder as Form;
use app\admin\extend\Util as Util; use app\admin\extend\Util as Util;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
/** /**
* Class Images * Class Images
@ -28,9 +33,9 @@ class Images extends AuthController
/** /**
* @return array * @return array
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function category() public function category()
{ {
@ -42,7 +47,7 @@ class Images extends AuthController
* @param int $id * @param int $id
* @param int $pid * @param int $pid
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function addCategory($id = 0, $pid = 0) public function addCategory($id = 0, $pid = 0)
{ {
@ -65,8 +70,8 @@ class Images extends AuthController
* 目录的修改 * 目录的修改
* @param $id * @param $id
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
* @throws \Exception * @throws Exception
*/ */
public function editCategory($id = 0, $pid = 0) public function editCategory($id = 0, $pid = 0)
{ {
@ -139,10 +144,10 @@ class Images extends AuthController
/** /**
* @param $id * @param $id
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function editImage($id) public function editImage($id)
{ {
@ -185,7 +190,7 @@ class Images extends AuthController
break; break;
} }
return Attachment::del($id) ? app("json")->success("删除成功") : app("json")->fail("删除失败"); return Attachment::del($id) ? app("json")->success("删除成功") : app("json")->fail("删除失败");
} catch (\Exception $e) { } catch (Exception $e) {
return app("json")->fail("删除失败" . $e); return app("json")->fail("删除失败" . $e);
} }
} }

View File

@ -6,13 +6,17 @@ use app\common\model\AdminAuth;
use app\common\model\AdminNotify; use app\common\model\AdminNotify;
use app\Request; use app\Request;
use app\admin\extend\Util as Util; 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 class Index extends AuthController
{ {
/** /**
* 后台首页 * 后台首页
* @return string * @return string
* @throws \Exception * @throws Exception
*/ */
public function index() public function index()
{ {
@ -31,7 +35,7 @@ class Index extends AuthController
/** /**
* 控制台 * 控制台
* @return string * @return string
* @throws \Exception * @throws Exception
*/ */
public function main() public function main()
{ {
@ -40,9 +44,9 @@ class Index extends AuthController
/** /**
* 菜单 * 菜单
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function menu() public function menu()
{ {

View File

@ -5,6 +5,10 @@ namespace app\admin\controller;
use app\common\model\InvitationCode as aModel; use app\common\model\InvitationCode as aModel;
use app\Request; use app\Request;
use app\admin\extend\Util as Util; 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 * Class Invitation
@ -27,7 +31,7 @@ class Invitation extends AuthController
/** /**
* 邀请码列表 * 邀请码列表
* @return string * @return string
* @throws \Exception * @throws Exception
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-16 13:15 * @date 2021-02-16 13:15
*/ */
@ -40,9 +44,9 @@ class Invitation extends AuthController
* 文章列表 * 文章列表
* @param Request $request * @param Request $request
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-15 23:26 * @date 2021-02-15 23:26
*/ */
@ -60,9 +64,9 @@ class Invitation extends AuthController
* 保存修改 * 保存修改
* @param string $id * @param string $id
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-20 14:32 * @date 2021-02-20 14:32
*/ */
@ -92,9 +96,9 @@ class Invitation extends AuthController
* 批量添加 * 批量添加
* @param string $id * @param string $id
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-20 14:35 * @date 2021-02-20 14:35
*/ */

View File

@ -5,6 +5,11 @@ namespace app\admin\controller;
use app\common\model\Admin as adminModel; use app\common\model\Admin as adminModel;
use app\admin\extend\Util as Util; 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 class Login extends AuthController
{ {
@ -17,7 +22,7 @@ class Login extends AuthController
/** /**
* 登录 * 登录
* @return string * @return string
* @throws \Exception * @throws Exception
*/ */
public function login() public function login()
{ {
@ -27,9 +32,9 @@ class Login extends AuthController
/** /**
* 验证登录 * 验证登录
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function verify() public function verify()
{ {
@ -45,7 +50,7 @@ class Login extends AuthController
/** /**
* 注册 * 注册
* @return string * @return string
* @throws \Exception * @throws Exception
*/ */
public function register() public function register()
{ {
@ -55,7 +60,7 @@ class Login extends AuthController
/** /**
* 忘记密码 * 忘记密码
* @return string * @return string
* @throws \Exception * @throws Exception
*/ */
public function forget() public function forget()
{ {
@ -65,7 +70,7 @@ class Login extends AuthController
/** /**
* 退出登陆 * 退出登陆
* @return mixed * @return mixed
* @throws \Exception * @throws Exception
*/ */
public function logout() public function logout()
{ {
@ -74,7 +79,7 @@ class Login extends AuthController
/** /**
* 验证码 * 验证码
* @return \think\Response * @return Response
*/ */
public function captcha() public function captcha()
{ {

View File

@ -5,6 +5,10 @@ namespace app\admin\controller;
use app\common\model\MessageForm as aModel; use app\common\model\MessageForm as aModel;
use app\Request; use app\Request;
use app\admin\extend\Util as Util; 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 * Class Message
@ -27,7 +31,7 @@ class Message extends AuthController
/** /**
* 留言管理 * 留言管理
* @return string * @return string
* @throws \Exception * @throws Exception
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-19 11:53 * @date 2021-02-19 11:53
*/ */
@ -40,9 +44,9 @@ class Message extends AuthController
* 留言列表 * 留言列表
* @param Request $request * @param Request $request
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-19 11:54 * @date 2021-02-19 11:54
*/ */

View File

@ -20,7 +20,7 @@ class SystemBasic extends BaseController
* @param string $title 标题 * @param string $title 标题
* @param int $duration 持续时间 * @param int $duration 持续时间
* @return mixed * @return mixed
* @throws \Exception * @throws Exception
*/ */
protected function failedNotice($msg = '操作失败', $backUrl = 0, $info = '', $duration = 3) protected function failedNotice($msg = '操作失败', $backUrl = 0, $info = '', $duration = 3)
{ {

View File

@ -6,9 +6,15 @@ use app\common\constant\Data;
use app\common\model\SystemConfig as cModel; use app\common\model\SystemConfig as cModel;
use app\common\model\SystemConfigTab as tModel; use app\common\model\SystemConfigTab as tModel;
use app\Request; use app\Request;
use Exception;
use FormBuilder\Exception\FormBuilderException;
use FormBuilder\Factory\Elm; use FormBuilder\Factory\Elm;
use app\admin\extend\FormBuilder as Form; use app\admin\extend\FormBuilder as Form;
use app\admin\extend\Util as Util; 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 * @param int $tab_id
* @return string * @return string
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function base($tab_id = 1) public function base($tab_id = 1)
{ {
@ -48,7 +54,7 @@ class SystemConfig extends AuthController
/** /**
* @param Request $request * @param Request $request
* @return * @return
* @throws \Psr\SimpleCache\InvalidArgumentException * @throws InvalidArgumentException
*/ */
public function clearCache(Request $request) public function clearCache(Request $request)
{ {
@ -67,9 +73,9 @@ class SystemConfig extends AuthController
* 列表 * 列表
* @param int $tab_id * @param int $tab_id
* @return string * @return string
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function lst(Request $request) public function lst(Request $request)
{ {
@ -85,7 +91,7 @@ class SystemConfig extends AuthController
* 列表 * 列表
* @param int $tab_id * @param int $tab_id
* @return string * @return string
* @throws \Exception * @throws Exception
*/ */
public function index($tab_id = 0) public function index($tab_id = 0)
{ {
@ -97,7 +103,7 @@ class SystemConfig extends AuthController
* 添加 * 添加
* @param Request $request * @param Request $request
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function add(Request $request) public function add(Request $request)
{ {
@ -123,7 +129,7 @@ class SystemConfig extends AuthController
* 修改 * 修改
* @param Request $request * @param Request $request
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function edit($id = '') public function edit($id = '')
{ {
@ -198,7 +204,7 @@ class SystemConfig extends AuthController
foreach ($request->param() as $k => $v) cModel::editValueByFormName($k, $v); foreach ($request->param() as $k => $v) cModel::editValueByFormName($k, $v);
cache(Data::DATA_SYSTEM_CONFIG, null);//清除缓存 cache(Data::DATA_SYSTEM_CONFIG, null);//清除缓存
return app("json")->success("操作成功"); return app("json")->success("操作成功");
} catch (\Exception $e) { } catch (Exception $e) {
return app("json")->fail("操作失败"); return app("json")->fail("操作失败");
} }

View File

@ -4,11 +4,15 @@ namespace app\admin\controller;
use app\Request; use app\Request;
use FormBuilder\Exception\FormBuilderException;
use FormBuilder\Factory\Elm; use FormBuilder\Factory\Elm;
use app\admin\extend\FormBuilder as Form; use app\admin\extend\FormBuilder as Form;
use app\admin\extend\Util as Util; use app\admin\extend\Util as Util;
use app\common\model\SystemConfigTab as tModel; use app\common\model\SystemConfigTab as tModel;
use app\common\model\SystemConfig as cModel; 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 * @param Request $request
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function add(Request $request) public function add(Request $request)
{ {
@ -59,7 +63,7 @@ class SystemConfigTab extends AuthController
* 修改 * 修改
* @param Request $request * @param Request $request
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function edit($id = '') public function edit($id = '')
{ {
@ -104,9 +108,9 @@ class SystemConfigTab extends AuthController
* 重写删除 * 重写删除
* @param Request $request * @param Request $request
* @return mixed|void * @return mixed|void
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function del(Request $request) public function del(Request $request)
{ {

View File

@ -5,6 +5,7 @@ namespace app\admin\controller;
use app\common\model\SystemConfig as cModel; use app\common\model\SystemConfig as cModel;
use app\Request; use app\Request;
use app\admin\extend\Util as Util; use app\admin\extend\Util as Util;
use Exception;
/** /**
* Class Theme * Class Theme
@ -17,7 +18,7 @@ class Theme extends AuthController
/** /**
* 主题列表 * 主题列表
* @return string * @return string
* @throws \Exception * @throws Exception
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-17 11:40 * @date 2021-02-17 11:40
*/ */
@ -53,7 +54,7 @@ class Theme extends AuthController
/** /**
* 更新主题 * 更新主题
* @return string * @return string
* @throws \Exception * @throws Exception
* @author 李玉坤 * @author 李玉坤
* @date 2021-02-17 11:40 * @date 2021-02-17 11:40
*/ */

View File

@ -5,8 +5,13 @@ namespace app\admin\controller;
use app\common\model\User as aModel; use app\common\model\User as aModel;
use app\Request; use app\Request;
use app\admin\extend\Util as Util; use app\admin\extend\Util as Util;
use Exception;
use FormBuilder\Exception\FormBuilderException;
use FormBuilder\Factory\Elm; use FormBuilder\Factory\Elm;
use app\admin\extend\FormBuilder as Form; 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; use think\facade\Route as Url;
/** /**
@ -21,7 +26,7 @@ class User extends AuthController
/** /**
* 账号列表 * 账号列表
* @return string * @return string
* @throws \Exception * @throws Exception
*/ */
public function index() public function index()
{ {
@ -32,9 +37,9 @@ class User extends AuthController
* 账号列表 * 账号列表
* @param Request $request * @param Request $request
* @return * @return
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function lst(Request $request) public function lst(Request $request)
{ {
@ -55,7 +60,7 @@ class User extends AuthController
* 添加账号 * 添加账号
* @param Request $request * @param Request $request
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function add(Request $request) public function add(Request $request)
{ {
@ -76,7 +81,7 @@ class User extends AuthController
/** /**
* 修改账号 * 修改账号
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public function edit($id = "") public function edit($id = "")
{ {

View File

@ -3,6 +3,7 @@
namespace app\admin\extend; namespace app\admin\extend;
use FormBuilder\Exception\FormBuilderException;
use FormBuilder\Form\IviewForm; use FormBuilder\Form\IviewForm;
/** /**
@ -17,7 +18,7 @@ class FormBuilder
* @param $rule * @param $rule
* @param $url * @param $url
* @return string * @return string
* @throws \FormBuilder\Exception\FormBuilderException * @throws FormBuilderException
*/ */
public static function make_post_form($rule, $url) public static function make_post_form($rule, $url)
{ {

View File

@ -246,7 +246,7 @@
datas[i].check = checked; datas[i].check = checked;
selectChilds(datas, datas[i], id, pid, checked); selectChilds(datas, datas[i], id, pid, checked);
} }
;
} }
} }
@ -256,7 +256,7 @@
datas[i].check = true; datas[i].check = true;
selectParentChecked(datas, datas[i], id, pid); selectParentChecked(datas, datas[i], id, pid);
} }
;
} }
} }

View File

@ -180,7 +180,7 @@
datas[i].check = checked; datas[i].check = checked;
selectChilds(datas, datas[i], id, pid, checked); selectChilds(datas, datas[i], id, pid, checked);
} }
;
} }
} }
@ -190,7 +190,7 @@
datas[i].check = true; datas[i].check = true;
selectParentChecked(datas, datas[i], id, pid); selectParentChecked(datas, datas[i], id, pid);
} }
;
} }
} }

View File

@ -44,7 +44,7 @@
<div class="card-toolbar clearfix"> <div class="card-toolbar clearfix">
<div id="toolbar" class="toolbar-btn-action"> <div id="toolbar" class="toolbar-btn-action">
<button id="btn_add" type="button" class="btn btn-primary m-r-5" <button id="btn_add" type="button" class="btn btn-primary m-r-5"
onclick="iframe.createIframe('添加广告','/admin/poster/add')"> onclick="iframe.createIframe('添加广告','/admin/advert/add')">
<span class="mdi mdi-plus" aria-hidden="true"></span>新增 <span class="mdi mdi-plus" aria-hidden="true"></span>新增
</button> </button>
<a class="btn btn-warning" href="#!" onclick="delSelect()"><i class="mdi mdi-window-close"></i> <a class="btn btn-warning" href="#!" onclick="delSelect()"><i class="mdi mdi-window-close"></i>
@ -60,9 +60,14 @@
</div> </div>
{include file="public/footer"/} {include file="public/footer"/}
<script type="text/javascript"> <script type="text/javascript">
var nav_list;
$.get('/admin/advert/navList',function (res) {
nav_list = res.data
})
$('#tb_departments').bootstrapTable({ $('#tb_departments').bootstrapTable({
classes: 'table table-bordered table-hover table-striped', classes: 'table table-bordered table-hover table-striped',
url: '/admin/poster/Lst', url: '/admin/advert/lst',
method: 'post', method: 'post',
dataType: 'json', // 因为本示例中是跨域的调用,所以涉及到ajax都采用jsonp, dataType: 'json', // 因为本示例中是跨域的调用,所以涉及到ajax都采用jsonp,
uniqueId: 'id', uniqueId: 'id',
@ -105,17 +110,8 @@
}, { }, {
field: 'position', field: 'position',
title: '广告图片', title: '广告图片',
formatter: function (value, row, index) { formatter: function (value) {
switch (value) { return nav_list[value]
case 1:
return '顶部页签';
case 2:
return '右侧广告位';
case 3:
return '文章页面';
default:
return '顶部页签';
}
} }
}, { }, {
field: 'url', field: 'url',
@ -129,7 +125,7 @@
formatter: operateFormatter, formatter: operateFormatter,
events: { events: {
'click .btn-edit': function (event, value, row, index) { 'click .btn-edit': function (event, value, row, index) {
iframe.createIframe('修改广告', '/admin/poster/edit?id=' + row.id) iframe.createIframe('修改广告', '/admin/advert/edit?id=' + row.id)
}, },
'click .btn-del': function (event, value, row, index) { 'click .btn-del': function (event, value, row, index) {
$.alert({ $.alert({
@ -140,7 +136,7 @@
text: '确认', text: '确认',
btnClass: 'btn-primary', btnClass: 'btn-primary',
action: function () { action: function () {
$.post(url = "/admin/poster/del", data = {"id": row.id}, function (res) { $.post(url = "/admin/advert/del", data = {"id": row.id}, function (res) {
if (res.status == 200) { if (res.status == 200) {
parent.lightyear.notify('删除成功', 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center'); parent.lightyear.notify('删除成功', 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
$("#tb_departments").bootstrapTable('refresh'); $("#tb_departments").bootstrapTable('refresh');
@ -190,7 +186,7 @@
text: '确认', text: '确认',
btnClass: 'btn-danger', btnClass: 'btn-danger',
action: function () { action: function () {
$.post("/admin/poster/del", data = {id: id}, function (res) { $.post("/admin/advert/del", data = {id: id}, function (res) {
if (res.status == 200 || res.code == 200) lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center'); if (res.status == 200 || res.code == 200) lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-neutral', 'top', 'center'); else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-neutral', 'top', 'center');
location.reload(); location.reload();
@ -222,7 +218,7 @@
text: '确认', text: '确认',
btnClass: 'btn-danger', btnClass: 'btn-danger',
action: function () { action: function () {
$.post("/admin/poster/del", data = {id: checkID}, function (res) { $.post("/admin/advert/del", data = {id: checkID}, function (res) {
if (res.status == 200 || res.code == 200) { if (res.status == 200 || res.code == 200) {
lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center'); lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
location.reload(); location.reload();

View File

@ -15,7 +15,7 @@
<li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li> <li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li>
<li><a href="#profile" role="tab" id="profile-tab" data-toggle="tab">文章设置</a></li> <li><a href="#profile" role="tab" id="profile-tab" data-toggle="tab">文章设置</a></li>
<li class="tab-right"><a data-toggle="tooltip" data-original-title="返回" <li class="tab-right"><a data-toggle="tooltip" data-original-title="返回"
onclick="javascript:history.back(-1);return false;">返 回</a></li> onclick="history.back(-1);return false;">返 回</a></li>
</ul> </ul>
<div id="myTabContent" class="tab-content"> <div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="home"> <div class="tab-pane fade active in" id="home">

View File

@ -15,7 +15,7 @@
<li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li> <li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li>
<li><a href="#profile" role="tab" id="profile-tab" data-toggle="tab">文章设置</a></li> <li><a href="#profile" role="tab" id="profile-tab" data-toggle="tab">文章设置</a></li>
<li class="tab-right"><a data-toggle="tooltip" data-original-title="返回" <li class="tab-right"><a data-toggle="tooltip" data-original-title="返回"
onclick="javascript:history.back(-1);return false;">返 回</a></li> onclick="history.back(-1);return false;">返 回</a></li>
</ul> </ul>
<div id="myTabContent" class="tab-content"> <div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="home"> <div class="tab-pane fade active in" id="home">

View File

@ -15,7 +15,7 @@
<li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li> <li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li>
<li><a href="#profile" role="tab" id="profile-tab" data-toggle="tab">SEO设置</a></li> <li><a href="#profile" role="tab" id="profile-tab" data-toggle="tab">SEO设置</a></li>
<li class="tab-right"><a data-toggle="tooltip" data-original-title="返回" <li class="tab-right"><a data-toggle="tooltip" data-original-title="返回"
onclick="javascript:history.back(-1);return false;">返 回</a></li> onclick="history.back(-1);return false;">返 回</a></li>
</ul> </ul>
<div id="myTabContent" class="tab-content"> <div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="home"> <div class="tab-pane fade active in" id="home">

View File

@ -15,7 +15,7 @@
<li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li> <li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li>
<li><a href="#profile" role="tab" id="profile-tab" data-toggle="tab">SEO设置</a></li> <li><a href="#profile" role="tab" id="profile-tab" data-toggle="tab">SEO设置</a></li>
<li class="tab-right"><a data-toggle="tooltip" data-original-title="返回" <li class="tab-right"><a data-toggle="tooltip" data-original-title="返回"
onclick="javascript:history.back(-1);return false;">返 回</a></li> onclick="history.back(-1);return false;">返 回</a></li>
</ul> </ul>
<div id="myTabContent" class="tab-content"> <div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="home"> <div class="tab-pane fade active in" id="home">

View File

@ -206,7 +206,7 @@
datas[i].check = checked; datas[i].check = checked;
selectChilds(datas, datas[i], id, pid, checked); selectChilds(datas, datas[i], id, pid, checked);
} }
;
} }
} }
@ -216,7 +216,7 @@
datas[i].check = true; datas[i].check = true;
selectParentChecked(datas, datas[i], id, pid); selectParentChecked(datas, datas[i], id, pid);
} }
;
} }
} }

View File

@ -138,7 +138,7 @@
if (null == value || value == '') { if (null == value || value == '') {
return "0 Bytes"; return "0 Bytes";
} }
var unitArr = new Array("Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"); var unitArr = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
var index = 0; var index = 0;
var srcsize = parseFloat(value); var srcsize = parseFloat(value);
index = Math.floor(Math.log(srcsize) / Math.log(1024)); index = Math.floor(Math.log(srcsize) / Math.log(1024));

View File

@ -142,7 +142,7 @@
if (null == value || value == '') { if (null == value || value == '') {
return "0 Bytes"; return "0 Bytes";
} }
var unitArr = new Array("Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"); var unitArr = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
var index = 0; var index = 0;
var srcsize = parseFloat(value); var srcsize = parseFloat(value);
index = Math.floor(Math.log(srcsize) / Math.log(1024)); index = Math.floor(Math.log(srcsize) / Math.log(1024));

View File

@ -345,7 +345,7 @@
this.checkedImage.remove(item.path); this.checkedImage.remove(item.path);
} else { } else {
if (this.checkedImage.length >= limit) return lightyear.notify('不能再选了,最多只能选' + limit + '个', 'danger', 1000, 'mdi mdi-emoticon-neutral', 'top', 'center'); if (this.checkedImage.length >= limit) return lightyear.notify('不能再选了,最多只能选' + limit + '个', 'danger', 1000, 'mdi mdi-emoticon-neutral', 'top', 'center');
;
this.checkedImageId.push(item.id); this.checkedImageId.push(item.id);
this.checkedImage.push(item.path); this.checkedImage.push(item.path);
} }

View File

@ -51,6 +51,6 @@
</section> </section>
<script type="text/javascript" src="/static/admin/js/jquery.min.js"></script> <script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/admin/js/bootstrap.min.js"></script> <script type="text/javascript" src="/static/admin/js/bootstrap.min.js"></script>
<script type="text/javascript">;</script> <script type="text/javascript"></script>
</body> </body>
</html> </html>

View File

@ -49,6 +49,6 @@
</section> </section>
<script type="text/javascript" src="/static/admin/js/jquery.min.js"></script> <script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/admin/js/bootstrap.min.js"></script> <script type="text/javascript" src="/static/admin/js/bootstrap.min.js"></script>
<script type="text/javascript">;</script> <script type="text/javascript"></script>
</body> </body>
</html> </html>

View File

@ -76,6 +76,5 @@
{/if} {/if}
<script type="text/javascript" src="/static/admin/js/jquery.min.js"></script> <script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/admin/js/bootstrap.min.js"></script> <script type="text/javascript" src="/static/admin/js/bootstrap.min.js"></script>
<script type="text/javascript">;</script>
</body> </body>
</html> </html>

View File

@ -2,6 +2,9 @@
use app\common\model\SystemConfig; use app\common\model\SystemConfig;
use app\common\constant\Data; 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')) { if (!function_exists('system_config_more')) {
@ -9,9 +12,9 @@ if (!function_exists('system_config_more')) {
* 获取系统配置值 * 获取系统配置值
* @param array $formNames * @param array $formNames
* @return array * @return array
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
function system_config_more(array $formNames): array function system_config_more(array $formNames): array
{ {
@ -65,9 +68,9 @@ if (!function_exists('system_config')) {
* 获取系统配置值 * 获取系统配置值
* @param string $formName * @param string $formName
* @return string * @return string
* @throws \think\db\exception\DataNotFoundException * @throws DataNotFoundException
* @throws \think\db\exception\DbException * @throws DbException
* @throws \think\db\exception\ModelNotFoundException * @throws ModelNotFoundException
*/ */
function system_config(string $formName): string function system_config(string $formName): string
{ {

View File

@ -16,6 +16,15 @@ class Data
const DATA_SYSTEM_CONFIG = 'data_system_config'; //系统配置 const DATA_SYSTEM_CONFIG = 'data_system_config'; //系统配置
const DATA_ADVERT = 'data_advert'; //广告 const DATA_ADVERT = 'data_advert'; //广告
//广告位
const ADVERT_NAV_LIST = [
1 => '主页banner',
2 => '主页推荐位置',
3 => '主页右侧广告位',
4 => '文章banner',
5 => '文章右侧广告位置',
];
//后台用户sessionKey //后台用户sessionKey
const SESSION_KEY_ADMIN_ID = 'admin_id'; const SESSION_KEY_ADMIN_ID = 'admin_id';
const SESSION_KEY_ADMIN_INFO = 'admin_info'; const SESSION_KEY_ADMIN_INFO = 'admin_info';

View File

@ -1,5 +1,7 @@
<?php <?php
// 事件定义文件 // 事件定义文件
use app\admin\subscribes\AdminSubscribe;
return [ return [
'bind' => [ 'bind' => [
], ],
@ -13,6 +15,6 @@ return [
], ],
'subscribe' => [ 'subscribe' => [
\app\admin\subscribes\AdminSubscribe::class, // 操作记录 AdminSubscribe::class, // 操作记录
], ],
]; ];

View File

@ -578,14 +578,14 @@ function tpl_get_friend_link($type, $row)
*/ */
function tpl_get_advert($type, $row) function tpl_get_advert($type, $row)
{ {
$advertList = cache('DATA_ADVERT' . '_' . $type); $advertList = cache(Data::DATA_ADVERT . '_' . $type);
if ($advertList === null) { if ($advertList === null) {
if ($type > 0) { if ($type > 0) {
$advertList = Db::name('advert')->where('position', $type)->where('status', 1)->order('sort desc')->limit($row)->select(); $advertList = Db::name('advert')->where('position', $type)->where('status', 1)->order('sort desc')->limit($row)->select();
} else { } else {
$advertList = Db::name('advert')->where('status', 1)->order('sort desc')->limit($row)->select(); $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 = []; $advertListTemp = [];
foreach ($advertList as $key => $item) { foreach ($advertList as $key => $item) {

View File

@ -1,10 +1,13 @@
<?php <?php
// 全局中间件定义文件 // 全局中间件定义文件
use think\middleware\LoadLangPack;
use think\middleware\SessionInit;
return [ return [
// 全局请求缓存 // 全局请求缓存
// \think\middleware\CheckRequestCache::class, // \think\middleware\CheckRequestCache::class,
// 多语言加载 // 多语言加载
\think\middleware\LoadLangPack::class, LoadLangPack::class,
// Session初始化 // Session初始化
\think\middleware\SessionInit::class SessionInit::class
]; ];

View File

@ -1172,7 +1172,7 @@ $.format = $.validator.format;
return $.event.handle.call(this, e); return $.event.handle.call(this, e);
} }
}); });
}; }
$.extend($.fn, { $.extend($.fn, {
validateDelegate: function(delegate, type, handler) { validateDelegate: function(delegate, type, handler) {
return this.bind(type, function(event) { return this.bind(type, function(event) {

View File

@ -157,7 +157,7 @@
<div class="bottom tac"> <div class="bottom tac">
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?step=2" class="btn">重新检测</a> <a href="<?php echo $_SERVER['PHP_SELF']; ?>?step=2" class="btn">重新检测</a>
<?php if($err>0){?> <?php if($err>0){?>
<a href="javascript:void(0)" onClick="javascript:alert('安装环境检测未通过,请检查')" class="btn" style="background: gray;">下一步</a> <a href="javascript:void(0)" onClick="alert('安装环境检测未通过,请检查')" class="btn" style="background: gray;">下一步</a>
<?php }else{?> <?php }else{?>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?step=3" class="btn">下一步</a> <a href="<?php echo $_SERVER['PHP_SELF']; ?>?step=3" class="btn">下一步</a>
<?php }?> <?php }?>

View File

@ -21,7 +21,7 @@
<ul id="loginner"> <ul id="loginner">
</ul> </ul>
</div> </div>
<div class="bottom tac"> <a href="javascript:;" class="btn_old"><img src="./images/install/loading.gif" align="absmiddle" />&nbsp;正在安装...</a> </div> <div class="bottom tac"> <a href="javascript:" class="btn_old"><img src="./images/install/loading.gif" align="absmiddle" />&nbsp;正在安装...</a> </div>
</section> </section>
<script type="text/javascript"> <script type="text/javascript">
var n=-1; var n=-1;

View File

@ -121,7 +121,7 @@
<div class="post-turn-page-main"> <div class="post-turn-page-main">
<a href="{:url('/index/article/detail')}?id={$field['id']}">{$field['title']}</a> <a href="{:url('/index/article/detail')}?id={$field['id']}">{$field['title']}</a>
<div class="post-turn-page-link-next"> <div class="post-turn-page-link-next">
<a href="javascript:;">下一篇>></a> <a href="javascript:">下一篇>></a>
</div> </div>
</div> </div>
{/ape:prenext} {/ape:prenext}

View File

@ -56,10 +56,10 @@
<div> <div>
{notempty name="$field['image']"} {notempty name="$field['image']"}
<img class="frinds-links-icon img-lazyload" src="{$field['image']}" data-original="{$field['image']}" <img class="frinds-links-icon img-lazyload" src="{$field['image']}" data-original="{$field['image']}"
onerror="javascript:this.src='__IMG__/chrome.png'" class="link-icon" alt=""> onerror="this.src='__IMG__/chrome.png'" class="link-icon" alt="">
{else /} {else /}
<img class="frinds-links-icon img-lazyload" src="__IMG__/chrome.png" data-original="__IMG__/chrome.png" <img class="frinds-links-icon img-lazyload" src="__IMG__/chrome.png" data-original="__IMG__/chrome.png"
onerror="javascript:this.src='__IMG__/chrome.png'" class="link-icon" alt=""> onerror="this.src='__IMG__/chrome.png'" class="link-icon" alt="">
{/notempty} {/notempty}
</div> </div>
<div class="link-info-plane"> <div class="link-info-plane">

View File

@ -56,7 +56,7 @@
</style> </style>
<div class="index-top-postcard-plane"> <div class="index-top-postcard-plane">
<div class="index-top-postcard-body"> <div class="index-top-postcard-body">
{ape:advert row="4" type="1"} {ape:advert row="4" type="2"}
<div class="index-top-postcard-item"> <div class="index-top-postcard-item">
<div class="index-top-postcard-main"> <div class="index-top-postcard-main">
<div class="post-item-thumbnail"> <div class="post-item-thumbnail">
@ -259,10 +259,10 @@
<a href="{$field['url']}" title="{$field['title']}" target="_blank"> <a href="{$field['url']}" title="{$field['title']}" target="_blank">
{notempty name="$field['image']"} {notempty name="$field['image']"}
<img class="frinds-links-icon img-lazyload" src="{$field['image']}" data-original="{$field['image']}" <img class="frinds-links-icon img-lazyload" src="{$field['image']}" data-original="{$field['image']}"
onerror="javascript:this.src='__IMG__/chrome.png'"> onerror="this.src='__IMG__/chrome.png'">
{else /} {else /}
<img class="frinds-links-icon img-lazyload" src="__IMG__/chrome.png" data-original="__IMG__/chrome.png" <img class="frinds-links-icon img-lazyload" src="__IMG__/chrome.png" data-original="__IMG__/chrome.png"
onerror="javascript:this.src='__IMG__/chrome.png'"> onerror="this.src='__IMG__/chrome.png'">
{/notempty} {$field['title']} {/notempty} {$field['title']}
</a> </a>
</li> </li>

View File

@ -22,7 +22,7 @@ init_dark();
function init_dark() { function init_dark() {
!0 === cp_user_get_dark() ? loaddarkcss() : "" === cp_user_get_dark() ? 1 == set.autodark ? cp_isdark() ? loaddarkcss() : def_dark() : def_dark() : removedarkcss() !0 === cp_user_get_dark() ? loaddarkcss() : "" === cp_user_get_dark() ? 1 == set.autodark ? cp_isdark() ? loaddarkcss() : def_dark() : def_dark() : removedarkcss()
}; }
function copyaddurl(content) { function copyaddurl(content) {
if (set.reprint.addurl == 0) { if (set.reprint.addurl == 0) {
@ -170,7 +170,7 @@ $(document).ready(function () {
for (let i = 0; i < links_url_arr.length; i++) { for (let i = 0; i < links_url_arr.length; i++) {
var url = $(links_url_arr[i]).children('a').attr('href') + '/favicon.ico'; var url = $(links_url_arr[i]).children('a').attr('href') + '/favicon.ico';
var default_url = set.index.chromeiconurl; var default_url = set.index.chromeiconurl;
$(links_url_arr[i]).children('a').prepend(`<img class="frinds-links-icon img-lazyload" src="${default_url}" data-original="${url}" onerror="javascript:this.src='${default_url}'"> `); $(links_url_arr[i]).children('a').prepend(`<img class="frinds-links-icon img-lazyload" src="${default_url}" data-original="${url}" onerror="this.src='${default_url}'"> `);
} }
setTimeout(function () { setTimeout(function () {
endloadhtml(); endloadhtml();
@ -196,7 +196,7 @@ $(document).scroll(function () {
var name = $(this).attr('catalog'); var name = $(this).attr('catalog');
set_catalog_css(); set_catalog_css();
$('p[catalog=' + name + ']').addClass('catalog-hover'); $('p[catalog=' + name + ']').addClass('catalog-hover');
return;
} }
}); });

View File

@ -152,4 +152,3 @@ function loadlazyimg() {
$("img.thumbnail").trigger("load") $("img.thumbnail").trigger("load")
}, 1E3))) }, 1E3)))
} }
;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 KiB

After

Width:  |  Height:  |  Size: 395 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB