升级核心框架6.0.2

This commit is contained in:
toogee 2020-01-14 15:47:11 +08:00
parent d5233f5f71
commit e673309e25
44 changed files with 1235 additions and 901 deletions

View File

@ -26,7 +26,7 @@ Fly模板
#### 安装教程
1.git下载https://gitee.com/toogee/TaoLer/repository/archive/master.zip
1.git下载https://gitee.com/toogee/TaoLer
2.官网下载http://www.aieok.com
3.解压后项目域名部署为public目录对外访问访问http://www.youdomain.com/install/index安装如果安装中有问题需要回退到第一步。
4.安装前需要先建立好数据库(数据库连接地址,数据库用户名,数据库密码,数据库端口,数据库名称)

View File

@ -60,7 +60,7 @@ class Admin extends AdminController
}
}else {
return json(['code'=>1,'msg'=>'审核出错']);
return json(['code'=>-1,'msg'=>'审核出错']);
}
}
@ -76,9 +76,9 @@ class Admin extends AdminController
$result = Db::name('admin')->save($data);
Db::name('auth_group_access')->save(['uid'=>$data['id'],'group_id'=>$data['auth_group_id']]);
if($result){
$res = ['code'=>1,'msg'=>'添加成功'];
$res = ['code'=>0,'msg'=>'添加成功'];
}else{
$res = ['code'=>0,'msg'=>'添加失败'];
$res = ['code'=>-1,'msg'=>'添加失败'];
}
return json($res);
}
@ -105,9 +105,9 @@ class Admin extends AdminController
$result = $admin->update($data);
Db::name('auth_group_access')->where('uid',$data['id'])->update(['group_id'=>$data['auth_group_id']]);
if($result){
$res = ['code'=>1,'msg'=>'编辑成功'];
$res = ['code'=>0,'msg'=>'编辑成功'];
}else{
$res = ['code'=>0,'msg'=>'编辑失败'];
$res = ['code'=>-1,'msg'=>'编辑失败'];
}
return json($res);
}
@ -124,24 +124,23 @@ class Admin extends AdminController
$result = $user->delete();
if($result){
return json(['code'=>1,'msg'=>'删除成功']);
return json(['code'=>0,'msg'=>'删除成功']);
}else{
return json(['code'=>0,'msg'=>'删除失败']);
return json(['code'=>-1,'msg'=>'删除失败']);
}
}
}
//管理员资料更新
public function info()
{
$admin = AdminModel::find(Session::get('admin_id'));
if(Request::isAjax()){
$data = Request::param();
unset($data['auth_group_id']);
$result = $admin->allowField(['nickname','sex','mobile','email','remarks'])->update($data);
$data = Request::only(['nickname','sex','mobile','email','remarks']);
$result = $admin->save($data);
if($result){
$res = ['code'=>0,'msg'=>'更新成功'];
} else {
$res = ['code'=>1,'msg'=>'更新失败'];
$res = ['code'=>-1,'msg'=>'更新失败'];
}
return json($res);
}
@ -149,12 +148,7 @@ class Admin extends AdminController
return View::fetch('set/user/info');
}
/**
* 显示指定的资源
*
* @param int $id
* @return \think\Response
*/
//改密码
public function repass()
{
//
@ -165,9 +159,9 @@ class Admin extends AdminController
$pwd = substr_replace(md5($data['oldPassword']),$salt,0,6);
$data['oldPassword'] = md5($pwd);
if($admin['password'] != $data['oldPassword']){
$res = ['code'=>1,'msg'=>'当前密码错误'];
return json(['code'=>-1,'msg'=>'当前密码错误']);
} elseif($data['password'] != $data['repassword']){
$res = ['code'=>1,'msg'=>'两次密码不一致'];
return json(['code'=>-1,'msg'=>'两次密码不一致']);
} else {
$password = md5(substr_replace(md5($data['password']),$salt,0,6));
$result = $admin->update([
@ -177,11 +171,12 @@ class Admin extends AdminController
if($result){
$res = ['code'=>0,'msg'=>'更新成功'];
} else {
$res = ['code'=>1,'msg'=>'更新失败'];
$res = ['code'=>-1,'msg'=>'更新失败'];
}
return json($res);
}
return json($res);
}
View::assign('admin',$admin);
return View::fetch('set/user/repass');

View File

@ -39,16 +39,6 @@ class AuthGroup extends AdminController
return View::fetch('role');
}
//角色管理
public function role()
{
//
return View::fetch('role');
}
//角色添加
public function roleAdd()
{
@ -56,9 +46,9 @@ class AuthGroup extends AdminController
$data = Request::param();
$result = AuthGroupModel::create($data);
if($result) {
$res = ['code'=>1,'msg'=>'添加成功'];
$res = ['code'=>0,'msg'=>'添加成功'];
} else {
$res = ['code'=>0,'msg'=>'添加失败'];
$res = ['code'=>-1,'msg'=>'添加失败'];
}
return json($res);
}
@ -84,9 +74,9 @@ class AuthGroup extends AdminController
*/
$rule = AuthGroupModel::update($data);
if($rule){
$res = ['code'=>1,'msg'=>'保存成功'];
$res = ['code'=>0,'msg'=>'保存成功'];
} else {
$res = ['code'=>1,'msg'=>'保存成功'];
$res = ['code'=>-1,'msg'=>'保存失败'];
}
return json($res);
}
@ -102,6 +92,41 @@ class AuthGroup extends AdminController
return View::fetch('roleedit');
}
//角色删除
public function roledel($id)
{
if(Request::isAjax()){
$role =AuthGroupModel::find($id);
$result = $role->delete();
if($result){
$res = ['code'=>0,'msg'=>'删除成功'];
}else{
$res = ['code'=>-1,'msg'=>'删除失败'];
}
return json($res);
}
}
//角色审核
public function check()
{
$data = Request::param();
//获取状态
$res = Db::name('auth_group')->where('id',$data['id'])->save(['status' => $data['status']]);
if($res){
if($data['status'] == 1){
return json(['code'=>0,'msg'=>'角色审核通过','icon'=>6]);
} else {
return json(['code'=>0,'msg'=>'禁用此角色','icon'=>5]);
}
}else {
return json(['code'=>-1,'msg'=>'审核出错']);
}
}
}

View File

