优化后台
This commit is contained in:
parent
9e3a41899f
commit
e2096d3c22
@ -22,7 +22,6 @@ use app\admin\model\Article;
|
|||||||
use app\admin\model\Cunsult;
|
use app\admin\model\Cunsult;
|
||||||
use think\facade\Config;
|
use think\facade\Config;
|
||||||
use taoler\com\Api;
|
use taoler\com\Api;
|
||||||
use taoser\SetArr;
|
|
||||||
use app\common\lib\facade\HttpHelper;
|
use app\common\lib\facade\HttpHelper;
|
||||||
|
|
||||||
class Index extends AdminController
|
class Index extends AdminController
|
||||||
@ -123,21 +122,22 @@ class Index extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
//版本检测
|
//版本检测
|
||||||
public function getVersion()
|
// public function getVersion()
|
||||||
{
|
// {
|
||||||
$verCheck = Api::urlPost($this->sys['upcheck_url'],['pn'=>$this->pn,'ver'=>$this->sys_version]);
|
// $verCheck = Api::urlPost($this->sys['upcheck_url'],['pn'=>$this->pn,'ver'=>$this->sys_version]);
|
||||||
if($verCheck->code !== -1){
|
// if($verCheck->code !== -1){
|
||||||
return $verCheck->code ? "<span style='color:red'>有{$verCheck->up_num}个版本需更新,当前可更新至{$verCheck->version}</span>" : $verCheck->msg;
|
// return $verCheck->code ? "<span style='color:red'>有{$verCheck->up_num}个版本需更新,当前可更新至{$verCheck->version}</span>" : $verCheck->msg;
|
||||||
} else {
|
// } else {
|
||||||
return lang('No new messages');
|
// return lang('No new messages');
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
public function checkVersion()
|
public function checkVersion()
|
||||||
{
|
{
|
||||||
$verCheck = Api::urlPost($this->sys['upcheck_url'],['pn'=>$this->pn,'ver'=>$this->sys_version]);
|
$data = ['pn'=>$this->pn,'ver'=>$this->sys_version];
|
||||||
if($verCheck->code !== -1){
|
$response = HttpHelper::withHost()->get('/v1/upload/check', $data)->toJson();
|
||||||
return $verCheck->code ? "<span style='color:red'>有{$verCheck->up_num}个版本需更新,当前可更新至{$verCheck->version}</span>" : $verCheck->msg;
|
if($response->code !== -1){
|
||||||
|
return $response->code ? "<span style='color:#b2aeae'>有{$response->up_num}个版本需更新,当前可更新至{$response->version}</span>" : $response->msg;
|
||||||
} else {
|
} else {
|
||||||
return lang('No new messages');
|
return lang('No new messages');
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/11
|
||||||
|
* @FilePath: app\admin\controller\login.php
|
||||||
|
* @Description: 管理后台登录页
|
||||||
|
* @LastEditTime: 2023-03-11 10:16:42
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\controller;
|
namespace app\admin\controller;
|
||||||
|
|
||||||
use think\facade\View;
|
use think\facade\View;
|
||||||
@ -8,7 +17,6 @@ use app\admin\validate\Admin;
|
|||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
use app\common\controller\AdminController;
|
use app\common\controller\AdminController;
|
||||||
|
|
||||||
|
|
||||||
class Login extends AdminController
|
class Login extends AdminController
|
||||||
{
|
{
|
||||||
// 登录
|
// 登录
|
||||||
@ -37,7 +45,7 @@ class Login extends AdminController
|
|||||||
public function reg()
|
public function reg()
|
||||||
{
|
{
|
||||||
if(Session::has('admin_id')){
|
if(Session::has('admin_id')){
|
||||||
return redirect('/admin/index/index');
|
return redirect('index/index');
|
||||||
}
|
}
|
||||||
|
|
||||||
return View::fetch('reg');
|
return View::fetch('reg');
|
||||||
@ -47,7 +55,7 @@ class Login extends AdminController
|
|||||||
public function forget()
|
public function forget()
|
||||||
{
|
{
|
||||||
if(Session::has('admin_id')){
|
if(Session::has('admin_id')){
|
||||||
return redirect('/admin/index/index');
|
return redirect('index/index');
|
||||||
}
|
}
|
||||||
|
|
||||||
return View::fetch('forget');
|
return View::fetch('forget');
|
||||||
|
@ -19,27 +19,89 @@ use app\common\lib\FileHelper;
|
|||||||
class Addons extends AdminController
|
class Addons extends AdminController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
* 浏览插件
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
if(Request::isAjax()) {
|
// if(Request::isAjax()) {
|
||||||
$data = Request::param();
|
// $data = Request::param();
|
||||||
if(!isset($data['type'])) $data['type'] = 'onlineAddons';
|
// if(!isset($data['type'])) $data['type'] = 'onlineAddons';
|
||||||
if(!isset($data['selector'])) $data['selector'] = 'all';
|
// if(!isset($data['selector'])) $data['selector'] = 'all';
|
||||||
return $this->getList($data);
|
// return $this->getList($data);
|
||||||
}
|
// }
|
||||||
return View::fetch();
|
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
|
* @param $data
|
||||||
* @return Json
|
* @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 = [];
|
$res = [];
|
||||||
//本地插件列表
|
//本地插件列表
|
||||||
$addonsList = Files::getDirName('../addons/');
|
$addonsList = Files::getDirName('../addons/');
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\controller\addon\Template.php
|
||||||
|
* @Description: Template
|
||||||
|
* @LastEditTime: 2023-03-14 16:52:56
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\controller\addon;
|
namespace app\admin\controller\addon;
|
||||||
|
|
||||||
use app\common\controller\AdminController;
|
use app\common\controller\AdminController;
|
||||||
@ -9,7 +18,6 @@ class Template extends AdminController
|
|||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
//
|
|
||||||
return View::fetch();
|
return View::fetch();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,16 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\controller\content\Cate.php
|
||||||
|
* @Description: Cate
|
||||||
|
* @LastEditTime: 2023-03-14 15:40:53
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\controller\content;
|
namespace app\admin\controller\content;
|
||||||
|
|
||||||
use app\common\controller\AdminController;
|
use app\common\controller\AdminController;
|
||||||
use app\common\model\Cate as CateModel;
|
|
||||||
use app\common\model\Article;
|
|
||||||
use think\facade\View;
|
use think\facade\View;
|
||||||
use think\facade\Request;
|
use think\facade\Request;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use think\facade\Cache;
|
use think\facade\Cache;
|
||||||
use taoler\com\Files;
|
use taoler\com\Files;
|
||||||
use app\common\lib\Msgres;
|
use app\common\lib\Msgres;
|
||||||
|
use app\common\model\Article;
|
||||||
|
use app\common\model\Cate as CateModel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Cate extends AdminController
|
class Cate extends AdminController
|
||||||
{
|
{
|
||||||
|
@ -1,23 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\controller\content\Comment.php
|
||||||
|
* @Description: Comment
|
||||||
|
* @LastEditTime: 2023-03-14 15:38:55
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\controller\content;
|
namespace app\admin\controller\content;
|
||||||
|
|
||||||
use app\common\controller\AdminController;
|
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\View;
|
||||||
use think\facade\Request;
|
use think\facade\Request;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use think\facade\Cache;
|
use app\common\model\Comment as CommentModel;
|
||||||
use taoler\com\Files;
|
|
||||||
use app\common\lib\Msgres;
|
|
||||||
use think\response\Json;
|
|
||||||
|
|
||||||
class Comment extends AdminController
|
class Comment extends AdminController
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 浏览
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return View::fetch();
|
return View::fetch();
|
||||||
@ -68,7 +74,16 @@ class Comment extends AdminController
|
|||||||
foreach($replys as $k => $v){
|
foreach($replys as $k => $v){
|
||||||
$url = $this->getRouteUrl($v['cid'],$v['ename'], $v['appname']);
|
$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['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 {
|
} else {
|
||||||
$res = ['code'=>-1,'msg'=>'没有查询结果!'];
|
$res = ['code'=>-1,'msg'=>'没有查询结果!'];
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\controller\content\Forum.php
|
||||||
|
* @Description: Forum
|
||||||
|
* @LastEditTime: 2023-03-14 15:42:00
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\controller\content;
|
namespace app\admin\controller\content;
|
||||||
|
|
||||||
use app\common\controller\AdminController;
|
use app\common\controller\AdminController;
|
||||||
use app\common\model\Cate;
|
|
||||||
use app\common\model\Comment;
|
|
||||||
use app\common\model\Article;
|
use app\common\model\Article;
|
||||||
use think\facade\View;
|
use think\facade\View;
|
||||||
use think\facade\Request;
|
use think\facade\Request;
|
||||||
@ -14,6 +20,7 @@ use taoler\com\Files;
|
|||||||
use app\common\lib\Msgres;
|
use app\common\lib\Msgres;
|
||||||
use think\response\Json;
|
use think\response\Json;
|
||||||
|
|
||||||
|
|
||||||
class Forum extends AdminController
|
class Forum extends AdminController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -86,7 +93,19 @@ class Forum extends AdminController
|
|||||||
$res['count'] = $count;
|
$res['count'] = $count;
|
||||||
foreach($forumList as $k=>$v){
|
foreach($forumList as $k=>$v){
|
||||||
$url = $this->getRouteUrl($v['aid'],$v['ename'],$v['appname']);
|
$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 {
|
} else {
|
||||||
$res = ['code'=>-1,'msg'=>'没有查询结果!'];
|
$res = ['code'=>-1,'msg'=>'没有查询结果!'];
|
||||||
|
@ -165,7 +165,6 @@ class Admin extends AdminController
|
|||||||
if(Request::isAjax()){
|
if(Request::isAjax()){
|
||||||
$user = $this->model->select($ids);
|
$user = $this->model->select($ids);
|
||||||
$result = $user->delete();
|
$result = $user->delete();
|
||||||
|
|
||||||
if($result){
|
if($result){
|
||||||
return json(['code'=>0,'msg'=>'删除成功']);
|
return json(['code'=>0,'msg'=>'删除成功']);
|
||||||
}else{
|
}else{
|
||||||
|
@ -1,8 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\controller\system\AuthGroup.php
|
||||||
|
* @Description: AuthGroup
|
||||||
|
* @LastEditTime: 2023-03-14 16:43:59
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\controller\system;
|
namespace app\admin\controller\system;
|
||||||
|
|
||||||
use app\common\controller\AdminController;
|
use app\common\controller\AdminController;
|
||||||
use app\admin\model\Admin as adminModel;
|
|
||||||
use think\facade\View;
|
use think\facade\View;
|
||||||
use think\facade\Request;
|
use think\facade\Request;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
@ -10,9 +18,11 @@ use think\exception\ValidateException;
|
|||||||
use app\admin\model\AuthGroup as AuthGroupModel;
|
use app\admin\model\AuthGroup as AuthGroupModel;
|
||||||
use app\admin\model\AuthGroupAccess;
|
use app\admin\model\AuthGroupAccess;
|
||||||
use app\admin\model\AuthRule as AuthRuleModel;
|
use app\admin\model\AuthRule as AuthRuleModel;
|
||||||
|
use app\admin\model\Admin as adminModel;
|
||||||
use LDAP\Result;
|
use LDAP\Result;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
|
|
||||||
class AuthGroup extends AdminController
|
class AuthGroup extends AdminController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\controller\system\AuthRule.php
|
||||||
|
* @Description: AuthRule
|
||||||
|
* @LastEditTime: 2023-03-14 16:45:34
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\controller\system;
|
namespace app\admin\controller\system;
|
||||||
|
|
||||||
use app\common\controller\AdminController;
|
use app\common\controller\AdminController;
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\controller\system\Menu.php
|
||||||
|
* @Description: Menu
|
||||||
|
* @LastEditTime: 2023-03-14 16:46:37
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\controller\system;
|
namespace app\admin\controller\system;
|
||||||
|
|
||||||
use app\common\controller\AdminController;
|
use app\common\controller\AdminController;
|
||||||
@ -21,7 +30,7 @@ class Menu extends AdminController
|
|||||||
$auth = new Auth();
|
$auth = new Auth();
|
||||||
$menu = [];
|
$menu = [];
|
||||||
$rule = Session::has('ruleTable') ? Session::get('ruleTable') : 'auth_rule';
|
$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) {
|
foreach ($auth_rule_list as $v) {
|
||||||
if ($auth->check($v['name'], $this->aid) || $this->aid == 1) {
|
if ($auth->check($v['name'], $this->aid) || $this->aid == 1) {
|
||||||
$menu[] = [
|
$menu[] = [
|
||||||
@ -30,12 +39,14 @@ class Menu extends AdminController
|
|||||||
'icon' => 'layui-icon ' . $v['icon'],
|
'icon' => 'layui-icon ' . $v['icon'],
|
||||||
'href' => (string) url($v['name']),
|
'href' => (string) url($v['name']),
|
||||||
'pid' => $v['pid'],
|
'pid' => $v['pid'],
|
||||||
'sort' => $v['sort']
|
'sort' => $v['sort'],
|
||||||
|
'ismenu' => $v['ismenu']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$nav = $this->getTrees($menu);
|
$nav = $this->getTrees($menu);
|
||||||
|
|
||||||
// 初始化控制台
|
// 初始化控制台
|
||||||
$nav[] = [
|
$nav[] = [
|
||||||
'id' => 500,
|
'id' => 500,
|
||||||
@ -106,7 +117,7 @@ class Menu extends AdminController
|
|||||||
// //$v['children'][$m]['type'] = 1;
|
// //$v['children'][$m]['type'] = 1;
|
||||||
// //$v['children'][$m]['openType'] = '_iframe';
|
// //$v['children'][$m]['openType'] = '_iframe';
|
||||||
// }
|
// }
|
||||||
$v['type'] = $v['pid'] == 0 ? 0 : $v['ismenu'];
|
$v['type'] = $v['ismenu'];
|
||||||
$v['children'] = $child;
|
$v['children'] = $child;
|
||||||
} else {
|
} else {
|
||||||
// 没有子菜单type=1
|
// 没有子菜单type=1
|
||||||
|
@ -4,10 +4,11 @@
|
|||||||
* @Date: 2021-12-06 16:04:50
|
* @Date: 2021-12-06 16:04:50
|
||||||
* @LastEditTime: 2022-07-24 11:06:14
|
* @LastEditTime: 2022-07-24 11:06:14
|
||||||
* @LastEditors: TaoLer
|
* @LastEditors: TaoLer
|
||||||
* @Description: 搜索引擎SEO优化设置
|
* @Description: 设置
|
||||||
* @FilePath: \TaoLer\app\admin\controller\Set.php
|
* @FilePath: \TaoLer\app\admin\controller\Set.php
|
||||||
* Copyright (c) 2020~2022 http://www.aieok.com All rights reserved.
|
* Copyright (c) 2020~2022 http://www.aieok.com All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace app\admin\controller\system;
|
namespace app\admin\controller\system;
|
||||||
|
|
||||||
use app\common\controller\AdminController;
|
use app\common\controller\AdminController;
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\controller\system\Upgrade.php
|
||||||
|
* @Description: Upgrade
|
||||||
|
* @LastEditTime: 2023-03-14 16:47:27
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
* 升级包规定的目录结构
|
* 升级包规定的目录结构
|
||||||
* xxx_版本号.zip(如:xxx_1.0.0.zip)
|
* xxx_版本号.zip(如:xxx_1.0.0.zip)
|
||||||
* |
|
* |
|
||||||
@ -27,6 +33,7 @@ use app\common\lib\SqlFile;
|
|||||||
use app\common\lib\Zip;
|
use app\common\lib\Zip;
|
||||||
use taoser\SetArr;
|
use taoser\SetArr;
|
||||||
|
|
||||||
|
|
||||||
class Upgrade extends AdminController
|
class Upgrade extends AdminController
|
||||||
{
|
{
|
||||||
protected $root_dir = "../"; //站点代码的根目录
|
protected $root_dir = "../"; //站点代码的根目录
|
||||||
|
@ -1,15 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/11
|
||||||
|
* @FilePath: app\admin\controller\user\User.php
|
||||||
|
* @Description: User用户管理
|
||||||
|
* @LastEditTime: 2023-03-11 10:20:47
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\controller\user;
|
namespace app\admin\controller\user;
|
||||||
|
|
||||||
use app\common\controller\AdminController;
|
use app\common\controller\AdminController;
|
||||||
use app\admin\validate\Admin;
|
|
||||||
use think\facade\View;
|
use think\facade\View;
|
||||||
use think\facade\Request;
|
use think\facade\Request;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use app\common\model\User as UserModel;
|
use app\common\model\User as UserModel;
|
||||||
use app\common\lib\Uploads;
|
use app\common\lib\Uploads;
|
||||||
|
|
||||||
|
|
||||||
class User extends AdminController
|
class User extends AdminController
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -29,7 +37,10 @@ class User extends AdminController
|
|||||||
if(Request::isAjax()){
|
if(Request::isAjax()){
|
||||||
$datas = Request::only(['id','name','email','sex','status']);
|
$datas = Request::only(['id','name','email','sex','status']);
|
||||||
$map = array_filter($datas,[$this,'filtrArr']);
|
$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();
|
$count = $user->total();
|
||||||
$res = [];
|
$res = [];
|
||||||
if($count){
|
if($count){
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\controller\user\Vip.php
|
||||||
|
* @Description: Vip
|
||||||
|
* @LastEditTime: 2023-03-14 16:48:31
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\controller\user;
|
namespace app\admin\controller\user;
|
||||||
|
|
||||||
use app\common\controller\AdminController;
|
use app\common\controller\AdminController;
|
||||||
@ -15,7 +24,7 @@ class Vip extends AdminController
|
|||||||
return View::fetch();
|
return View::fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
//显示VIP规则
|
// VIP列表
|
||||||
public function list()
|
public function list()
|
||||||
{
|
{
|
||||||
$keys = UserViprule::select();
|
$keys = UserViprule::select();
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\model\Admin.php
|
||||||
|
* @Description: Admin
|
||||||
|
* @LastEditTime: 2023-03-14 16:50:41
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\model;
|
namespace app\admin\model;
|
||||||
|
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\model\AuthRule.php
|
||||||
|
* @Description: AuthRule
|
||||||
|
* @LastEditTime: 2023-03-14 16:51:30
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\model;
|
namespace app\admin\model;
|
||||||
|
|
||||||
|
@ -1,11 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @Program: TaoLer 2023/3/14
|
||||||
|
* @FilePath: app\admin\model\System.php
|
||||||
|
* @Description: System
|
||||||
|
* @LastEditTime: 2023-03-14 16:52:00
|
||||||
|
* @Author: Taoker <317927823@qq.com>
|
||||||
|
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace app\admin\model;
|
namespace app\admin\model;
|
||||||
|
|
||||||
use think\Model;
|
use think\Model;
|
||||||
use think\facade\Cache;
|
use think\facade\Cache;
|
||||||
|
|
||||||
|
|
||||||
class System extends Model
|
class System extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
{extend name="public/base" /}
|
<!DOCTYPE html>
|
||||||
{block name="body"}
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>新增管理员</title>
|
||||||
|
<link rel="stylesheet" href="/static/component/pear/css/pear.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
<div class="layui-form" lay-filter="layuiadmin-form-addons" id="layuiadmin-form-addons" style="padding: 20px 30px 0 0;">
|
<div class="layui-form" lay-filter="layuiadmin-form-addons" id="layuiadmin-form-addons" style="padding: 20px 30px 0 0;">
|
||||||
{foreach name="formData" item="vo" key="k"}
|
{foreach name="formData" item="vo" key="k"}
|
||||||
@ -54,32 +60,30 @@
|
|||||||
<input type="button" lay-submit lay-filter="LAY-addons-config-submit" id="LAY-addons-config-submit" value="确认">
|
<input type="button" lay-submit lay-filter="LAY-addons-config-submit" id="LAY-addons-config-submit" value="确认">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/block}
|
<script src="/static/component/layui/layui.js"></script>
|
||||||
{block name="js"}
|
<script src="/static/component/pear/pear.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
layui.config({
|
layui.use(['upload','toast'], function(){
|
||||||
base: '/static/admin/' //静态资源所在路径
|
|
||||||
}).extend({
|
|
||||||
index: 'lib/index' //主入口模块
|
|
||||||
}).use(['index', 'upload','notify'], function(){
|
|
||||||
var $ = layui.$,upload = layui.upload,form = layui.form,notify=layui.notify;
|
var $ = layui.$,upload = layui.upload,form = layui.form,notify=layui.notify;
|
||||||
//上传头像
|
//上传头像
|
||||||
upload.render({
|
upload.render({
|
||||||
elem: '.upload-select'
|
elem: '.upload-select'
|
||||||
,url: "{:url('Addons/uploads')}"
|
,url: "{:url('addon.addons/uploads')}"
|
||||||
,data: {type:'image'}
|
,data: {type:'image'}
|
||||||
,accept: 'images'
|
,accept: 'images'
|
||||||
,method: 'get'
|
,method: 'get'
|
||||||
,acceptMime: 'image/*'
|
,acceptMime: 'image/*'
|
||||||
,done: function(res){
|
,done: function(res){
|
||||||
$(this.item).prevAll("input").val(res.url);
|
$(this.item).prevAll("input").val(res.url);
|
||||||
if(res.status == 0){
|
if(res.status === 0){
|
||||||
notify.success(res.msg);
|
toast.success({title:"成功",message:res.msg,position: 'topRight'});
|
||||||
} else {
|
} else {
|
||||||
notify.error(res.msg);
|
toast.error({title:"失败",message:res.msg,position: 'topRight'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
</body>
|
||||||
|
</html>
|
@ -2,36 +2,34 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>用户管理</title>
|
<title>插件管理</title>
|
||||||
<link rel="stylesheet" href="/static/component/pear/css/pear.css" />
|
<link rel="stylesheet" href="/static/component/pear/css/pear.css" />
|
||||||
</head>
|
</head>
|
||||||
<body class="pear-container">
|
<body class="pear-container">
|
||||||
<div class="layui-fluid">
|
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
|
|
||||||
<table id="addons-list" lay-filter="addons-list"></table>
|
<table id="addons-list" lay-filter="addons-list"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script type="text/html" id="toolbar">
|
<script type="text/html" id="toolbar">
|
||||||
<div class="layui-btn-group" style="padding-bottom: 10px;">
|
<div class="layui-btn-group">
|
||||||
<a type="button" class="layui-btn layui-btn-sm" lay-event="allAddons" data-url="{:url('addon.addons/index',['type'=>'onlineAddons','selector'=>'all'])}">全部</a>
|
<button class="layui-btn layui-btn-sm" lay-event="allAddons">全部</button>
|
||||||
<a type="button" class="layui-btn layui-btn-sm" lay-event="freeAddons" data-url="{:url('addon.addons/index',['type'=>'onlineAddons','selector'=>'free'])}">免费</a>
|
<button class="layui-btn layui-btn-sm" lay-event="freeAddons">免费</button>
|
||||||
<a type="button" class="layui-btn layui-btn-sm" lay-event="payAddons" data-url="{:url('addon.addons/index',['type'=>'onlineAddons','selector'=>'pay'])}">付费</a>
|
<button class="layui-btn layui-btn-sm" lay-event="payAddons">付费</button>
|
||||||
<a type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="installed" data-url="{:url('addon.addons/index',['type'=>'installed','selector'=>''])}">已安装</a>
|
<button class="layui-btn layui-btn-normal layui-btn-sm" lay-event="installed">已安装</button>
|
||||||
</div>
|
<button class="layui-btn layui-btn-danger layui-btn-sm" lay-event="add">离线安装</button>
|
||||||
<div class="layui-btn-group" style="padding-bottom: 10px;">
|
|
||||||
<button class="layui-btn layui-btn-danger layui-btn-sm layuiadmin-btn-admin" data-type="add">离线安装</button>
|
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="addons-tool">
|
<script type="text/html" id="addons-bar">
|
||||||
{{# if(d.have_newversion === 1){ }}
|
{{# if(d.have_newversion === 1){ }}
|
||||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="install" data-url="{:url('addon.addons/upgrade')}" data-userlogin="{:url('addon.addons/userLogin')}" data-ispay="{:url('addon.addons/isPay')}"><i class="layui-icon layui-icon-edit"></i>升级</a>
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="install" data-url="{:url('addon.addons/upgrade')}" data-userlogin="{:url('addon.addons/userLogin')}" data-ispay="{:url('addon.addons/isPay')}"><i class="layui-icon layui-icon-edit"></i>升级</a>
|
||||||
{{# } else { }}
|
{{# } else { }}
|
||||||
{{# if(d.isInstall === 1) { }}
|
{{# if(d.isInstall === 1) { }}
|
||||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="config" data-url="{:url('addon.addons/config')}"><i class="layui-icon layui-icon-set"></i>设置</a>
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="config" data-url="{:url('addon.addons/config')}"><i class="layui-icon layui-icon-set"></i>设置</a>
|
||||||
{{# } else { }}
|
{{# } else { }}
|
||||||
<a class="layui-btn layui-btn-xs" lay-event="install" data-url="{:url('Addons/install')}" data-userlogin="{:url('addon.addons/userLogin')}" data-ispay="{:url('addon.addons/isPay')}"><i class="layui-icon layui-icon-edit"></i>安装</a>
|
<a class="layui-btn layui-btn-xs" lay-event="install" data-url="{:url('addon.addons/install')}" data-userlogin="{:url('addon.addons/userLogin')}" data-ispay="{:url('addon.addons/isPay')}"><i class="layui-icon layui-icon-edit"></i>安装</a>
|
||||||
<select id="vers{{d.name}}" name="sss" class="layui-border" lay-ignore lay-filter="versSelect">
|
<select id="vers{{d.name}}" name="sss" class="layui-border" lay-ignore lay-filter="versSelect">
|
||||||
{{# d.vers.forEach(function(item, index){ }}
|
{{# d.vers.forEach(function(item, index){ }}
|
||||||
<option value="{{ item }}">{{ item }}</option>
|
<option value="{{ item }}">{{ item }}</option>
|
||||||
@ -40,38 +38,131 @@
|
|||||||
{{# } }}
|
{{# } }}
|
||||||
{{# } }}
|
{{# } }}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="buttonStatus">
|
<script type="text/html" id="buttonStatus">
|
||||||
<input type="checkbox" name="{{d.name}}" lay-skin="switch" lay-filter="addonsStatus" lay-text="启动|禁用" {{# if(d.status == 1){ }} checked {{# } }} data-url="{:url('addon.addons/check')}">
|
<input type="checkbox" name="{{d.name}}" lay-skin="switch" lay-filter="addonsStatus" lay-text="启动|禁用" {{# if(d.status == 1){ }} checked {{# } }} data-url="{:url('addon.addons/check')}">
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="addons-installed-tool">
|
<script type="text/html" id="addons-installed-tool">
|
||||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="config" data-url="{:url('addon.addons/config')}"><i class="layui-icon layui-icon-set"></i>设置</a>
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="config" data-url="{:url('addon.addons/config')}"><i class="layui-icon layui-icon-set"></i>设置</a>
|
||||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="uninstall" data-url="{:url('addon.addons/uninstall')}"><i class="layui-icon layui-icon-delete"></i>卸载</a>
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="uninstall" data-url="{:url('addon.addons/uninstall')}"><i class="layui-icon layui-icon-delete"></i>卸载</a>
|
||||||
</script>
|
</script>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{include file="public/user_login" /}
|
{include file="public/user_login" /}
|
||||||
<script src="/static/component/layui/layui.js"></script>
|
<script src="/static/component/layui/layui.js"></script>
|
||||||
<script src="/static/component/pear/pear.js"></script>
|
<script src="/static/component/pear/pear.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var addonList = "{:url('addon.Addons/index')}";
|
var addonList = "{:url('addon.addons/getList')}";
|
||||||
layui.use(['addons','table','form','upload',"notify",'toast'], function(){
|
|
||||||
|
|
||||||
|
layui.use(['addons','table','form','upload','toast'], function(){
|
||||||
var $ = layui.jquery
|
var $ = layui.jquery
|
||||||
,table = layui.table
|
,table = layui.table
|
||||||
,form = layui.form
|
,form = layui.form
|
||||||
,upload = layui.upload;
|
,upload = layui.upload;
|
||||||
var notify = layui.notify;
|
|
||||||
var toast = layui.toast;
|
var toast = layui.toast;
|
||||||
|
|
||||||
form.render('select'); // 渲染所在容器内的 select 元素
|
let LIST_URL = "{:url('addon.addons/list')}";
|
||||||
//监听版本选择
|
|
||||||
form.on('select(versSelect)', function(obj){
|
let cols = [[
|
||||||
layer.tips(this.value + ' ' + this.name + ':'+ obj.elem.checked, obj.othis);
|
{type: 'checkbox'},
|
||||||
|
{title: '序号', type: 'numbers'},
|
||||||
|
{field: 'title', title: '插件', width: 200},
|
||||||
|
{field: 'description', title: '简介', minWidth: 200},
|
||||||
|
{field: 'author', title: '作者', width: 100},
|
||||||
|
{field: 'price', title: '价格(元)', width: 85},
|
||||||
|
{field: 'downloads', title: '下载', width: 70},
|
||||||
|
{field: 'version', title: '版本', templet: '<div>{{d.version}} {{# if(d.have_newversion == 1){ }}<span class="layui-badge-dot"></span>{{# } }}</div>', width: 75},
|
||||||
|
{field: 'status', title: '在线', width: 70},
|
||||||
|
{title: '操作', width: 165, align: 'center', toolbar: '#addons-bar'}
|
||||||
|
]];
|
||||||
|
|
||||||
|
let col = [[
|
||||||
|
{type: 'numbers'},
|
||||||
|
{field: 'name', title: '插件', width: 120},
|
||||||
|
{field: 'title',title: '标题', width: 100},
|
||||||
|
{field: 'version', title: '版本'},
|
||||||
|
{field: 'author', title: '作者', width: 80},
|
||||||
|
{field: 'description', title: '简介', minWidth: 200},
|
||||||
|
{field: 'install', title: '安装', width: 100},
|
||||||
|
{field: 'ctime', title: '到期时间', width: 100},
|
||||||
|
{field: 'status', title: '状态', width: 95, templet: '#buttonStatus'},
|
||||||
|
{title: '操作', width: 160, 'align': 'center', toolbar: '#addons-installed-tool'}
|
||||||
|
]];
|
||||||
|
|
||||||
|
//渲染表格
|
||||||
|
var addonTable = table.render({
|
||||||
|
elem: "#addons-list",
|
||||||
|
toolbar: "#toolbar",
|
||||||
|
defaultToolbar: [],
|
||||||
|
url: LIST_URL,
|
||||||
|
cols: cols,
|
||||||
|
page: true,
|
||||||
|
limit: 10,
|
||||||
|
text: "对不起,加载出现异常!",
|
||||||
});
|
});
|
||||||
|
|
||||||
//事件
|
// table.on('tool(addons-list)',function(obj){
|
||||||
var active = {
|
// console.log(obj)
|
||||||
add: function(){
|
// if (obj.event === 'remove') {
|
||||||
|
// window.remove(obj);
|
||||||
|
// } else if (obj.event === 'edit') {
|
||||||
|
// window.edit(obj);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
|
||||||
|
table.on('toolbar(addons-list)', function(obj){
|
||||||
|
if(obj.event === 'installed'){
|
||||||
|
window.installed(obj.event);
|
||||||
|
} else if(obj.event === 'add'){
|
||||||
|
//window.add();
|
||||||
|
} else {
|
||||||
|
// all,free,pay
|
||||||
|
window.all(obj.event);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
window.all = function (type) {
|
||||||
|
$.post(LIST_URL,{type: type}, function (res){
|
||||||
|
if(res.code === 0) {
|
||||||
|
// 重新渲染
|
||||||
|
table.reload('addons-list',{
|
||||||
|
url: LIST_URL,
|
||||||
|
where: {
|
||||||
|
type : type
|
||||||
|
},
|
||||||
|
cols: cols,
|
||||||
|
page: {
|
||||||
|
curr: 1 //重新从第 1 页开始
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.installed = function (type) {
|
||||||
|
$.get(LIST_URL,{type: type}, function (res){
|
||||||
|
if(res.code === 0) {
|
||||||
|
// 重新渲染
|
||||||
|
table.reload('addons-list',{
|
||||||
|
url: LIST_URL,
|
||||||
|
where: {
|
||||||
|
type : type
|
||||||
|
},
|
||||||
|
cols: col,
|
||||||
|
page: {
|
||||||
|
curr: 1 //重新从第 1 页开始
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.add = function(){
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2
|
type: 2
|
||||||
,title: '添加插件'
|
,title: '添加插件'
|
||||||
@ -79,7 +170,15 @@
|
|||||||
,area: ['400px', '300px']
|
,area: ['400px', '300px']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
form.render('select'); // 渲染所在容器内的 select 元素
|
||||||
|
//监听版本选择
|
||||||
|
form.on('select(versSelect)', function(obj){
|
||||||
|
layer.tips(this.value + ' ' + this.name + ':'+ obj.elem.checked, obj.othis);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// 启动禁用
|
// 启动禁用
|
||||||
form.on('switch(addonsStatus)', function(data){
|
form.on('switch(addonsStatus)', function(data){
|
||||||
@ -97,10 +196,6 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.layui-btn.layuiadmin-btn-admin').on('click', function(){
|
|
||||||
var type = $(this).data('type');
|
|
||||||
active[type] ? active[type].call(this) : '';
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
{extend name="public/base" /}
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
{block name="body"}
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>支付</title>
|
||||||
|
<link rel="stylesheet" href="/static/component/pear/css/pear.css" />
|
||||||
|
</head>
|
||||||
<style>
|
<style>
|
||||||
.layui-container{background-color: #F9F9F9}
|
.layui-container{background-color: #F9F9F9}
|
||||||
.auth-type{margin: 10px 0px;}
|
.auth-type{margin: 10px 0px;}
|
||||||
@ -9,9 +13,8 @@
|
|||||||
.soft-info{margin: 10px;}
|
.soft-info{margin: 10px;}
|
||||||
.pay-tips{line-height:20px;text-align: center;margin-bottom: 20px;}
|
.pay-tips{line-height:20px;text-align: center;margin-bottom: 20px;}
|
||||||
</style>
|
</style>
|
||||||
|
<body>
|
||||||
<div class="layui-container">
|
<div class="layui-container">
|
||||||
|
|
||||||
<div class="layui-row">
|
<div class="layui-row">
|
||||||
<div class="auth-type">
|
<div class="auth-type">
|
||||||
授权
|
授权
|
||||||
@ -32,7 +35,7 @@
|
|||||||
<div class="soft-info">
|
<div class="soft-info">
|
||||||
<div>不支持退款</div>
|
<div>不支持退款</div>
|
||||||
<br />
|
<br />
|
||||||
<div>软件协议:本软件为原作者拥有版权权限,购买软件可以商用,禁止第三方出售行为。</div>
|
<div>软件协议:本软件为原作者拥有版权权限,购买软件可以商用,禁止出售第三方行为。</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-sm6">
|
<div class="layui-col-sm6">
|
||||||
@ -45,16 +48,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/block}
|
<script src="/static/component/layui/layui.js"></script>
|
||||||
{block name="js"}
|
<script src="/static/component/pear/pear.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
layui.use(['jquery'], function() {
|
||||||
var $ = layui.jquery;
|
var $ = layui.jquery;
|
||||||
var out_trade_no = "{$orderData.out_trade_no}";
|
var out_trade_no = "{$orderData.out_trade_no}";
|
||||||
|
let URL = 'https://www.aieok.com/pay/checkstatus.html?out_trade_no=' + out_trade_no;
|
||||||
var interval = setInterval(function () {
|
var interval = setInterval(function () {
|
||||||
var url = 'https://www.aieok.com/pay/checkstatus.html?out_trade_no=' + out_trade_no;
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "get",
|
type: "get",
|
||||||
url: url,
|
url: URL,
|
||||||
data: {out_trade_no: out_trade_no},
|
data: {out_trade_no: out_trade_no},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
@ -65,5 +69,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 2500);
|
}, 2500);
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
</body>
|
||||||
|
</html>
|
@ -262,7 +262,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.remove = function(obj) {
|
window.remove = function(obj) {
|
||||||
|
|
||||||
layer.confirm('确定要删除该用户', {
|
layer.confirm('确定要删除该用户', {
|
||||||
icon: 3,
|
icon: 3,
|
||||||
title: '提示'
|
title: '提示'
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{else /}
|
{else /}
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">升级Key</label>
|
<label class="layui-form-label">网站KEY</label>
|
||||||
<div class="layui-form-item layui-hide">
|
<div class="layui-form-item layui-hide">
|
||||||
<input type="text" name="key" value="{$ver_num.key}" class="layui-input">
|
<input type="text" name="key" value="{$ver_num.key}" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
|
@ -235,7 +235,8 @@
|
|||||||
title: '刷新',
|
title: '刷新',
|
||||||
layEvent: 'refresh',
|
layEvent: 'refresh',
|
||||||
icon: 'layui-icon-refresh',
|
icon: 'layui-icon-refresh',
|
||||||
}, 'filter', 'print', 'exports']
|
}, 'filter', 'print', 'exports'],
|
||||||
|
limit: 10
|
||||||
});
|
});
|
||||||
|
|
||||||
table.on('tool(user-table)', function(obj) {
|
table.on('tool(user-table)', function(obj) {
|
||||||
@ -303,7 +304,7 @@
|
|||||||
data:{"id":data.id,"auth":auth},
|
data:{"id":data.id,"auth":auth},
|
||||||
dataType:'json',
|
dataType:'json',
|
||||||
success:function(data){
|
success:function(data){
|
||||||
if(data.code == 0){
|
if(data.code === 0){
|
||||||
layer.msg(data.msg,{
|
layer.msg(data.msg,{
|
||||||
icon:6,
|
icon:6,
|
||||||
time:2000
|
time:2000
|
||||||
|
@ -1,78 +1,73 @@
|
|||||||
//网站app版本发布
|
//网站app版本发布
|
||||||
|
|
||||||
layui.define(["table", "form", "upload","notify",'toast'], function (exports) {
|
layui.define(["table", "form",'toast','common'], function (exports) {
|
||||||
var $ = layui.jquery,
|
var $ = layui.jquery, table = layui.table, form = layui.form;
|
||||||
table = layui.table,
|
let toast = layui.toast;
|
||||||
form = layui.form,
|
let layer = layui.layer;
|
||||||
upload = layui.upload;
|
let common = layui.common;
|
||||||
var notify = layui.notify;
|
|
||||||
var toast = layui.toast;
|
|
||||||
var layer = layui.layer;
|
|
||||||
|
|
||||||
// 渲染表格
|
// 渲染表格
|
||||||
table.render({
|
// table.render({
|
||||||
elem: "#addons-list",
|
// elem: "#addons-list",
|
||||||
toolbar: "#toolbar",
|
// toolbar: "#toolbar",
|
||||||
defaultToolbar: [],
|
// defaultToolbar: [],
|
||||||
url: addonList,
|
// url: addonList,
|
||||||
cols: [[
|
// cols: [[
|
||||||
{type: 'checkbox'},
|
// {type: 'checkbox'},
|
||||||
{title: '序号', type: 'numbers'},
|
// {title: '序号', type: 'numbers'},
|
||||||
{field: 'title', title: '插件', width: 200},
|
// {field: 'title', title: '插件', width: 200},
|
||||||
{field: 'description', title: '简介', minWidth: 200},
|
// {field: 'description', title: '简介', minWidth: 200},
|
||||||
{field: 'author', title: '作者', width: 100},
|
// {field: 'author', title: '作者', width: 100},
|
||||||
{field: 'price', title: '价格(元)', width: 85},
|
// {field: 'price', title: '价格(元)', width: 85},
|
||||||
{field: 'downloads', title: '下载', width: 70},
|
// {field: 'downloads', title: '下载', width: 70},
|
||||||
{field: 'version', title: '版本', templet: '<div>{{d.version}} {{# if(d.have_newversion == 1){ }}<span class="layui-badge-dot"></span>{{# } }}</div>', width: 75},
|
// {field: 'version', title: '版本', templet: '<div>{{d.version}} {{# if(d.have_newversion == 1){ }}<span class="layui-badge-dot"></span>{{# } }}</div>', width: 75},
|
||||||
{field: 'status', title: '在线', width: 70},
|
// {field: 'status', title: '在线', width: 70},
|
||||||
{title: '操作', width: 165, align: 'center', toolbar: '#addons-tool'}
|
// {title: '操作', width: 165, align: 'center', toolbar: '#addons-bar'}
|
||||||
]],
|
// ]],
|
||||||
page: true,
|
// page: true,
|
||||||
limit: 15,
|
// limit: 15,
|
||||||
height: "full-220",
|
// text: "对不起,加载出现异常!",
|
||||||
text: "对不起,加载出现异常!",
|
// });
|
||||||
});
|
//
|
||||||
|
// // 重载数据
|
||||||
// 重载数据
|
// var addonReload = function (type,selector) {
|
||||||
var addonReload = function (type,selector) {
|
// $.ajax({
|
||||||
$.ajax({
|
// type: "post",
|
||||||
type: "post",
|
// url: addonList,
|
||||||
url: addonList,
|
// data: { type: type, selector: selector },
|
||||||
data: { type: type, selector: selector },
|
// dataType: "json",
|
||||||
dataType: "json",
|
// success: function (res) {
|
||||||
success: function (res) {
|
// //渲染表格
|
||||||
//渲染表格
|
// table.reload('addons-list',{
|
||||||
table.reload('addons-list',{
|
// url: addonList,
|
||||||
url: addonList,
|
// where: {
|
||||||
where: {
|
// type: type, selector: selector
|
||||||
type: type, selector: selector
|
// },
|
||||||
},
|
// cols: [res["col"]],
|
||||||
cols: [res["col"]],
|
// });
|
||||||
});
|
// },
|
||||||
},
|
// });
|
||||||
});
|
// }
|
||||||
}
|
//
|
||||||
|
// //头工具栏事件
|
||||||
//头工具栏事件
|
// table.on("toolbar(addons-list)", function (obj) {
|
||||||
table.on("toolbar(addons-list)", function (obj) {
|
// var checkStatus = table.checkStatus(obj.config.id);
|
||||||
var checkStatus = table.checkStatus(obj.config.id);
|
//
|
||||||
var url = $(this).data(url);
|
// switch (obj.event) {
|
||||||
|
// case "installed":
|
||||||
switch (obj.event) {
|
// addonReload("installed","all");
|
||||||
case "installed":
|
// break;
|
||||||
addonReload("installed","all");
|
// case "allAddons":
|
||||||
break;
|
// addonReload("onlineAddons","all");
|
||||||
case "allAddons":
|
// break;
|
||||||
addonReload("onlineAddons","all");
|
// case "freeAddons":
|
||||||
break;
|
// addonReload("onlineAddons","free");
|
||||||
case "freeAddons":
|
// break;
|
||||||
addonReload("onlineAddons","free");
|
// case "payAddons":
|
||||||
break;
|
// addonReload("onlineAddons","pay");
|
||||||
case "payAddons":
|
// break;
|
||||||
addonReload("onlineAddons","pay");
|
// }
|
||||||
break;
|
// });
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var api = {
|
var api = {
|
||||||
userinfo: {
|
userinfo: {
|
||||||
@ -92,6 +87,7 @@ layui.define(["table", "form", "upload","notify",'toast'], function (exports) {
|
|||||||
|
|
||||||
//监听工具条
|
//监听工具条
|
||||||
table.on("tool(addons-list)", function (obj) {
|
table.on("tool(addons-list)", function (obj) {
|
||||||
|
|
||||||
var data = obj.data;
|
var data = obj.data;
|
||||||
var event = obj.event;
|
var event = obj.event;
|
||||||
var url = $(this).data('url')
|
var url = $(this).data('url')
|
||||||
@ -100,15 +96,14 @@ layui.define(["table", "form", "upload","notify",'toast'], function (exports) {
|
|||||||
var install = function (data,url,userLoginUrl,userIsPayUrl){
|
var install = function (data,url,userLoginUrl,userIsPayUrl){
|
||||||
var userinfo = api.userinfo.get(); // 检测权限
|
var userinfo = api.userinfo.get(); // 检测权限
|
||||||
if(userinfo) {
|
if(userinfo) {
|
||||||
layer.confirm("确认安装吗?", "vcenter",function(){
|
layer.confirm("确认安装吗?", "vcenter",function(index){
|
||||||
var index = layer.load(1);
|
|
||||||
$.post(url, { name: data.name, version: data.version, uid: userinfo.uid, token: userinfo.token }, function (res) {
|
$.post(url, { name: data.name, version: data.version, uid: userinfo.uid, token: userinfo.token }, function (res) {
|
||||||
// 需要支付
|
// 需要支付
|
||||||
if (res.code === -2) {
|
if (res.code === -2) {
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
area: ['55%', '75%'],
|
area: [common.isModile()?'100%':'800px', common.isModile()?'100%':'600px'],
|
||||||
fixed: false, //不固定
|
fixed: false, //不固定
|
||||||
maxmin: true,
|
maxmin: true,
|
||||||
content: 'pay.html'+ "?id=" + data.id+ "&name=" + data.name + "&version=" + data.version + "&uid=" + userinfo.uid + "&price=" + data.price,
|
content: 'pay.html'+ "?id=" + data.id+ "&name=" + data.name + "&version=" + data.version + "&uid=" + userinfo.uid + "&price=" + data.price,
|
||||||
@ -130,13 +125,11 @@ layui.define(["table", "form", "upload","notify",'toast'], function (exports) {
|
|||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
toast.success({title:"安装成功",message:res.msg,position: 'topRight'});
|
toast.success({title:"安装成功",message:res.msg,position: 'topRight'});
|
||||||
//notify.success(res.msg, "topRight");
|
|
||||||
}
|
}
|
||||||
// 安装失败
|
// 安装失败
|
||||||
if (res.code === -1) {
|
if (res.code === -1) {
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
toast.error({title:"安装失败",message:res.msg,position: 'topRight'});
|
toast.error({title:"安装失败",message:res.msg,position: 'topRight'});
|
||||||
//notify.error(res.msg, "topRight");
|
|
||||||
}
|
}
|
||||||
// 重载
|
// 重载
|
||||||
table.reloadData("addons-list",{},'deep');
|
table.reloadData("addons-list",{},'deep');
|
||||||
@ -166,7 +159,6 @@ layui.define(["table", "form", "upload","notify",'toast'], function (exports) {
|
|||||||
};
|
};
|
||||||
if (!data.name || !data.password) {
|
if (!data.name || !data.password) {
|
||||||
toast.error({title:"安装失败",message:'Account Or Password Cannot Empty',position: 'topRight'});
|
toast.error({title:"安装失败",message:'Account Or Password Cannot Empty',position: 'topRight'});
|
||||||
//notify.error('Account Or Password Cannot Empty');
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -177,16 +169,12 @@ layui.define(["table", "form", "upload","notify",'toast'], function (exports) {
|
|||||||
toast.success({title:"登录成功",message:res.msg,position: 'topRight'}, function (){
|
toast.success({title:"登录成功",message:res.msg,position: 'topRight'}, function (){
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
// notify.success("登录成功", function (){
|
|
||||||
// location.reload();
|
|
||||||
// });
|
|
||||||
} else {
|
} else {
|
||||||
toast.warning({title:"警告消息",message:res.msg});
|
toast.warning({title:"警告消息",message:res.msg});
|
||||||
//notify.alert(res.msg);
|
|
||||||
}
|
}
|
||||||
}, error: function (res) {
|
}, error: function (res) {
|
||||||
toast.error({title:"登录失败",message:res.msg,position: 'topRight'});
|
toast.error({title:"登录失败",message:res.msg,position: 'topRight'});
|
||||||
//notify.error(res.msg);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -210,19 +198,17 @@ layui.define(["table", "form", "upload","notify",'toast'], function (exports) {
|
|||||||
|
|
||||||
// 卸载插件
|
// 卸载插件
|
||||||
if (event === "uninstall") {
|
if (event === "uninstall") {
|
||||||
notify.confirm("确认框", "vcenter",function() {
|
layer.confirm("是否卸载?", "vcenter",function(index) {
|
||||||
var index = layer.load(1);
|
|
||||||
$.post(url, { name: data.name }, function (res) {
|
$.post(url, { name: data.name }, function (res) {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
toast.success({title:"卸载成功",message:res.msg,position: 'topRight'});
|
toast.success({title:"卸载成功",message:res.msg,position: 'topRight'});
|
||||||
//notify.success(res.msg, "topRight");
|
|
||||||
} else {
|
} else {
|
||||||
toast.error({title:"卸载失败",message:res.msg,position: 'topRight'});
|
toast.error({title:"卸载失败",message:res.msg,position: 'topRight'});
|
||||||
//notify.error(res.msg, "topRight");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
table.reload("addons-list");
|
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
|
table.reload("addons-list");
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,7 +218,6 @@ layui.define(["table", "form", "upload","notify",'toast'], function (exports) {
|
|||||||
// 无配置项拦截
|
// 无配置项拦截
|
||||||
if (res.code === -1) {
|
if (res.code === -1) {
|
||||||
toast.warning({title:"警告消息",message:res.msg,position: 'topRight'})
|
toast.warning({title:"警告消息",message:res.msg,position: 'topRight'})
|
||||||
//notify.alert(res.msg);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
layer.open({
|
layer.open({
|
||||||
@ -256,10 +241,8 @@ layui.define(["table", "form", "upload","notify",'toast'], function (exports) {
|
|||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
toast.success({title:"成功消息",message:res.msg,position: 'topRight'});
|
toast.success({title:"成功消息",message:res.msg,position: 'topRight'});
|
||||||
//notify.success(res.msg, "topRight");
|
|
||||||
} else {
|
} else {
|
||||||
toast.error({title:"失败消息",message:res.msg,position: 'topRight'});
|
toast.error({title:"失败消息",message:res.msg,position: 'topRight'});
|
||||||
//notify.error(res.msg, "topRight");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user