diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 09147f5..9bce943 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -22,7 +22,6 @@ use app\admin\model\Article; use app\admin\model\Cunsult; use think\facade\Config; use taoler\com\Api; -use taoser\SetArr; use app\common\lib\facade\HttpHelper; class Index extends AdminController @@ -123,21 +122,22 @@ class Index extends AdminController } //版本检测 - public function getVersion() - { - $verCheck = Api::urlPost($this->sys['upcheck_url'],['pn'=>$this->pn,'ver'=>$this->sys_version]); - if($verCheck->code !== -1){ - return $verCheck->code ? "有{$verCheck->up_num}个版本需更新,当前可更新至{$verCheck->version}" : $verCheck->msg; - } else { - return lang('No new messages'); - } - } +// public function getVersion() +// { +// $verCheck = Api::urlPost($this->sys['upcheck_url'],['pn'=>$this->pn,'ver'=>$this->sys_version]); +// if($verCheck->code !== -1){ +// return $verCheck->code ? "有{$verCheck->up_num}个版本需更新,当前可更新至{$verCheck->version}" : $verCheck->msg; +// } else { +// return lang('No new messages'); +// } +// } public function checkVersion() { - $verCheck = Api::urlPost($this->sys['upcheck_url'],['pn'=>$this->pn,'ver'=>$this->sys_version]); - if($verCheck->code !== -1){ - return $verCheck->code ? "有{$verCheck->up_num}个版本需更新,当前可更新至{$verCheck->version}" : $verCheck->msg; + $data = ['pn'=>$this->pn,'ver'=>$this->sys_version]; + $response = HttpHelper::withHost()->get('/v1/upload/check', $data)->toJson(); + if($response->code !== -1){ + return $response->code ? "有{$response->up_num}个版本需更新,当前可更新至{$response->version}" : $response->msg; } else { return lang('No new messages'); } diff --git a/app/admin/controller/Login.php b/app/admin/controller/Login.php index 4a9b055..79faded 100644 --- a/app/admin/controller/Login.php +++ b/app/admin/controller/Login.php @@ -1,4 +1,13 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ + namespace app\admin\controller; use think\facade\View; @@ -8,10 +17,9 @@ use app\admin\validate\Admin; use think\exception\ValidateException; use app\common\controller\AdminController; - class Login extends AdminController { - //登录 + // 登录 public function index() { if(Request::isAjax()){ @@ -37,7 +45,7 @@ class Login extends AdminController public function reg() { if(Session::has('admin_id')){ - return redirect('/admin/index/index'); + return redirect('index/index'); } return View::fetch('reg'); @@ -47,7 +55,7 @@ class Login extends AdminController public function forget() { if(Session::has('admin_id')){ - return redirect('/admin/index/index'); + return redirect('index/index'); } return View::fetch('forget'); diff --git a/app/admin/controller/addon/Addons.php b/app/admin/controller/addon/Addons.php index d6f1a5a..7e478ac 100644 --- a/app/admin/controller/addon/Addons.php +++ b/app/admin/controller/addon/Addons.php @@ -19,27 +19,89 @@ use app\common\lib\FileHelper; class Addons extends AdminController { /** + * 浏览插件 * */ public function index() { - if(Request::isAjax()) { - $data = Request::param(); - if(!isset($data['type'])) $data['type'] = 'onlineAddons'; - if(!isset($data['selector'])) $data['selector'] = 'all'; - return $this->getList($data); - } +// if(Request::isAjax()) { +// $data = Request::param(); +// if(!isset($data['type'])) $data['type'] = 'onlineAddons'; +// if(!isset($data['selector'])) $data['selector'] = 'all'; +// return $this->getList($data); +// } return View::fetch(); } + /** + * 插件动态列表 + * @param $data + * @return Json + */ + public function list() + { + $param = Request::param(); + $data = ['page' => $param['page'] ?? 1, 'limit' => $param['limit'] ?? 10, 'type' => $param['type'] ?? 'all']; + $res = []; + //本地插件列表 + $localAddons = Files::getDirName('../addons/'); + + if($data['type'] == 'installed') { + $count = count($localAddons); // 安装总数 + // 已安装 + if ($count) { + $res = ['code' => 0, 'msg' => 'ok', 'count' => $count]; + // 数组分组 + $arr = array_chunk($localAddons, $data['limit']); + // 选中的页码数组 + $arrAddon = $arr[$data['page'] - 1]; + // $data数据 + foreach ($arrAddon as $k => $v) { + $info_file = '../addons/' . $v . '/info.ini'; + $info = parse_ini_file($info_file); + $info['show'] = $info['status'] ? '启用' : '禁用'; + $info['install'] = $info['status'] ? '是' : '否'; + $res['data'][] = $info; + } + return json($res); + } + return json(['code' => -1, 'msg' => '没有安装任何插件']); + } + + // 在线插件 + $response = HttpHelper::withHost()->get('/v1/addonlist', $data); + $addons = $response->toJson(); + + if($response->ok()) { + $res = ['code' => 0, 'msg' => 'ok', 'count' => $addons->count]; + // $data数据 与本地文件对比 + foreach($addons->data as $v){ + if(in_array($v->name, $localAddons)) { + $info = get_addons_info($v->name); + //已安装 + $v->isInstall = 1; + //判断是否有新版本 + if($v->version > $info['version']) $v->have_newversion = 1; + $v->price = $v->price ? $v->price : '免费'; + } + $res['data'][] = $v; + }; + return json($res); + } + return json(['code' => -1, 'msg' => '未获取到服务器信息']); + } + /** * 插件动态列表 * @param $data * @return Json */ - public function getList($data) + public function getList() { + $data = Request::param(); + if(!isset($data['type'])) $data['type'] = 'onlineAddons'; + if(!isset($data['selector'])) $data['selector'] = 'all'; $res = []; //本地插件列表 $addonsList = Files::getDirName('../addons/'); diff --git a/app/admin/controller/addon/Template.php b/app/admin/controller/addon/Template.php index 2481cec..226e999 100644 --- a/app/admin/controller/addon/Template.php +++ b/app/admin/controller/addon/Template.php @@ -1,4 +1,13 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ + namespace app\admin\controller\addon; use app\common\controller\AdminController; @@ -9,7 +18,6 @@ class Template extends AdminController public function index() { - // return View::fetch(); } } \ No newline at end of file diff --git a/app/admin/controller/content/Cate.php b/app/admin/controller/content/Cate.php index 3c97548..8d4bbe7 100644 --- a/app/admin/controller/content/Cate.php +++ b/app/admin/controller/content/Cate.php @@ -1,16 +1,26 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ namespace app\admin\controller\content; use app\common\controller\AdminController; -use app\common\model\Cate as CateModel; -use app\common\model\Article; use think\facade\View; use think\facade\Request; use think\facade\Db; use think\facade\Cache; use taoler\com\Files; use app\common\lib\Msgres; +use app\common\model\Article; +use app\common\model\Cate as CateModel; + + class Cate extends AdminController { diff --git a/app/admin/controller/content/Comment.php b/app/admin/controller/content/Comment.php index ac5d949..d0cabf7 100644 --- a/app/admin/controller/content/Comment.php +++ b/app/admin/controller/content/Comment.php @@ -1,23 +1,29 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ namespace app\admin\controller\content; use app\common\controller\AdminController; -use app\common\model\Cate; -use app\common\model\Comment as CommentModel; -use app\common\model\Article; use think\facade\View; use think\facade\Request; use think\facade\Db; -use think\facade\Cache; -use taoler\com\Files; -use app\common\lib\Msgres; -use think\response\Json; +use app\common\model\Comment as CommentModel; + + class Comment extends AdminController { - - + /** + * 浏览 + * @return string + */ public function index() { return View::fetch(); @@ -68,7 +74,16 @@ class Comment extends AdminController foreach($replys as $k => $v){ $url = $this->getRouteUrl($v['cid'],$v['ename'], $v['appname']); //$res['data'][] = ['id'=>$v['id'],'replyer'=>$v->user->name,'cardid'=>$v->article->title,'avatar'=>$v->user->user_img,'content'=>$v['content'],'replytime'=>$v['create_time']]; - $res['data'][] = ['id'=>$v['aid'],'replyer'=>$v['name'],'title'=>htmlspecialchars($v['title']),'avatar'=>$v['user_img'],'content'=>htmlspecialchars($v['content']),'replytime'=>date("Y-m-d",$v['create_time']),'check'=>$v['astatus'],'url'=>$url]; + $res['data'][] = [ + 'id'=>$v['aid'], + 'replyer'=>$v['name'], + 'title'=>htmlspecialchars($v['title']), + 'avatar'=>$v['user_img'], + 'content'=>htmlspecialchars($v['content']), + 'replytime'=>date("Y-m-d",$v['create_time']), + 'check'=>$v['astatus'], + 'url'=>$url + ]; } } else { $res = ['code'=>-1,'msg'=>'没有查询结果!']; diff --git a/app/admin/controller/content/Forum.php b/app/admin/controller/content/Forum.php index dca752b..813779e 100644 --- a/app/admin/controller/content/Forum.php +++ b/app/admin/controller/content/Forum.php @@ -1,10 +1,16 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ namespace app\admin\controller\content; use app\common\controller\AdminController; -use app\common\model\Cate; -use app\common\model\Comment; use app\common\model\Article; use think\facade\View; use think\facade\Request; @@ -14,6 +20,7 @@ use taoler\com\Files; use app\common\lib\Msgres; use think\response\Json; + class Forum extends AdminController { /** @@ -86,7 +93,19 @@ class Forum extends AdminController $res['count'] = $count; foreach($forumList as $k=>$v){ $url = $this->getRouteUrl($v['aid'],$v['ename'],$v['appname']); - $res['data'][]= ['id'=>$v['aid'],'poster'=>$v['name'],'avatar'=>$v['user_img'],'title'=>htmlspecialchars($v['title']),'url'=>$url,'content'=>htmlspecialchars($v['content']),'posttime'=>date("Y-m-d",$v['update_time']),'top'=>$v['is_top'],'hot'=>$v['is_hot'],'reply'=>$v['is_reply'],'check'=>$v['status']]; + $res['data'][]= [ + 'id'=>$v['aid'], + 'poster'=>$v['name'], + 'avatar'=>$v['user_img'], + 'title'=>htmlspecialchars($v['title']), + 'url' => $url, + 'content' => strip_tags($v['content']), + 'posttime'=>date("Y-m-d",$v['update_time']), + 'top'=>$v['is_top'], + 'hot'=>$v['is_hot'], + 'reply'=>$v['is_reply'], + 'check'=>$v['status'] + ]; } } else { $res = ['code'=>-1,'msg'=>'没有查询结果!']; diff --git a/app/admin/controller/system/Admin.php b/app/admin/controller/system/Admin.php index 707e06a..95edcde 100644 --- a/app/admin/controller/system/Admin.php +++ b/app/admin/controller/system/Admin.php @@ -165,7 +165,6 @@ class Admin extends AdminController if(Request::isAjax()){ $user = $this->model->select($ids); $result = $user->delete(); - if($result){ return json(['code'=>0,'msg'=>'删除成功']); }else{ diff --git a/app/admin/controller/system/AuthGroup.php b/app/admin/controller/system/AuthGroup.php index c876663..e16dd8e 100644 --- a/app/admin/controller/system/AuthGroup.php +++ b/app/admin/controller/system/AuthGroup.php @@ -1,8 +1,16 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ + namespace app\admin\controller\system; use app\common\controller\AdminController; -use app\admin\model\Admin as adminModel; use think\facade\View; use think\facade\Request; use think\facade\Db; @@ -10,9 +18,11 @@ use think\exception\ValidateException; use app\admin\model\AuthGroup as AuthGroupModel; use app\admin\model\AuthGroupAccess; use app\admin\model\AuthRule as AuthRuleModel; +use app\admin\model\Admin as adminModel; use LDAP\Result; use think\Response; + class AuthGroup extends AdminController { /** diff --git a/app/admin/controller/system/AuthRule.php b/app/admin/controller/system/AuthRule.php index 900f04f..1f52639 100644 --- a/app/admin/controller/system/AuthRule.php +++ b/app/admin/controller/system/AuthRule.php @@ -1,4 +1,13 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ + namespace app\admin\controller\system; use app\common\controller\AdminController; diff --git a/app/admin/controller/system/Menu.php b/app/admin/controller/system/Menu.php index 68c2f4f..8c78b3d 100644 --- a/app/admin/controller/system/Menu.php +++ b/app/admin/controller/system/Menu.php @@ -1,4 +1,13 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ + namespace app\admin\controller\system; use app\common\controller\AdminController; @@ -21,7 +30,7 @@ class Menu extends AdminController $auth = new Auth(); $menu = []; $rule = Session::has('ruleTable') ? Session::get('ruleTable') : 'auth_rule'; - $auth_rule_list = Db::name($rule)->field('id,pid,title,icon,name,sort,ismenu')->where(['status'=> 1, 'ismenu'=>1, 'delete_time'=> 0])->select(); + $auth_rule_list = Db::name($rule)->field('id,pid,title,icon,name,sort,ismenu')->where(['status'=> 1, 'delete_time'=> 0])->select(); foreach ($auth_rule_list as $v) { if ($auth->check($v['name'], $this->aid) || $this->aid == 1) { $menu[] = [ @@ -30,12 +39,14 @@ class Menu extends AdminController 'icon' => 'layui-icon ' . $v['icon'], 'href' => (string) url($v['name']), 'pid' => $v['pid'], - 'sort' => $v['sort'] + 'sort' => $v['sort'], + 'ismenu' => $v['ismenu'] ]; } } $nav = $this->getTrees($menu); + // 初始化控制台 $nav[] = [ 'id' => 500, @@ -106,7 +117,7 @@ class Menu extends AdminController // //$v['children'][$m]['type'] = 1; // //$v['children'][$m]['openType'] = '_iframe'; // } - $v['type'] = $v['pid'] == 0 ? 0 : $v['ismenu']; + $v['type'] = $v['ismenu']; $v['children'] = $child; } else { // 没有子菜单type=1 diff --git a/app/admin/controller/system/Set.php b/app/admin/controller/system/Set.php index c88c49f..a91f78e 100644 --- a/app/admin/controller/system/Set.php +++ b/app/admin/controller/system/Set.php @@ -4,10 +4,11 @@ * @Date: 2021-12-06 16:04:50 * @LastEditTime: 2022-07-24 11:06:14 * @LastEditors: TaoLer - * @Description: 搜索引擎SEO优化设置 + * @Description: 设置 * @FilePath: \TaoLer\app\admin\controller\Set.php * Copyright (c) 2020~2022 http://www.aieok.com All rights reserved. */ + namespace app\admin\controller\system; use app\common\controller\AdminController; diff --git a/app/admin/controller/system/Upgrade.php b/app/admin/controller/system/Upgrade.php index 1332561..2575c17 100644 --- a/app/admin/controller/system/Upgrade.php +++ b/app/admin/controller/system/Upgrade.php @@ -1,5 +1,11 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. * 升级包规定的目录结构 * xxx_版本号.zip(如:xxx_1.0.0.zip) * | @@ -27,6 +33,7 @@ use app\common\lib\SqlFile; use app\common\lib\Zip; use taoser\SetArr; + class Upgrade extends AdminController { protected $root_dir = "../"; //站点代码的根目录 diff --git a/app/admin/controller/user/User.php b/app/admin/controller/user/User.php index 9be48ab..1ca202c 100644 --- a/app/admin/controller/user/User.php +++ b/app/admin/controller/user/User.php @@ -1,15 +1,23 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ namespace app\admin\controller\user; use app\common\controller\AdminController; -use app\admin\validate\Admin; use think\facade\View; use think\facade\Request; use think\facade\Db; use app\common\model\User as UserModel; use app\common\lib\Uploads; + class User extends AdminController { @@ -29,7 +37,10 @@ class User extends AdminController if(Request::isAjax()){ $datas = Request::only(['id','name','email','sex','status']); $map = array_filter($datas,[$this,'filtrArr']); - $user = Db::name('user')->where(['delete_time'=>0])->where($map)->order('id desc')->paginate(30); + $user = Db::name('user')->where(['delete_time'=>0])->where($map)->order('id desc')->paginate([ + 'list_rows' => input('limit'), + 'page' => input('page') + ]); $count = $user->total(); $res = []; if($count){ diff --git a/app/admin/controller/user/Vip.php b/app/admin/controller/user/Vip.php index 55cc67a..c45d2ee 100644 --- a/app/admin/controller/user/Vip.php +++ b/app/admin/controller/user/Vip.php @@ -1,4 +1,13 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ + namespace app\admin\controller\user; use app\common\controller\AdminController; @@ -15,7 +24,7 @@ class Vip extends AdminController return View::fetch(); } - //显示VIP规则 + // VIP列表 public function list() { $keys = UserViprule::select(); diff --git a/app/admin/model/Admin.php b/app/admin/model/Admin.php index 50b17b5..8cdeee4 100644 --- a/app/admin/model/Admin.php +++ b/app/admin/model/Admin.php @@ -1,4 +1,12 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ namespace app\admin\model; diff --git a/app/admin/model/AuthRule.php b/app/admin/model/AuthRule.php index 9b299c4..6e04fc8 100644 --- a/app/admin/model/AuthRule.php +++ b/app/admin/model/AuthRule.php @@ -1,4 +1,12 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ namespace app\admin\model; diff --git a/app/admin/model/System.php b/app/admin/model/System.php index cb45d18..d6646c7 100644 --- a/app/admin/model/System.php +++ b/app/admin/model/System.php @@ -1,11 +1,18 @@ + * @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved. + */ namespace app\admin\model; use think\Model; use think\facade\Cache; - class System extends Model { diff --git a/app/admin/view/addon/addons/config.html b/app/admin/view/addon/addons/config.html index 16a9ee9..ace9911 100644 --- a/app/admin/view/addon/addons/config.html +++ b/app/admin/view/addon/addons/config.html @@ -1,5 +1,11 @@ -{extend name="public/base" /} -{block name="body"} + + +
+ +订单标题:{$orderData.subject}
-订单编号:{$orderData.out_trade_no}
-订单价格:¥{$orderData.total_amount} 元
-订单标题:{$orderData.subject}
+订单编号:{$orderData.out_trade_no}
+订单价格:¥{$orderData.total_amount} 元
+请使用支付宝扫一扫
扫描二维码进行支付
请使用支付宝扫一扫
扫描二维码进行支付