@ -39,14 +39,13 @@ class AuthRule extends AdminController
//
if(Request::isAjax()){
$data = Request::param();
//halt($data);
$plevel = Db::name('auth_rule')->field('level')->find($data['pid']);
if($plevel){
$data['level'] = $plevel['level']+1;
} else {
$data['level'] = 0;
}
$data['create_time'] = time();
$list = Db::name('auth_rule')->save($data);
if($list){
@ -81,17 +80,13 @@ class AuthRule extends AdminController
if($zi){
$zi->update(['level'=>$data['level']+1]);
}
$save = AuthRuleModel::update($data);
if($save){
$res = ['code'=>0,'msg'=>'修改成功'];
} else {
$res = ['code'=>1,'msg'=>'修改失败'];
$res = ['code'=>-1,'msg'=>'修改失败'];
}
return json($res);
}
@ -118,7 +113,7 @@ class AuthRule extends AdminController
}
}else {
return json(['code'=>1,'msg'=>'审核出错']);
return json(['code'=>-1,'msg'=>'审核出错']);
}
}
@ -127,16 +122,15 @@ class AuthRule extends AdminController
public function menuShow()
{
$data = Request::param();
//var_dump($data);
$rules = Db::name('auth_rule')->save($data);
if($rules){
if($data['ishidden'] == 1){
return json(['code'=>1,'msg'=>'设置菜单显示','icon'=>6]);
return json(['code'=>0,'msg'=>'设置菜单显示','icon'=>6]);
} else {
return json(['code'=>1,'msg'=>'取消菜单显示','icon'=>5]);
return json(['code'=>0,'msg'=>'取消菜单显示','icon'=>5]);
}
}else{
$res = ['code'=>0,'msg'=>'设置失败'];
$res = ['code'=>-1,'msg'=>'设置失败'];
}
return json($res);
}
@ -147,21 +141,27 @@ class AuthRule extends AdminController
$data = Request::param();
$rules = Db::name('auth_rule')->save($data);
if($rules){
$res = ['code'=>1,'msg'=>'排序成功'];
$res = ['code'=>0,'msg'=>'排序成功'];
}else{
$res = ['code'=>0,'msg'=>'排序失败'];
$res = ['code'=>-1,'msg'=>'排序失败'];
}
return json($res);
}
public function delete($id)
{ var_dump($id);
{
$pids = AuthRuleModel::where('pid',$id)->select();
if($pids)
{
$result = $pids->delete();
}
$rule = AuthRuleModel::find($id);
$result = $rule->delete();
if($result){
$res = ['code'=>1,'msg'=>'删除成功'];
$res = ['code'=>0,'msg'=>'删除成功'];
} else {
$res = ['code'=>0,'msg'=>'删除失败'];
$res = ['code'=>-1,'msg'=>'删除失败'];
}
return json($res);
}

View File

@ -7,6 +7,7 @@ use app\admin\validate\Admin;
use app\admin\model\Admin as adminModel;
use app\common\model\Cate;
use app\common\model\Comment;
use app\common\model\Article;
use think\facade\View;
use think\facade\Request;
use think\facade\Db;
@ -22,7 +23,7 @@ class Forum extends AdminController
$forumList = Db::name('article')
->alias('a')
->join('user u','a.user_id = u.id')
->field('a.id as aid,name,user_img,title,a.update_time,is_top')
->field('a.id as aid,name,user_img,title,a.update_time as update_time,is_top,is_hot,a.status as astatus')
->where('a.delete_time',0)
->order('a.create_time', 'desc')
->paginate(15);
@ -32,7 +33,7 @@ class Forum extends AdminController
$res['msg'] = '';
$res['count'] = $forumList->total();
foreach($forumList as $k=>$v){
$res['data'][]= ['id'=>$v['aid'],'poster'=>$v['name'],'avatar'=>$v['user_img'],'content'=>$v['title'],'posttime'=>date("Y-m-d",$v['update_time']),'top'=>$v['is_top']];
$res['data'][]= ['id'=>$v['aid'],'poster'=>$v['name'],'avatar'=>$v['user_img'],'content'=>$v['title'],'posttime'=>date("Y-m-d",$v['update_time']),'top'=>$v['is_top'],'hot'=>$v['is_hot'],'check'=>$v['astatus']];
}
}
return json($res);
@ -41,7 +42,7 @@ class Forum extends AdminController
}
//编辑帖子
public function listForm()
public function listform()
{
if(Request::isAjax()){
$data = Request::param();
@ -51,6 +52,49 @@ class Forum extends AdminController
return View::fetch();
}
//删除帖子
public function listdel($id)
{
if(Request::isAjax()){
$article =Article::find($id);
$result = $article->together(['comments'])->delete();
if($result){
return json(['code'=>0,'msg'=>'删除成功']);
}else{
return json(['code'=>-1,'msg'=>'删除失败']);
}
}
}
//置顶帖子
public function top()
{
//
}
//加精帖子
public function hot()
{
//
}
//审核帖子
public function check()
{
$data = Request::param();
//获取状态
$res = Db::name('article')->where('id',$data['id'])->save(['status' => $data['status']]);
if($res){
if($data['status'] == 1){
return json(['code'=>0,'msg'=>'帖子审核通过','icon'=>6]);
} else {
return json(['code'=>0,'msg'=>'帖子被禁止','icon'=>5]);
}
}else {
return json(['code'=>-1,'msg'=>'审核出错']);
}
}
//帖子分类
public function tags()
{
@ -141,7 +185,7 @@ class Forum extends AdminController
->alias('a')
->join('user u','a.user_id = u.id')
->join('article c','a.article_id = c.id')
->field('a.id as aid,name,title,user_img,a.content as content,a.create_time as create_time')
->field('a.id as aid,name,title,user_img,a.content as content,a.create_time as create_time,a.status as astatus,c.id as cid')
->where('a.delete_time',0)
->order('a.create_time', 'desc')
->paginate(15);
@ -151,9 +195,8 @@ class Forum extends AdminController
if ($replys) {
$res = ['code'=>0,'msg'=>'','count'=>$count];
foreach($replys as $k => $v){
//var_dump($v);
//$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'],'cardid'=>$v['title'],'avatar'=>$v['user_img'],'content'=>$v['content'],'replytime'=>$v['create_time']];
$res['data'][] = ['id'=>$v['aid'],'replyer'=>$v['name'],'cardid'=>$v['title'],'avatar'=>$v['user_img'],'content'=>$v['content'],'replytime'=>date("Y-m-d",$v['create_time']),'check'=>$v['astatus'],'cid'=>$v['cid']];
}
}
return json($res);
@ -162,9 +205,41 @@ class Forum extends AdminController
return View::fetch();
}
//评论编辑
public function replysform()
{
return View::fetch();
}
//评论删除
public function redel($id)
{
if(Request::isAjax()){
$comm =Comment::find($id);
$result = $comm->delete();
if($result){
return json(['code'=>0,'msg'=>'删除成功']);
}else{
return json(['code'=>-1,'msg'=>'删除失败']);
}
}
}
//评论审核
public function recheck()
{
$data = Request::param();
//获取状态
$res = Db::name('comment')->where('id',$data['id'])->save(['status' => $data['status']]);
if($res){
if($data['status'] == 1){
return json(['code'=>0,'msg'=>'评论审核通过','icon'=>6]);
} else {
return json(['code'=>0,'msg'=>'评论被禁止','icon'=>5]);
}
}else {
return json(['code'=>-1,'msg'=>'审核出错']);
}
}
}

View File

@ -39,7 +39,7 @@ class Upgrade extends AdminController
/** 展示升级界面 */
/** 升级界面 */
public function index()
{
$sys_version_num = Db::name('system')->field('sys_version_num,key,upcheck_url,upgrade_url')->find(1);

View File

@ -31,9 +31,8 @@ class User extends AdminController
$res = [];
if($user){
$res = ['code'=>0,'msg'=>'','count'=>$count];
foreach($user as $k => $v){
$data = ['id'=>$v['id'],'username'=>$v['name'],'avatar'=>$v['user_img'],'phone'=>$v['phone'],'email'=>$v['email'],'sex'=>$v['sex'],'ip'=>$v['last_login_ip'],'jointime'=>date("Y-m-d",$v['create_time']),'status'=>$v['status']];
$data = ['id'=>$v['id'],'username'=>$v['name'],'avatar'=>$v['user_img'],'phone'=>$v['phone'],'email'=>$v['email'],'sex'=>$v['sex'],'ip'=>$v['last_login_ip'],'jointime'=>date("Y-m-d",$v['create_time']),'check'=>$v['status'],'auth'=>$v['auth']];
$res['data'][] = $data;
}
}
@ -51,9 +50,9 @@ class User extends AdminController
$data = Request::param();
$result = Db::name('user')->save($data);
if($result){
$res = ['code'=>1,'msg'=>'添加成功'];
$res = ['code'=>0,'msg'=>'添加成功'];
}else{
$res = ['code'=>0,'msg'=>'添加失败'];
$res = ['code'=>-1,'msg'=>'添加失败'];
}
return json($res);
}
@ -68,9 +67,9 @@ class User extends AdminController
$data = Request::param();
$result = Db::name('user')->update($data);
if($result){
$res = ['code'=>1,'msg'=>'编辑成功'];
$res = ['code'=>0,'msg'=>'编辑成功'];
}else{
$res = ['code'=>0,'msg'=>'编辑失败'];
$res = ['code'=>-1,'msg'=>'编辑失败'];
}
return json($res);
}
@ -87,9 +86,9 @@ class User extends AdminController
$result = $user->delete();
if($result){
return json(['code'=>1,'msg'=>'删除成功']);
return json(['code'=>0,'msg'=>'删除成功']);
}else{
return json(['code'=>0,'msg'=>'删除失败']);
return json(['code'=>-1,'msg'=>'删除失败']);
}
}
}
@ -111,12 +110,50 @@ class User extends AdminController
$name_path =str_replace('\\',"/",$upload.'/'.$savename);
$res = ['code'=>0,'msg'=>'上传头像成功','src'=>$name_path];
} else {
$res = ['code'=>1,'msg'=>'上传错误'];
$res = ['code'=>-1,'msg'=>'上传错误'];
}
return json($res);
}
//审核用户
public function check()
{
$data = Request::param();
//获取状态
$res = Db::name('user')->where('id',$data['id'])->save(['status' => $data['status']]);
if($res){
if($data['status'] == 1){
return json(['code'=>0,'msg'=>'用户审核通过','icon'=>6]);
} else {
return json(['code'=>0,'msg'=>'禁用用户','icon'=>5]);
}
}else {
return json(['code'=>-1,'msg'=>'审核出错']);
}
}
//超级管理员
public function auth()
{
$data = Request::param();
$user = Db::name('user')->save($data);
if($user){
if($data['auth'] == 1){
return json(['code'=>0,'msg'=>'设置为超级管理员','icon'=>6]);
} else {
return json(['code'=>0,'msg'=>'取消超级管理员','icon'=>5]);
}
}else{
$res = ['code'=>-1,'msg'=>'前台管理员设置失败'];
}
return json($res);
}
//退出登陆
public function logout()
{

View File

@ -5,15 +5,19 @@ namespace app\admin\model;
use think\Model;
use think\facade\Db;
use think\facade\Session;
//use think\model\concern\SoftDelete;
use think\model\concern\SoftDelete;
class AuthRule extends Model
{
//软删除
//use SoftDelete;
//protected $deleteTime = 'delete_time';
//protected $defaultSoftDelete = 0;
use SoftDelete;
protected $deleteTime = 'delete_time';
protected $defaultSoftDelete = 0;
public function searchIdAttr($query, $value, $data)
{
$query->where('id', $value );
}
//登陆校验
public function authRuleTree()
{

View File

@ -97,7 +97,7 @@ class Article extends BaseController
//获取文章ID
$id = Request::param('id');
//查询文章
$article = ArticleModel::field('id,title,content,status,cate_id,user_id,is_top,is_hot,is_reply,pv,jie,create_time')->with([
$article = ArticleModel::field('id,title,content,status,cate_id,user_id,is_top,is_hot,is_reply,pv,jie,create_time')->where('status',1)->with([
'cate' => function($query){
$query->where('delete_time',0)->field('id,catename');
},

View File

@ -8,11 +8,11 @@ return [
// 服务器地址
'hostname' => '127.0.0.1',
// 数据库名
'database' => 'taotest',
'database' => '',
// 用户名
'username' => 'root',
'username' => '',
// 密码
'password' => 'root',
'password' => '',
// 端口
'hostport' => '3306',
// 数据库连接参数

File diff suppressed because one or more lines are too long

8
composer.lock generated
View File

@ -504,12 +504,12 @@
"source": {
"type": "git",
"url": "https://github.com/top-think/framework.git",
"reference": "e7fa18eebf3092c9abf34c79310eca4d17c78cbd"
"reference": "1444cce94b40a836958380b160a5fb7bfc165daf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/framework/zipball/e7fa18eebf3092c9abf34c79310eca4d17c78cbd",
"reference": "e7fa18eebf3092c9abf34c79310eca4d17c78cbd",
"url": "https://api.github.com/repos/top-think/framework/zipball/1444cce94b40a836958380b160a5fb7bfc165daf",
"reference": "1444cce94b40a836958380b160a5fb7bfc165daf",
"shasum": "",
"mirrors": [
{
@ -564,7 +564,7 @@
"orm",
"thinkphp"
],
"time": "2020-01-11T06:53:35+00:00"
"time": "2020-01-13T05:48:05+00:00"
},
{
"name": "topthink/think-captcha",

View File

@ -29,7 +29,7 @@ return [
'deny_app_list' => [],
// 异常页面的模板文件
'exception_tmpl' => '../view/404.html',
'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl',
// 错误显示信息,非调试模式有效
'error_message' => '页面错误!请稍后再试~',

View File

@ -1,63 +0,0 @@
<?php
use think\facade\Env;
return [
// 默认使用的数据库连接配置
'default' => Env::get('database.driver', 'mysql'),
// 自定义时间查询规则
'time_query_rule' => [],
// 自动写入时间戳字段
// true为自动识别类型 false关闭
// 字符串则明确指定时间字段类型 支持 int timestamp datetime date
'auto_timestamp' => true,
// 时间字段取出后的默认时间格式
'datetime_format' => 'Y-m-d H:i:s',
// 数据库连接配置信息
'connections' => [
'mysql' => [
// 数据库类型
'type' => Env::get('database.type', 'mysql'),
// 服务器地址
'hostname' => Env::get('database.hostname', '127.0.0.1'),
// 数据库名
'database' => Env::get('database.database', ''),
// 用户名
'username' => Env::get('database.username', 'root'),
// 密码
'password' => Env::get('database.password', ''),
// 端口
'hostport' => Env::get('database.hostport', '3306'),
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => Env::get('database.charset', 'utf8'),
// 数据库表前缀
'prefix' => Env::get('database.prefix', ''),
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
'rw_separate' => false,
// 读写分离后 主服务器数量
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// 是否严格检查字段是否存在
'fields_strict' => true,
// 是否需要断线重连
'break_reconnect' => false,
// 监听SQL
'trigger_sql' => true,
// 开启字段缓存
'fields_cache' => false,
// 字段缓存路径
'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR,
],
// 更多的数据库配置信息
],
];

View File

@ -1,34 +1,43 @@
<?php
use think\facade\Env;
return [
// 默认使用的数据库连接配置
'default' => Env::get('database.driver', 'mysql'),
// 自定义时间查询规则
'time_query_rule' => [],
// 自动写入时间戳字段
// true为自动识别类型 false关闭
// 字符串则明确指定时间字段类型 支持 int timestamp datetime date
'auto_timestamp' => true,
// 时间字段取出后的默认时间格式
'datetime_format' => 'Y-m-d H:i:s',
// 数据库连接配置信息
'connections' => [
'mysql' => [
// 数据库类型
'type' => 'mysql',
'type' => Env::get('database.type', 'mysql'),
// 服务器地址
'hostname' => '127.0.0.1',
'hostname' => Env::get('database.hostname', '127.0.0.1'),
// 数据库名
'database' => 'taotao',
'database' => Env::get('database.database', ''),
// 用户名
'username' => 'root',
'username' => Env::get('database.username', 'root'),
// 密码
'password' => 'root',
'password' => Env::get('database.password', ''),
// 端口
'hostport' => '3306',
'hostport' => Env::get('database.hostport', '3306'),
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => 'utf8',
'charset' => Env::get('database.charset', 'utf8'),
// 数据库表前缀
'prefix' => 'tao_',
'prefix' => Env::get('database.prefix', ''),
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
@ -48,5 +57,7 @@ return [
// 字段缓存路径
'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR,
],
// 更多的数据库配置信息
],
];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -79,7 +79,7 @@ layui.define(['table', 'form'], function(exports){
//分类管理
table.render({
elem: '#LAY-app-content-tags'
,url: '/admin/forum/tags' //模拟接口
,url: '/admin/Forum/tags' //模拟接口
,cols: [[
{type: 'numbers', fixed: 'left'}
,{field: 'sort', title: '排序', width: 100, sort: true}
@ -99,7 +99,7 @@ layui.define(['table', 'form'], function(exports){
layer.confirm('确定删除此分类?', function(index){
$.ajax({
type:'post',
url:"/admin/forum/tagsdelete",
url:"/admin/Forum/tagsdelete",
data:{id:data.id},
dataType:'json',
success:function(data){
@ -128,7 +128,7 @@ layui.define(['table', 'form'], function(exports){
layer.open({
type: 2
,title: '编辑分类'
,content: '/admin/forum/tagsform?id='+ data.id
,content: '/admin/Forum/tagsform?id='+ data.id
,area: ['450px', '300px']
,btn: ['确定', '取消']
,yes: function(index, layero){
@ -142,7 +142,7 @@ layui.define(['table', 'form'], function(exports){
$.ajax({
type:"post",
url:"/admin/forum/tagsform",
url:"/admin/Forum/tagsform",
data:{"id":data.id,"catename":tags,"sort":sort,"ename":ename},
daType:"json",
success:function (data){

View File

@ -16,7 +16,7 @@ layui.define(['table', 'form'], function(exports){
//帖子管理
table.render({
elem: '#LAY-app-forum-list'
,url: '/admin/forum/list' //帖子数据接口
,url: '/admin/Forum/list' //帖子数据接口
,cols: [[
{type: 'checkbox', fixed: 'left'}
,{field: 'id', width: 100, title: 'ID', sort: true}
@ -25,6 +25,8 @@ layui.define(['table', 'form'], function(exports){
,{field: 'content', title: '发帖内容',templet: '#title'}
,{field: 'posttime', title: '发帖时间', sort: true}
,{field: 'top', title: '置顶', templet: '#buttonTpl', minWidth: 80, align: 'center'}
,{field: 'hot', title: '精贴', templet: '#buttonHot', minWidth: 80, align: 'center'}
,{field: 'check', title: '审帖', templet: '#buttonCheck', minWidth: 80, align: 'center'}
,{title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-forum-list'}
]]
,page: true
@ -38,7 +40,30 @@ layui.define(['table', 'form'], function(exports){
var data = obj.data;
if(obj.event === 'del'){
layer.confirm('确定删除此条帖子?', function(index){
obj.del();
//obj.del();
$.ajax({
type:'post',
url:"/admin/Forum/listdel",
data:{id:data.id},
dataType:'json',
success:function(data){
if(data.code == 0){
layer.msg(data.msg,{
icon:6,
time:2000
},function(){
location.reload();
});
} else {
layer.open({
title:'删除失败',
content:data.msg,
icon:5,
adim:6
})
}
}
});
layer.close(index);
});
} else if(obj.event === 'edit'){
@ -47,7 +72,7 @@ layui.define(['table', 'form'], function(exports){
layer.open({
type: 2
,title: '编辑帖子'
,content: '/admin/forum/listform?id='+ data.id
,content: '/admin/Forum/listform?id='+ data.id
,area: ['550px', '400px']
,btn: ['确定', '取消']
,resize: false
@ -67,7 +92,7 @@ layui.define(['table', 'form'], function(exports){
//$.ajax({});
$.ajax({
type:"post",
url:"/admin/forum/listform",
url:"/admin/Forum/listform",
data:{"id":data.id,"poster":name,"sort":sort,"ename":ename},
daType:"json",
success:function (data){
@ -103,22 +128,23 @@ layui.define(['table', 'form'], function(exports){
}
});
//回帖管理
//评论管理
table.render({
elem: '#LAY-app-forumreply-list'
,url: '/admin/forum/replys'
,url: '/admin/Forum/replys'
,cols: [[
{type: 'checkbox', fixed: 'left'}
,{field: 'id', width: 100, title: 'ID', sort: true}
,{field: 'replyer', title: '回帖人'}
,{field: 'cardid', title: '回帖ID', sort: true}
,{field: 'cardid', title: '回帖ID',templet: '#title'}
,{field: 'avatar', title: '头像', width: 100, templet: '#imgTpl'}
,{field: 'content', title: '回帖内容', width: 200}
,{field: 'replytime', title: '回帖时间', sort: true}
,{field: 'check', title: '审核', templet: '#buttonCheck'}
,{title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-forum-replys'}
]]
,page: true
,limit: 10
,limit: 15
,limits: [10, 15, 20, 25, 30]
,text: '对不起,加载出现异常!'
});
@ -128,7 +154,30 @@ layui.define(['table', 'form'], function(exports){
var data = obj.data;
if(obj.event === 'del'){
layer.confirm('确定删除此条评论?', function(index){
obj.del();
//obj.del();
$.ajax({
type:'post',
url:"/admin/Forum/redel",
data:{id:data.id},
dataType:'json',
success:function(data){
if(data.code == 0){
layer.msg(data.msg,{
icon:6,
time:2000
},function(){
location.reload();
});
} else {
layer.open({
title:'删除失败',
content:data.msg,
icon:5,
adim:6
})
}
}
});
layer.close(index);
});
} else if(obj.event === 'edit'){
@ -137,7 +186,7 @@ layui.define(['table', 'form'], function(exports){
layer.open({
type: 2
,title: '编辑评论'
,content: '/admin/forum/replysform.html'
,content: '/admin/Forum/replysform.html'
,area: ['550px', '350px']
,btn: ['确定', '取消']
,resize: false

View File

@ -188,6 +188,7 @@ layui.define(['form', 'upload'], function(exports){
//console.log(obj.field);
//提交修改
admin.req({
type: post,
url: '/admin/admin/repass'
,data: obj.field
,success: function(res){

View File

@ -19,15 +19,16 @@ layui.define(['table', 'form'], function(exports){
,url: '/admin/User/list' //模拟接口
,cols: [[
{type: 'checkbox', fixed: 'left'}
,{field: 'id', width: 100, title: 'ID', sort: true}
,{field: 'username', title: '用户名', minWidth: 100}
,{field: 'id', width: 50, title: 'ID', sort: true}
,{field: 'username', title: '用户名', minWidth: 80}
,{field: 'avatar', title: '头像', width: 100, templet: '#imgTpl'}
,{field: 'phone', title: '手机'}
,{field: 'phone', title: '手机',width: 150}
,{field: 'email', title: '邮箱'}
,{field: 'sex', width: 80, title: '性别',templet: '#sex'}
,{field: 'sex', width: 60, title: '性别',templet: '#sex'}
,{field: 'ip', title: '登录IP'}
,{field: 'jointime', title: '申请时间', sort: true}
,{field: 'status', title: '状态', templet: '#buttonStatus', minWidth: 80, align: 'center'}
,{field: 'check', title: '状态', templet: '#buttonCheck', minWidth: 80, align: 'center'}
,{field: 'auth', title: '超级管理员', templet: '#buttonAuth', minWidth: 80, align: 'center'}
,{title: '操作', width: 150, align:'center', fixed: 'right', toolbar: '#table-useradmin-webuser'}
]]
,page: true
@ -54,7 +55,7 @@ layui.define(['table', 'form'], function(exports){
data:{id:data.id},
dataType:'json',
success:function(data){
if(data.code == 1){
if(data.code == 0){
layer.msg(data.msg,{
icon:6,
time:2000
@ -102,7 +103,7 @@ layui.define(['table', 'form'], function(exports){
data:{"id":field.id,"name":field.username,"phone":field.phone,"email":field.email,"user_img":field.avatar,"sex":field.sex},
daType:"json",
success:function (res){
if (res.code == 1) {
if (res.code == 0) {
layer.msg(res.msg,{
icon:6,
time:2000
@ -162,7 +163,6 @@ layui.define(['table', 'form'], function(exports){
}, function(value, index){
layer.close(index);
layer.confirm('确定删除此管理员?', function(index){
//console.log(obj)
//obj.del();
$.ajax({
type:'post',
@ -170,7 +170,7 @@ layui.define(['table', 'form'], function(exports){
data:{id:data.id},
dataType:'json',
success:function(data){
if(data.code == 1){
if(data.code == 0){
layer.msg(data.msg,{
icon:6,
time:2000
@ -216,7 +216,7 @@ layui.define(['table', 'form'], function(exports){
data:{"id":field.id,"password":field.password,"mobile":field.mobile,"email":field.email,"auth_group_id":field.auth_group_id},
daType:"json",
success:function (res){
if (res.code == 1) {
if (res.code == 0) {
layer.msg(res.msg,{
icon:6,
time:2000
@ -258,6 +258,7 @@ layui.define(['table', 'form'], function(exports){
,{field: 'rolename', title: '角色名'}
,{field: 'limits', title: '拥有权限'}
,{field: 'descr', title: '具体描述'}
,{field: 'check', title: '角色审核', toolbar: '#buttonCheck'}
,{title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-useradmin-admin'}
]]
,text: '对不起,加载出现异常!'
@ -269,7 +270,30 @@ layui.define(['table', 'form'], function(exports){
if(obj.event === 'del'){
layer.confirm('确定删除此角色?', function(index){
obj.del();
//obj.del();
$.ajax({
type:'post',
url:"/admin/AuthGroup/roledel",
data:{id:data.id},
dataType:'json',
success:function(data){
if(data.code == 0){
layer.msg(data.msg,{
icon:6,
time:2000
},function(){
location.reload();
});
} else {
layer.open({
title:'删除失败',
content:data.msg,
icon:5,
adim:6
})
}
}
});
layer.close(index);
});
}else if(obj.event === 'edit'){
@ -314,7 +338,7 @@ layui.define(['table', 'form'], function(exports){
data:{"id":field.id,"rules":rules,"title":field.title,"descr":field.descr},
daType:"json",
success:function (res){
if (res.code == 1) {
if (res.code == 0) {
layer.msg(res.msg,{
icon:6,
time:2000
@ -350,14 +374,14 @@ layui.define(['table', 'form'], function(exports){
,url: '/admin/AuthRule/index' //权限接口
,cols: [[
{type: 'checkbox', fixed: 'left'}
,{field: 'id', width: 50, title: 'ID'}
,{field: 'id', width: 50, title: 'ID', align: 'center'}
,{field: 'sort', title: '排序',width: 60 , align: 'center',templet: '#rules-sort'}
,{field: 'title', title: '权限名', templet: '#rules-title'}
,{field: 'name', title: '权限地址', minWidth: 150}
,{field: 'icon', title: '图标'}
,{field: 'status', title:'权限状态', templet: '#buttonAuth', minWidth: 80, align: 'center'}
,{field: 'level', title: '层级',width: 40}
,{field: 'ishidden', title: '菜单',templet: '#menu', Width: 40}
,{field: 'level', title: '层级',width: 60, align: 'center'}
,{field: 'ishidden', title: '菜单',templet: '#menu', width: 60}
,{title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-authrule-edit'}
]]
,text: '对不起,加载出现异常!'
@ -381,7 +405,7 @@ layui.define(['table', 'form'], function(exports){
data:{id:data.id},
dataType:'json',
success:function(data){
if(data.code == 1){
if(data.code == 0){
layer.msg(data.msg,{
icon:6,
time:2000
@ -450,7 +474,7 @@ layui.define(['table', 'form'], function(exports){
}
});
table.reload('LAY-user-auth-rule'); //数据刷新
//table.reload('LAY-user-auth-rule'); //数据刷新
layer.close(index); //关闭弹层
});

286
public/u.php Normal file
View File

@ -0,0 +1,286 @@
<?php
/* http://www.upupw.net */
/* webmaster@upupw.net */
$version="19.07.18SF";
date_default_timezone_set('Asia/Shanghai') && error_reporting(0);
function _GET($n) { return isset($_GET[$n]) ? $_GET[$n] : NULL; }
function _SERVER($n) { return isset($_SERVER[$n]) ? $_SERVER[$n] : '[undefine]'; }
function memory_usage() { $memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB'; return $memory;}
function micro_time_float() { $mtime = microtime(); $mtime = explode(' ', $mtime); return $mtime[1] + $mtime[0];}
function get_hash() {
return sha1(uniqid());
}
@session_start();
$currentTime = time();
$changeTime = 86400;
$rand = '';
if(isset($_SESSION['time']) and ($currentTime - $_SESSION['time']) < $changeTime) {
$rand = $_SESSION['rand'];
}else{
$_SESSION['time'] = $currentTime;
$_SESSION['rand'] = $rand = get_hash();
}
@header("content-Type: text/html; charset=utf-8");
define('YES', '<span style="color: #008000; font-weight : bold;">已开启</span>');
define('NO', '<span style="color: #e74c3c; font-weight : bold;">未开启</span>');
if ($_POST['mysqlPort']=="") {
$host="127.0.0.1";
} else {
$host="127.0.0.1:".$_POST['mysqlPort'];
}
$Info = array();
$Info['php_ini_file'] = function_exists('php_ini_loaded_file') ? php_ini_loaded_file() : '[undefine]';
$mcrypt = get_extension_funcs('mcrypt') ? YES : NO;
$xmlrpc = get_extension_funcs('xmlrpc') ? YES : NO;
$fileinfo = get_extension_funcs('fileinfo') ? YES : NO;
$ftp = get_extension_funcs('ftp') ? YES : NO;
$link = @mysqli_connect($host, $_POST['mysqlUser'], $_POST['mysqlPassword']);
$errno = mysqli_connect_errno();
$pinfo = $rand;
$up_start = micro_time_float();
if (_GET($pinfo) == 'phpinfo') {
if (function_exists('phpinfo')) phpinfo();
else echo "PHPINFO函数已被禁用无法正常显示详细信息!";
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>UPUPW PHP探针安全版</title>
<meta name="keywords" content="php探针,upupw探针,PHP探针安全版,php7探针,phpinfo,php扩展,数据库连接测试" />
<meta name="description" content="upupw php探针安全版兼容最新php7,需成功测试连接本地数据库后才显示phpinfo动态链接页面和网站路径,更安全的php探针." />
<meta name="author" content="UPUPW" />
<meta name="reply-to" content="webmaster@upupw.net" />
<meta name="copyright" content="UPUPW Team" />
<style type="text/css">
<!--
*{margin:0px;padding:0px;}
body {background-color:#FFFFFF;color:#000000;margin:0px;font-family:"\5fae\8f6f\96c5\9ed1",tahoma,arial,sans-serif;}
input {text-align:center;width:200px;height:20px;padding:5px;}
a:link {color:green; text-decoration:none;}
a:visited {color:green;text-decoration:none;}
a:active {color:green;text-decoration:none;}
a:hover {color:#ed776b;text-decoration:none;}
table {border-collapse:collapse;margin:10px 0px;clear:both;}
.inp tr th, td {padding:2px 5px 2px 5px;vertical-align:center;text-align:center;height:30px; border:1px #FFFFFF solid;}
.head1 {background-color:#2c3e50;width:100%;font-size:36px;color:#ffffff; padding-top: 10px; text-align: center; font-family: Georgia, "Times New Roman", Times, serif; font-weight: bold; }
.head2 {background-color:#1abc9c;width:100%;font-size:18px;height:18px;color:#ffffff;}
.el {text-align: center; background-color: #d3e1e5; }
.er {text-align: right; background-color: #d3e1e5; }
.ec {text-align: center; background-color: #1abc9c; font-weight: bold; color: #FFFFFF;}
.fl {text-align: left; background-color: #ecf0f1; color: #505050; }
.fr {text-align:right;background-color:#eeeeee;color:#505050;}
.fc {text-align: center; background-color: #ecf0f1; color: #505050; }
.ft {text-align:center;background-color: #D9F9DE;color:#060;}
a.arrow {font-family:webdings,sans-serif;font-size:10px;}
a.arrow:hover {color:#ff0000;text-decoration:none;}
-->
</style>
</head>
<body>
<div class="head1"><a href="http://www.upupw.net/tanzhen/n126.html" style="color:#ffffff" >{ UPUPW PHP 探针 }</a></div>
<div class="head2"></div>
<div style="margin:0 auto;width:1140px;overflow:hidden;">
<table width="100%" class="inp">
<tr>
<th colspan="2" class="ec" width="50%">服务器信息</th>
<th colspan="2" class="ec" width="50%">PHP功能组件开启状态</th>
</tr>
<tr>
<td class="er" width="12%">服务器域名</td>
<td class="fl" width="38%"><?=_SERVER('SERVER_NAME')?></td>
<td class="er" width="20%">MySQLi Client组件</td>
<td class="fc" width="30%"><?=get_extension_funcs('mysqli') ? YES : NO ?></td>
</tr>
<tr>
<td class="er">服务器端口</td>
<td class="fl">
<?php if(isset($_POST['act'])) {?>
<?=($link)?_SERVER('SERVER_ADDR').':'._SERVER('SERVER_PORT'):"<span style='color:red'>数据库连接测试错误拒绝显示</span>"?>
<?php }
else echo "<a href='#data'><span style='color:green'>数据库连接测试成功后显示</span></a>";
?>
</td>
<td class="er">cURL组件</td>
<td class="fc"><?=get_extension_funcs('curl') ? YES : NO ?></td>
</tr>
<tr>
<td class="er">服务器环境</td>
<td class="fl"><?=stripos(_SERVER('SERVER_SOFTWARE'), 'PHP')?_SERVER('SERVER_SOFTWARE'):_SERVER('SERVER_SOFTWARE')?></td>
<td class="er">GD library组件</td>
<td class="fc"><?=get_extension_funcs('gd') ? YES : NO ?></td>
</tr>
<tr>
<td class="er">PHP运行环境</td>
<td class="fl"><?=PHP_SAPI .' PHP/'.PHP_VERSION?></td>
<td class="er">EXIF信息查看组件</td>
<td class="fc"><?=get_extension_funcs('exif') ? YES : NO ?></td>
</tr>
<tr>
<td class="er">PHP配置文件</td>
<td class="fl" style="word-break:break-all;word-wrap:break-word"><?php if(isset($_POST['act'])) {?>
<?=($link)?htmlentities($Info['php_ini_file']):"<span style='color:red'>数据库连接测试错误拒绝显示</span>"?>
<?php }
else echo "<a href='#data'><span style='color:green'>数据库连接测试成功后显示</span></a>";
?>
</td>
<td class="er">OpenSSL协议组件</td>
<td class="fc"><?=get_extension_funcs('openssl') ? YES : NO ?></td>
</tr>
<tr>
<td class="er">当前网站目录</td>
<td class="fl" style="word-break:break-all;word-wrap:break-word"><?php if(isset($_POST['act'])) {?>
<?=($link)?htmlentities(_SERVER('DOCUMENT_ROOT')):"<span style='color:red'>数据库连接测试错误拒绝显示</span>"?>
<?php }
else echo "<a href='#data'><span style='color:green'>数据库连接测试成功后显示</span></a>";
?>
</td>
<?php
if(version_compare(PHP_VERSION,'7.0.0', '<')){
echo "<td class='er'>Mcrypt加密处理组件</td><td class='fc'>".$mcrypt."</td>";
}else{
echo "<td class='er'>FTP组件</td><td class='fc'>".$ftp."</td>";
}?>
</tr>
<tr>
<td class="er">服务器标准时</td>
<td class="fl">
<?=gmdate('Y-m-d H:i:s', time() + 3600 * 8)?>
</td>
<?php
if(version_compare(PHP_VERSION,'5.3.0', '<')){
echo "<td class='er'>XML-RPC组件</td><td class='fc'>".$xmlrpc."</td>";
}else{
echo "<td class='er'>FileInfo组件</td><td class='fc'>".$fileinfo."</td>";
}?>
</tr>
<tr>
<td class="er">便捷管理入口</td>
<td class="fl"><?php if(isset($_POST['act'])) {?>
<?=($link)?"<a target='_blank' href='?$pinfo=phpinfo'>PHPINFO详细信息</a>":"<span style='color:red'>数据库连接测试错误拒绝显示</span>"?>
<?php }
else echo "<a href='#data'><span style='color:green'>数据库连接测试成功后显示</span></a>";
?>
</td>
<td class="er">Mbstring组件</td>
<td class="fc"><?=get_extension_funcs('mbstring') ? YES : NO ?></td>
</tr>
</table>
<table width="100%" class="inp">
<tr>
<td colspan="4" class="ec" width="50%">PHP Zend解密组件</td>
<td colspan="4" class="ec" width="50%">PHP 缓存优化组件</td>
</tr>
<tr>
<td class="el">Zend Optimizer</td>
<td class="el">Zend GuardLoader</td>
<td class="el">ionCubeLoader</td>
<td class="el">SourceGuardian</td>
<td class="el">WinCache</td>
<td class="el">Zend OPcache</td>
<td class="el">Redis</td>
<td class="el">Memcache</td>
</tr>
<tr>
<td class="fc"><?=get_extension_funcs('Zend Optimizer') ? YES.' / '.OPTIMIZER_VERSION : NO ?></td>
<td class="fc"><?=get_extension_funcs('Zend Guard Loader') ? YES : NO ?></td>
<td class="fc"><?=get_extension_funcs('ionCube Loader') ? YES : NO ?></td>
<td class="fc"><?=get_extension_funcs('SourceGuardian') ? YES : NO ?></td>
<td class="fc"><?=get_extension_funcs('WinCache') ? YES : NO ?></td>
<td class="fc"><?=get_extension_funcs('Zend OPcache') ? YES : NO ?></td>
<td class="fc"><?=phpversion('redis') ? YES : NO ?></td>
<td class="fc"><?=get_extension_funcs('memcache') ? YES : NO ?></td>
</tr>
<tr>
<td colspan="8" class="ft"><?=PHP_SAPI .' PHP/'.PHP_VERSION?>不完全包括以上组件,不同PHP版本能适配的外部扩展不同,为了性能以上组件除网站特别要求外没必要全开启!</td>
</tr>
</table>
<table width="100%" class="inp">
<tr>
<td colspan="6" class="ec" width="100%">PHP重要参数检测</td>
</tr>
<tr>
<td class="el">Memory限制</td>
<td class="el">Upload限制</td>
<td class="el">POST限制</td>
<td class="el">Execution超时</td>
<td class="el">Input超时</td>
<td class="el">Socket超时</td>
</tr>
<tr>
<td class="fc"><?=ini_get('memory_limit')?></td>
<td class="fc"><?=ini_get('upload_max_filesize')?></td>
<td class="fc"><?=ini_get('post_max_size')?></td>
<td class="fc"><?=ini_get('max_execution_time').'s'?></td>
<td class="fc"><?=ini_get('max_input_time').'s'?></td>
<td class="fc"><?=ini_get('default_socket_timeout').'s'?></td>
</tr>
</table>
<table width="100%" class="inp">
<tr>
<th class="ec">PHP已编译模块检测</th>
</tr>
<tr>
<td class="fl" style="text-align:center;">
<?php
$able=get_loaded_extensions();
foreach ($able as $key=>$value) {
if ($key!=0 && $key%13==0) {
echo '<br />';
}
echo "$value&nbsp;&nbsp;&nbsp;&nbsp;";
}
?>
</td>
</tr>
</table>
<form method="post" action="<?=htmlentities($_SERVER['PHP_SELF'])?>">
<table width="100%" id="data" class="inp">
<tr>
<th colspan="4" class="ec">数据库连接测试</th>
</tr>
<tr>
<td colspan="4" class="ft">请及时登录phpMyAdmin修改数据库默认用户名和密码</td>
</tr>
<tr>
<td width="25%" class="er">数据库服务器</td>
<td width="25%" class="fl"><input type="text" name="mysqlHost" value="127.0.0.1" disabled="true"/></td>
<td width="25%" class="er">数据库端口</td>
<td width="25%" class="fl"><input type="text" name="mysqlPort" value="" /></td>
</tr>
<tr>
<td class="er">数据库用户名</td>
<td class="fl"><input type="text" name="mysqlUser" value="" /></td>
<td class="er">数据库用户密码</td>
<td class="fl"><input type="password" name="mysqlPassword" /></td>
</tr>
<tr>
<td colspan="4" align="center" style="padding-top:15px"><input type="submit" value=" 连 接 " name="act" style="height:30px;" /></td>
</tr>
</table>
</form>
<?php if(isset($_POST['act'])) {?>
<table width="100%" class="inp">
<tr>
<th colspan="4" class="ec">数据库测试结果</th>
</tr>
<?php
if ($link) $str1 = '<span style="color: #008000; font-weight: bold;">连接正常 </span> ('.mysqli_get_server_info($link).')';
else $str1 = '<span style="color: #ff0000; font-weight: bold;">连接错误</span><br />'.mysqli_connect_error();
?>
<tr>
<td colspan="2" class="er" width="50%"><?=$host?></td>
<td colspan="2" class="fl" width="50%"><?=$str1?></td>
</tr>
</table>
<?php }?>
<p style="color:#33384e;font-size:14px;text-align:center; margin-bottom:2px;">
<?php $up_time = sprintf('%0.6f', micro_time_float() - $up_start);?>UPUPW探针版本:<?php echo $version?>&nbsp;&nbsp;&nbsp;页面执行时间 <?php echo $up_time?> 秒&nbsp;&nbsp;&nbsp;消耗内存 <?php echo memory_usage();?>
</p>
<hr style="width:100%; color:#cdcdcd" noshade="noshade" size="1" />
<p style="color:#505050; font-size:14px; text-align:center;">&copy; <?php echo date("Y")?> <a href="http://www.upupw.net" target="_blank">UPUPW PHP探针安全版</a>,站点内容与本程序无关。</p>
</div>
</body>
</html>

View File

@ -728,12 +728,12 @@
"source": {
"type": "git",
"url": "https://github.com/top-think/framework.git",
"reference": "e7fa18eebf3092c9abf34c79310eca4d17c78cbd"
"reference": "1444cce94b40a836958380b160a5fb7bfc165daf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/framework/zipball/e7fa18eebf3092c9abf34c79310eca4d17c78cbd",
"reference": "e7fa18eebf3092c9abf34c79310eca4d17c78cbd",
"url": "https://api.github.com/repos/top-think/framework/zipball/1444cce94b40a836958380b160a5fb7bfc165daf",
"reference": "1444cce94b40a836958380b160a5fb7bfc165daf",
"shasum": "",
"mirrors": [
{
@ -760,7 +760,7 @@
"mockery/mockery": "^1.2",
"phpunit/phpunit": "^7.0"
},
"time": "2020-01-11T06:53:35+00:00",
"time": "2020-01-13T05:48:05+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2020-01-12 15:15:21
// This file is automatically generated at:2020-01-14 15:12:36
declare (strict_types = 1);
return array (
0 => 'think\\captcha\\CaptchaService',

View File

@ -39,7 +39,7 @@ use think\initializer\RegisterService;
*/
class App extends Container
{
const VERSION = '6.0.1';
const VERSION = '6.0.2';
/**
* 应用调试模式

View File

@ -115,7 +115,7 @@
$.ajax({
type:'post',
url:"{:url('admin/admin/check')}",
data:{id:data.id,status:data.value,},
data:{"id":data.id,"status":data.value,},
dataType:'json',
success:function(res){
if(res.code == 0){
@ -191,7 +191,7 @@
data:{"username":field.username,"password":field.username,"mobile":field.mobile,"email":field.email,"auth_group_id":field.auth_group_id,"status":field.status},
daType:"json",
success:function (data){
if (data.code == 1) {
if (data.code == 0) {
layer.msg(data.msg,{
icon:6,
time:2000

View File

@ -30,12 +30,8 @@
</div>
<table id="LAY-user-back-role" lay-filter="LAY-user-back-role"></table>
<script type="text/html" id="buttonTpl">
{{# if(d.check == true){ }}
<button class="layui-btn layui-btn-xs">已审核</button>
{{# } else { }}
<button class="layui-btn layui-btn-primary layui-btn-xs">未审核</button>
{{# } }}
<script type="text/html" id="buttonCheck">
{if condition="checkRuleButton('admin/admin/check')"}<input type="checkbox" name="check" lay-skin="switch" lay-filter="rolecheck" lay-text="已审核|未审核" {{# if(d.check == 1){ }} checked {{# } }} id="{{d.id}}" >{else}<button class="layui-btn layui-btn-xs layui-btn-radius layui-btn-disabled">无审核权</button>{/if}
</script>
<script type="text/html" id="table-useradmin-admin">
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
@ -66,6 +62,43 @@
}
});
});
//监听角色审核
form.on('switch(rolecheck)', function(data){
var data= data.elem;
//console.log(data);
if(data.checked == true){
data.value = 1;
}else{
data.value = 0;
}
//执行角色审核
$.ajax({
type:'post',
url:"{:url('admin/AuthGroup/check')}",
data:{id:data.id,status:data.value,},
dataType:'json',
success:function(res){
if(res.code == 0){
layer.msg(res.msg,{
icon:res.icon,
time:2000
}
//,function(){location.reload();}
);
} else {
layer.open({
title:'审核失败',
content:res.msg,
icon:5,
adim:6
})
}
}
});
return false;
});
//事件
var active = {
@ -118,10 +151,9 @@
$(iframeWindow.document).find('input[name=rules]:checked').each(function(){
arr.push($(this).val());
});
var rules = arr.join(',');//将数组元素连接起来以构建一个字符串
var rules = arr.join(',');//将数组元素连接起来以构建一个字符串
*/
//console.log(rules);
//提交 Ajax 成功后,静态更新表格中的数据
$.ajax({
type:"post",
@ -129,7 +161,7 @@
data:{"rules":rules,"title":field.title,"descr":field.descr},
daType:"json",
success:function (data){
if (data.code == 1) {
if (data.code == 0) {
layer.msg(data.msg,{
icon:6,
time:2000

View File

@ -7,13 +7,12 @@
<div class="layui-card-body">
<div style="padding-bottom: 10px;">
<button class="layui-btn layuiadmin-btn-admin" data-type="batchdel">删除</button>
<button class="layui-btn layuiadmin-btn-admin" data-type="add">添加</button>
</div>
<table id="LAY-user-auth-rule" lay-filter="LAY-user-auth-rule"></table>
<script type="text/html" id="rules-sort">
<div class="layui-input-inline" style="width: 30px; high: 30">
<input type="text" name="sort" autocomplete="off" placeholder="排序" dataid="{{d.id}}" class="layui-input" value="{{d.sort}}">
<input type="text" name="sort" autocomplete="off" placeholder="排序" dataid="{{d.id}}" class="layui-input" value="{{d.sort}}">
</div>
</script>
<script type="text/html" id="rules-title">
@ -56,7 +55,7 @@
data:{id:id,sort:sort},
dataType:'json',
success:function(data){
if(data.code == 1){
if(data.code == 0){
layer.msg(data.msg,{
icon:6,
time:2000
@ -96,8 +95,7 @@
where: field
});
});
//菜单控制
form.on('checkbox(menu-show)', function(data){
var data = data.elem;
@ -110,10 +108,10 @@
$.ajax({
type:'post',
url:"/admin/AuthRule/menushow",
data:{id:data.id,ishidden:data.value,},
data:{"id":data.id,"ishidden":data.value,},
dataType:'json',
success:function(data){
if(data.code == 1){
if(data.code == 0){
layer.msg(data.msg,{
icon:6,
time:2000

View File

@ -59,6 +59,16 @@
<button class="layui-btn layui-btn-primary layui-btn-xs">正常</button>
{{# } }}
</script>
<script type="text/html" id="buttonHot">
{{# if(d.hot == 1){ }}
<button class="layui-btn layui-btn-xs">精贴</button>
{{# } else { }}
<button class="layui-btn layui-btn-primary layui-btn-xs">正常</button>
{{# } }}
</script>
<script type="text/html" id="buttonCheck">
{if condition="checkRuleButton('admin/forum/check')"}<input type="checkbox" name="check" lay-skin="switch" lay-filter="forumcheck" lay-text="已审核|未审核" {{# if(d.check == 1){ }} checked {{# } }} id="{{d.id}}" >{else}<button class="layui-btn layui-btn-xs layui-btn-radius layui-btn-disabled">无审核权</button>{/if}
</script>
<script type="text/html" id="table-forum-list">
<a class="layui-btn layui-btn-disabled layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
@ -115,6 +125,42 @@
}
}
//监听帖子审核
form.on('switch(forumcheck)', function(data){
var data= data.elem;
if(data.checked == true){
data.value = 1;
}else{
data.value = 0;
}
//执行帖子审核
$.ajax({
type:'post',
url:"{:url('admin/Forum/check')}",
data:{id:data.id,status:data.value,},
dataType:'json',
success:function(res){
if(res.code == 0){
layer.msg(res.msg,{
icon:res.icon,
time:2000
}
//,function(){location.reload();}
);
} else {
layer.open({
title:'审核失败',
content:res.msg,
icon:5,
adim:6
})
}
}
});
return false;
});
$('.layui-btn.layuiadmin-btn-forum-list').on('click', function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';

View File

@ -32,7 +32,13 @@
<table id="LAY-app-forumreply-list" lay-filter="LAY-app-forumreply-list"></table>
<script type="text/html" id="imgTpl">
<img style="display: inline-block; width: 50%; height: 100%;" src= {{ d.avatar }}>
</script>
</script>
<script type="text/html" id="title">
<a href="/index/jie/{{d.cid}}.html" target="_blank">{{d.cardid}}</a>
</script>
<script type="text/html" id="buttonCheck">
{if condition="checkRuleButton('admin/forum/recheck')"}<input type="checkbox" name="check" lay-skin="switch" lay-filter="recheck" lay-text="已审核|未审核" {{# if(d.check == 1){ }} checked {{# } }} id="{{d.id}}" >{else}<button class="layui-btn layui-btn-xs layui-btn-radius layui-btn-disabled">无审核权</button>{/if}
</script>
<script type="text/html" id="table-forum-replys">
<a class="layui-btn layui-btn-disabled layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
@ -87,6 +93,42 @@
});
}
}
//监听回贴审核
form.on('switch(recheck)', function(data){
var data= data.elem;
if(data.checked == true){
data.value = 1;
}else{
data.value = 0;
}
//执行回帖审核
$.ajax({
type:'post',
url:"{:url('admin/Forum/recheck')}",
data:{id:data.id,status:data.value,},
dataType:'json',
success:function(res){
if(res.code == 0){
layer.msg(res.msg,{
icon:res.icon,
time:2000
}
//,function(){location.reload();}
);
} else {
layer.open({
title:'审核失败',
content:res.msg,
icon:5,
adim:6
})
}
}
});
return false;
});
$('.layui-btn.layuiadmin-btn-replys').on('click', function(){
var type = $(this).data('type');

View File

@ -32,7 +32,7 @@
layer.open({
type: 2
,title: '添加分类'
,content: '/admin/forum/addtags'
,content: '/admin/Forum/addtags'
,area: ['400px', '350px']
,btn: ['确定', '取消']
,yes: function(index, layero){
@ -45,7 +45,7 @@
$.ajax({
type:"post",
url:"{:url('admin/forum/addtags')}",
url:"{:url('admin/Forum/addtags')}",
data:{"catename":tags,"sort":sort,"ename":ename},
daType:"json",
success:function (data){

View File

@ -16,14 +16,14 @@
<div class="layui-form-item">
<label class="layui-form-label">我的角色</label>
<div class="layui-input-inline">
<input type="text" name="auth_group_id" disabled value="{$admin.authGroup.title}" readonly class="layui-input disabled">
<input type="text" name="auth_group_id" value="{$admin.authGroup.title}" readonly class="layui-input layui-disabled" disabled>
</div>
<div class="layui-form-mid layui-word-aux">当前角色不可更改为其它角色</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">用户名</label>
<div class="layui-input-inline">
<input type="text" name="username" value="{$admin.username}" readonly class="layui-input">
<input type="text" name="username" value="{$admin.username}" readonly class="layui-input layui-disabled">
</div>
<div class="layui-form-mid layui-word-aux">不可修改。一般用于后台登入名</div>
</div>

View File

@ -58,6 +58,20 @@
{{# } else { }}
<button class="layui-btn layui-btn-danger layui-btn-xs"></button>
{{# } }}
</script>
<script type="text/html" id="buttonCheck">
{{# if(d.id == '1'){ }}
<input type="checkbox" name="check" lay-skin="switch" disabled lay-text="已审核|未审核" value="1" checked id="{{d.id}}">
{{# } else { }}
{if condition="checkRuleButton('admin/user/check')"}<input type="checkbox" name="check" lay-skin="switch" lay-filter="usercheck" lay-text="已审核|未审核" {{# if(d.check == 1){ }} checked {{# } }} id="{{d.id}}" >{else}<button class="layui-btn layui-btn-xs layui-btn-radius layui-btn-disabled">无审核权</button>{/if}
{{# } }}
</script>
<script type="text/html" id="buttonAuth">
{{# if(d.id == '1'){ }}
<input type="checkbox" name="auth" lay-skin="primary" checked disabled >
{{# } else { }}
{if condition="checkRuleButton('admin/user/auth')"}<input type="checkbox" name="auth" lay-skin="primary" lay-filter="auth" {{# if(d.auth ==1){ }}checked value="0"{{# } else { }}value="1"{{# } }} id="{{d.id}}" >{else}<button class="layui-btn layui-btn-xs layui-btn-disabled">没有权限</button>{/if}
{{# } }}
</script>
<script type="text/html" id="table-useradmin-webuser">
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" id={{ d.id }}><i class="layui-icon layui-icon-edit"></i>编辑</a>
@ -143,7 +157,7 @@
data:{"name":field.username,"phone":field.phone,"email":field.email,"user_img":field.avatar,"sex":field.sex},
daType:"json",
success:function (data){
if (data.code == 1) {
if (data.code == 0) {
layer.msg(data.msg,{
icon:6,
time:2000
@ -167,6 +181,77 @@
});
}
};
//监听用户审核
form.on('switch(usercheck)', function(data){
var data= data.elem;
if(data.checked == true){
data.value = 1;
}else{
data.value = 0;
}
//执行用户审核
$.ajax({
type:'post',
url:"{:url('admin/User/check')}",
data:{"id":data.id,"status":data.value,},
dataType:'json',
success:function(res){
if(res.code == 0){
layer.msg(res.msg,{
icon:res.icon,
time:2000
}
//,function(){location.reload();}
);
} else {
layer.open({
title:'审核失败',
content:res.msg,
icon:5,
adim:6
})
}
}
});
return false;
});
//超级管理auth控制
form.on('checkbox(auth)', function(data){
var data = data.elem;
if(data.checked == true){
data.value = 1;
}else{
data.value = 0;
}
$.ajax({
type:'post',
url:"/admin/User/auth",
data:{"id":data.id,"auth":data.value,},
dataType:'json',
success:function(data){
if(data.code == 0){
layer.msg(data.msg,{
icon:6,
time:2000
}
//,function(){location.reload();}
);
} else {
layer.open({
title:'修改失败',
content:data.msg,
icon:5,
adim:6
})
}
}
});
return false;
});
$('.layui-btn.layuiadmin-btn-useradmin').on('click', function(){
var type = $(this).data('type');

View File

@ -54,7 +54,7 @@
var $ = layui.$
,form = layui.form
,upload = layui.upload ;
//上传头像
upload.render({
elem: '#layuiadmin-upload-useradmin'
,url: 'uploadImg'

View File

@ -51,7 +51,7 @@
var $ = layui.$
,form = layui.form
,upload = layui.upload ;
//上传头像
upload.render({
elem: '#layuiadmin-upload-useradmin'
,url: 'uploadImg'

View File

@ -115,10 +115,10 @@
<div class="layui-row fly-panel-main" style="padding: 15px;">
<div class="layui-clear fly-list-quick">
<div class="layui-col-xs6">
<div><a href="#" target="_blank"> 程序下载 </a></div>
<div><a href="https://gitee.com/toogee/TaoLer/repository/archive/master.zip" target="_blank"> 程序下载 </a></div>
</div>
<div class="layui-col-xs6">
<div><a href="http://www.tp6.com/index/jie/25.html" target="_blank"> 应用说明 </a></div>
<div><a href="http://www.aieok.com/index/jie/25.html" target="_blank"> 应用说明 </a></div>
</div>
<div class="layui-col-xs6">
<div><a href="#" target="_blank"> 申请Key </a></div>