Compare commits

..

No commits in common. "master" and "v2.3.0" have entirely different histories.

204 changed files with 5512 additions and 8352 deletions

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="fly,layui,前端社区"> <meta name="keywords" content="fly,layui,前端社区">
<meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区致力于为web开发提供强劲动力"> <meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区致力于为web开发提供强劲动力">
<link rel="stylesheet" href="/layui-1/css/layui.css"> <link rel="stylesheet" href="/static/layui/css/layui.css">
<link rel="stylesheet" href="/static/res/css/global.css" charset="utf-8"> <link rel="stylesheet" href="/static/res/css/global.css" charset="utf-8">
</head> </head>
<body> <body>
@ -22,8 +22,8 @@
</div> </div>
<include file="./footer" /> <include file="./footer" />
<script src="/layui-1/jquery.min.js" charset="utf-8"></script> <script src="/static/layui/jquery.min.js" charset="utf-8"></script>
<script src="/layui-1/layui.js" charset="utf-8"></script> <script src="/static/layui/layui.js" charset="utf-8"></script>
<script> <script>
layui.cache.user = { layui.cache.user = {

View File

@ -168,6 +168,148 @@ abstract class BaseController
return $domain . $articleUrl; return $domain . $articleUrl;
} }
/**
* 关键词
* 通过百度分词接口获取关键词或者标签
* flag 1.为word时获取分词2.为tag时获取标签
*
* @return array
*/
public function setKeywords($data)
{
$keywords = [];
// 百度分词自动生成关键词
if(!empty(config('taoler.baidu.client_id')) == true) {
//headers数组内的格式
$headers = array();
$headers[] = "Content-Type:application/json";
switch($data['flag']) {
//分词
case 'word':
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/lexer?charset=UTF-8&access_token='.config('taoler.baidu.access_token');
$body = ["text" => $data['keywords']];
break;
//标签
case 'tag':
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/keyword?charset=UTF-8&access_token='.config('taoler.baidu.access_token');
$body = ['title' => $data['keywords'], 'content'=>$data['content']];
break;
default:
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/lexer?charset=UTF-8&access_token='.config('taoler.baidu.access_token');
$body = ["text" => $data['keywords']];
}
$postBody = json_encode($body);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);//设置请求头
curl_setopt($curl, CURLOPT_POSTFIELDS, $postBody);//设置请求体
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');//使用一个自定义的请求信息来代替"GET"或"HEAD"作为HTTP请求。(这个加不加没啥影响)
$datas = curl_exec($curl);
if($datas == false) {
echo '接口无法链接';
} else {
$res = stripos($datas,'error_code');
// 接收返回的数据
$dataItem = json_decode($datas);
if($res == false) {
// 数据正常
$items = $dataItem->items;
foreach($items as $item) {
switch($data['flag']) {
case 'word':
if($item->pos == 'n' && !in_array($item->item,$keywords)){
$keywords[] = $item->item;
}
break;
case 'tag':
if(!in_array($item->tag,$keywords)){
$keywords[] = $item->tag;
}
break;
default:
if($item->pos == 'n' && !in_array($item->item,$keywords)){
$keywords[] = $item->item;
}
}
}
} else {
// 接口正常但获取数据失败可能参数错误重新获取token
$url = 'https://aip.baidubce.com/oauth/2.0/token';
$post_data['grant_type'] = config('taoler.baidu.grant_type');;
$post_data['client_id'] = config('taoler.baidu.client_id');
$post_data['client_secret'] = config('taoler.baidu.client_secret');
$o = "";
foreach ( $post_data as $k => $v )
{
$o.= "$k=" . urlencode( $v ). "&" ;
}
$post_data = substr($o,0,-1);
$res = $this->request_post($url, $post_data);
// 写入token
SetArr::name('taoler')->edit([
'baidu'=> [
'access_token' => json_decode($res)->access_token,
]
]);
echo 'api接口数据错误 - ';
echo $dataItem->error_msg;
}
}
}
return $keywords;
}
// api_post接口
function request_post($url = '', $param = '')
{
if (empty($url) || empty($param)) {
return false;
}
$postUrl = $url;
$curlPost = $param;
$curl = curl_init();//初始化curl
curl_setopt($curl, CURLOPT_URL,$postUrl);//抓取指定网页
curl_setopt($curl, CURLOPT_HEADER, 0);//设置header
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
curl_setopt($curl, CURLOPT_POST, 1);//post提交方式
curl_setopt($curl, CURLOPT_POSTFIELDS, $curlPost);
$data = curl_exec($curl);//运行curl
curl_close($curl);
return $data;
}
/**
* 标题调用百度关键词词条
*
* @return Json
*/
public function getBdiduSearchWordList($words)
{
if(empty($words)) return json(['code'=>-1,'msg'=>'null']);
$url = 'https://www.baidu.com/sugrec?prod=pc&from=pc_web&wd='.$words;
//$result = Api::urlGet($url);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$datas = curl_exec($curl);
curl_close($curl);
$data = json_decode($datas,true);
if(isset($data['g'])) {
return json(['code'=>0,'msg'=>'success','data'=>$data['g']]);
} else {
return json(['code'=>-1,'msg'=>'null']);
}
}
/** /**
* 上传接口 * 上传接口
@ -176,23 +318,22 @@ abstract class BaseController
*/ */
public function uploadFiles($type) public function uploadFiles($type)
{ {
$max_file_seze = $this->getSystem()['upsize'];
$uploads = new Uploads(); $uploads = new Uploads();
switch ($type){ switch ($type){
case 'image': case 'image':
$upRes = $uploads->put('file','article_pic',$max_file_seze,'image'); $upRes = $uploads->put('file','article_pic',2048,'image');
break; break;
case 'zip': case 'zip':
$upRes = $uploads->put('file','article_zip',$max_file_seze,'application|image'); $upRes = $uploads->put('file','article_zip',1024,'application|image');
break; break;
case 'video': case 'video':
$upRes = $uploads->put('file','article_video',$max_file_seze,'video|audio'); $upRes = $uploads->put('file','article_video',102400,'video|audio');
break; break;
case 'audio': case 'audio':
$upRes = $uploads->put('file','article_audio',$max_file_seze,'audio'); $upRes = $uploads->put('file','article_audio',102400,'audio');
break; break;
default: default:
$upRes = $uploads->put('file','article_file',$max_file_seze,'image'); $upRes = $uploads->put('file','article_file',2048,'image');
break; break;
} }
return $upRes; return $upRes;
@ -214,6 +355,7 @@ abstract class BaseController
} }
//下载远程图片 //下载远程图片
private function downloadImage($url) private function downloadImage($url)
{ {
@ -328,17 +470,4 @@ abstract class BaseController
return $array; return $array;
} }
/**
* 过滤字符串中表情
* @param $str string 字符串内容
* @return string
*/
public function filterEmoji(string $str): string
{
$str = preg_replace_callback('/./u', function (array $match) {
return strlen($match[0]) >= 4 ? '' : $match[0];
}, $str);
return $str;
}
} }

View File

@ -337,15 +337,13 @@ class Addons extends AdminController
* @return string|Json * @return string|Json
* @throws \Exception * @throws \Exception
*/ */
public function config() public function config($name)
{ {
$name = input('name'); $name = input('name');
$config = get_addons_config($name); $config = get_addons_config($name);
// halt($config);
if(empty($config)) return json(['code'=>-1,'msg'=>'无配置项!无需操作']); if(empty($config)) return json(['code'=>-1,'msg'=>'无配置项!无需操作']);
if(Request::isAjax()){ if(Request::isAjax()){
$params = Request::param('params/a',[],'trim'); $params = Request::param('params/a',[],'trim');
// halt($params);
if ($params) { if ($params) {
foreach ($config as $k => &$v) { foreach ($config as $k => &$v) {
if (isset($params[$k])) { if (isset($params[$k])) {
@ -371,7 +369,7 @@ class Addons extends AdminController
} }
return json(['code'=>0,'msg'=>'配置成功!']); return json(['code'=>0,'msg'=>'配置成功!']);
} }
//halt($config);
//模板引擎初始化 //模板引擎初始化
$view = ['formData'=>$config,'title'=>'title']; $view = ['formData'=>$config,'title'=>'title'];
View::assign($view); View::assign($view);

View File

@ -140,14 +140,14 @@ class Comment extends AdminController
public function delete($id) public function delete($id)
{ {
if(Request::isAjax()){ if(Request::isAjax()){
try { $arr = explode(",",$id);
$arr = explode(",",$id); foreach($arr as $v){
foreach($arr as $v){ $comm = CommentModel::find($v);
$comm = CommentModel::find($v); $result = $comm->delete();
$comm->delete(); }
} if($result){
return json(['code'=>0,'msg'=>'删除成功']); return json(['code'=>0,'msg'=>'删除成功']);
} catch (\Exception $e) { }else{
return json(['code'=>-1,'msg'=>'删除失败']); return json(['code'=>-1,'msg'=>'删除失败']);
} }
} }

View File

@ -12,7 +12,6 @@ namespace app\admin\controller\content;
use app\common\controller\AdminController; use app\common\controller\AdminController;
use app\common\model\Article; use app\common\model\Article;
use app\facade\Cate;
use think\App; use think\App;
use think\facade\View; use think\facade\View;
use think\facade\Request; use think\facade\Request;
@ -44,7 +43,7 @@ class Forum extends AdminController
public function list() public function list()
{ {
$data = Request::only(['id','name','title','sec','cate_id']); $data = Request::only(['id','name','title','sec']);
$where = []; $where = [];
if (!empty($data['sec'])) { if (!empty($data['sec'])) {
switch ($data['sec']) { switch ($data['sec']) {
@ -74,17 +73,13 @@ class Forum extends AdminController
$where[] = ['id', '=', $data['id']]; $where[] = ['id', '=', $data['id']];
} }
if(!empty($data['cate_id'])){
$where[] = ['cate_id', '=', $data['cate_id']];
}
if(!empty($data['name'])){ if(!empty($data['name'])){
$userId = Db::name('user')->where('name',$data['name'])->value('id'); $userId = Db::name('user')->where('name',$data['name'])->value('id');
$where[] = ['user_id', '=', $userId]; $where[] = ['user_id', '=', $userId];
} }
if(!empty($data['title'])){ if(!empty($data['title'])){
$where[] = ['title', 'like', '%'.$data['title'].'%']; $where[] = ['title', 'like', $data['title'].'%'];
} }
$list = $this->model->getList($where, input('limit'), input('page')); $list = $this->model->getList($where, input('limit'), input('page'));
@ -96,7 +91,6 @@ class Forum extends AdminController
'poster' => $v['user']['name'], 'poster' => $v['user']['name'],
'avatar' => $v['user']['user_img'], 'avatar' => $v['user']['user_img'],
'title' => htmlspecialchars($v['title']), 'title' => htmlspecialchars($v['title']),
'cate' => $v['cate']['catename'],
'url' => $this->getArticleUrl($v['id'], 'index', $v['cate']['ename']), 'url' => $this->getArticleUrl($v['id'], 'index', $v['cate']['ename']),
'content' => strip_tags($v['content']), 'content' => strip_tags($v['content']),
'posttime' => $v['update_time'], 'posttime' => $v['update_time'],
@ -137,9 +131,9 @@ class Forum extends AdminController
$data['content'] = $this->downUrlPicsReaplace($data['content']); $data['content'] = $this->downUrlPicsReaplace($data['content']);
// 把,转换为,并去空格->转为数组->去掉空数组->再转化为带,号的字符串 // 把,转换为,并去空格->转为数组->去掉空数组->再转化为带,号的字符串
$data['keywords'] = implode(',',array_filter(explode(',',trim(str_replace('',',',$data['keywords']))))); $data['keywords'] = implode(',',array_filter(explode(',',trim(str_replace('',',',$data['keywords'])))));
$data['description'] = strip_tags($this->filterEmoji($data['description']));
// 获取分类ename,appname // 获取分类ename,appname
$cateEname = Db::name('cate')->where('id',$data['cate_id'])->value('ename'); $cateName = $this->model->field('ename,appname')->find($data['cate_id']);
$result = $this->model->add($data); $result = $this->model->add($data);
if ($result['code'] == 1) { if ($result['code'] == 1) {
@ -158,7 +152,7 @@ class Forum extends AdminController
// 清除文章tag缓存 // 清除文章tag缓存
Cache::tag('tagArtDetail')->clear(); Cache::tag('tagArtDetail')->clear();
$link = $this->getArticleUrl((int)$aid, 'index', $cateEname); $link = $this->getArticleUrl((int)$aid, 'index', $cateName['ename']);
hook('SeoBaiduPush', ['link'=>$link]); // 推送给百度收录接口 hook('SeoBaiduPush', ['link'=>$link]); // 推送给百度收录接口
@ -169,6 +163,11 @@ class Forum extends AdminController
} }
return $res; return $res;
} }
//1.查询分类表获取所有分类
$cateList = Db::name('cate')->where(['status'=>1,'delete_time'=>0])->order('sort','asc')->cache('catename',3600)->select();
//2.将catelist变量赋给模板 公共模板nav.html
View::assign('cateList',$cateList);
return View::fetch('add'); return View::fetch('add');
} }
@ -202,7 +201,7 @@ class Forum extends AdminController
$data['content'] = $this->downUrlPicsReaplace($data['content']); $data['content'] = $this->downUrlPicsReaplace($data['content']);
// 把,转换为,并去空格->转为数组->去掉空数组->再转化为带,号的字符串 // 把,转换为,并去空格->转为数组->去掉空数组->再转化为带,号的字符串
$data['keywords'] = implode(',',array_filter(explode(',',trim(str_replace('',',',$data['keywords']))))); $data['keywords'] = implode(',',array_filter(explode(',',trim(str_replace('',',',$data['keywords'])))));
$data['description'] = strip_tags($this->filterEmoji($data['description']));
$result = $article->edit($data); $result = $article->edit($data);
if($result == 1) { if($result == 1) {
//处理标签 //处理标签
@ -229,7 +228,7 @@ class Forum extends AdminController
} }
//删除原有缓存显示编辑后内容 //删除原有缓存显示编辑后内容
Cache::delete('article_'.$id); Cache::delete('article_'.$id);
$link = $this->getArticleUrl((int) $id, 'index', $article->cate->ename); $link = $this->getRouteUrl((int) $id, $article->cate->ename, $article->cate->appname);
hook('SeoBaiduPush', ['link'=>$link]); // 推送给百度收录接口 hook('SeoBaiduPush', ['link'=>$link]); // 推送给百度收录接口
return Msgres::success('edit_success',$link); return Msgres::success('edit_success',$link);
} }
@ -237,24 +236,31 @@ class Forum extends AdminController
} }
View::assign(['article'=>$article]); View::assign(['article'=>$article]);
//1.查询分类表获取所有分类
$cateList = Db::name('cate')->where(['status'=>1,'delete_time'=>0])->order('sort','asc')->cache('catename',3600)->select();
//2.将catelist变量赋给模板 公共模板nav.html
View::assign('cateList',$cateList);
return View::fetch(); return View::fetch();
} }
//删除帖子 多选和单独 //删除帖子
public function delete($id) public function delete($id)
{ {
if(Request::isAjax()){ if(Request::isAjax()){
try { $arr = explode(",",$id);
$arr = explode(",",$id); foreach($arr as $v){
foreach($arr as $v){ $article = Article::find($v);
$article = Article::find($v); $result = $article->together(['comments'])->delete();
$article->together(['comments'])->delete(); }
}
return json(['code'=>0,'msg'=>'删除成功']); if($result){
} catch (\Exception $e) { return json(['code'=>0,'msg'=>'删除成功']);
return json(['code'=>-1,'msg'=>'删除失败']); }else{
} return json(['code'=>-1,'msg'=>'删除失败']);
}
} }
} }
@ -288,6 +294,29 @@ class Forum extends AdminController
return $this->uploadFiles($type); return $this->uploadFiles($type);
} }
/**
* 调用百度关键词
*
* @return json
*/
public function getKeywords()
{
$data = Request::only(['flag','keywords','content']);
$keywords = $this->setKeywords($data);
return json(['code'=>0, 'msg' => 'ok', 'data'=> $keywords]);
}
/**
* 标题调用百度关键词词条
* @return Json
*/
public function getWordList()
{
$title = input('title');
return $this->getBdiduSearchWordList($title);
}
/** /**
* 内容中是否有图片视频音频插入 * 内容中是否有图片视频音频插入
* *
@ -309,9 +338,21 @@ class Forum extends AdminController
return $data; return $data;
} }
/**
* 获取描述过滤html
*
* @return void
*/
public function getDescription()
{
$data = Request::only(['content']);
$description = getArtContent($data['content']);
return json(['code'=>0,'data'=>$description]);
}
/** /**
* 分类树 * 分类
* @return Json * @return Json
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
@ -333,28 +374,6 @@ class Forum extends AdminController
return json($tree); return json($tree);
} }
/**
* 分类
* @return \think\response\Json
*/
public function getCateList()
{
$cateList = Cate::field('id,pid,catename,sort')->where(['status' => 1])->select()->toArray();
// 排序
$cmf_arr = array_column($cateList, 'sort');
array_multisort($cmf_arr, SORT_ASC, $cateList);
$list = getTree($cateList);
$count = count($list);
$tree = [];
if($count){
$tree = ['code'=>0, 'msg'=>'ok','count'=>$count];
$tree['data'] = $list;
}
return json($tree);
}
//array_filter过滤函数 //array_filter过滤函数
protected function filtr($arr){ protected function filtr($arr){
if($arr === '' || $arr === null){ if($arr === '' || $arr === null){

View File

@ -16,8 +16,6 @@ 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;
use app\common\validate\User as userValidate;
use think\exception\ValidateException;
class User extends AdminController class User extends AdminController
@ -81,14 +79,6 @@ class User extends AdminController
// //
if(Request::isAjax()){ if(Request::isAjax()){
$data = Request::only(['name','email','user_img','password','phone','sex']); $data = Request::only(['name','email','user_img','password','phone','sex']);
try{
validate(userValidate::class)
->scene('userReg')
->check($data);
} catch (ValidateException $e) {
// 验证失败 输出错误信息
return json(['code'=>-1,'msg'=>$e->getError()]);
}
$data['create_time'] = time(); $data['create_time'] = time();
$salt = substr(md5($data['create_time']),-6); $salt = substr(md5($data['create_time']),-6);
// 密码 // 密码
@ -110,13 +100,9 @@ class User extends AdminController
{ {
if(Request::isAjax()){ if(Request::isAjax()){
$data = Request::only(['id','name','email','user_img','password','phone','sex']); $data = Request::only(['id','name','email','user_img','password','phone','sex']);
if(empty($data['password'])) { $user = Db::name('user')->field('create_time')->find($data['id']);
unset($data['password']); $salt = substr(md5($user['create_time']),-6);
} else { $data['password'] = md5(substr_replace(md5($data['password']),$salt,0,6)); // 密码
$user = Db::name('user')->field('create_time')->find($data['id']);
$salt = substr(md5($user['create_time']),-6);
$data['password'] = md5(substr_replace(md5($data['password']),$salt,0,6)); // 密码
}
try{ try{
Db::name('user')->update($data); Db::name('user')->update($data);
return json(['code'=>0,'msg'=>'编辑成功']); return json(['code'=>0,'msg'=>'编辑成功']);

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<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> <body>
@ -24,10 +24,10 @@
{:form_radio($name,$vo.content,['label'=>$vo.title,'tips'=>$vo.tips],$vo.value)} {:form_radio($name,$vo.content,['label'=>$vo.title,'tips'=>$vo.tips],$vo.value)}
{/case} {/case}
{case value="checkbox"} {case value="checkbox"}
{:form_checkbox($name, $vo.content,['label'=>$vo.title, 'verify' =>$vo.rule,'tips'=>$vo.tips,], $vo['value'])} {:form_checkbox($name, $vo.content,['label'=>$vo.title, 'verify' =>$vo.rule,'tips'=>$vo.tips,], $vo['value'])};
{/case} {/case}
{case value="switch"} {case value="switch"}
{:form_switch($name, $vo.content,['label'=>$vo.title, 'verify' =>$vo.rule,'tips'=>$vo.tips,], $vo['value'])} {:form_switch($name, $vo.content,['label'=>$vo.title, 'verify' =>$vo.rule,'tips'=>$vo.tips,], $vo['value'])};
{/case} {/case}
{case value="select"} {case value="select"}
{:form_select($name,$vo.content,['label'=>$vo.title,'verify'=>$vo.rule,'tips'=>$vo.tips,'search'=>1] ,[],$vo.value)} {:form_select($name,$vo.content,['label'=>$vo.title,'verify'=>$vo.rule,'tips'=>$vo.tips,'search'=>1] ,[],$vo.value)}
@ -66,7 +66,7 @@
<script> <script>
layui.use(['upload','toast'], function(){ layui.use(['upload','toast'], 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('addon.addons/uploads')}" ,url: "{:url('addon.addons/uploads')}"

View File

@ -24,7 +24,7 @@
<script type="text/html" id="addons-bar"> <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-upload-circle"></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>
@ -100,7 +100,7 @@
url: LIST_URL, url: LIST_URL,
cols: cols, cols: cols,
page: true, page: true,
limit: 15, limit: 10,
text: "对不起,加载出现异常!", text: "对不起,加载出现异常!",
}); });

View File

@ -1,6 +1,11 @@
{extend name="public:admin_form" /} <!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>
<body>
<form class="layui-form" action=""> <form class="layui-form" action="">
<div class="mainBox"> <div class="mainBox">
<div class="main-container"> <div class="main-container">
@ -16,20 +21,14 @@
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="catename" lay-verify="required" placeholder="分类名*" autocomplete="off" class="layui-input"> <input type="text" name="catename" lay-verify="required" placeholder="分类名*" autocomplete="off" class="layui-input">
</div> </div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">EN别名</label> <label class="layui-form-label">EN别名</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="ename" lay-verify="required" placeholder="英文名*" autocomplete="off" class="layui-input"> <input type="text" name="ename" lay-verify="required" placeholder="英文名*" autocomplete="off" class="layui-input">
</div> </div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图标</label> <label class="layui-form-label">图标</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="icon" placeholder="图标*" id="iconPicker" lay-filter="iconPicker" style="display:none;" class="layui-input"> <input type="text" name="icon" placeholder="图标*" id="iconPicker" lay-filter="iconPicker" style="display:none;" class="layui-input">
</div> </div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">详情页模板</label> <label class="layui-form-label">详情页模板</label>
<div class="layui-input-block"> <div class="layui-input-block">
<select name="detpl" id="tpl" lay-verify="required"> <select name="detpl" id="tpl" lay-verify="required">
@ -38,14 +37,10 @@
{/volist} {/volist}
</select> </select>
</div> </div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">描述</label> <label class="layui-form-label">描述</label>
<div class="layui-input-block"> <div class="layui-input-block">
<textarea type="text" name="desc" lay-verify="required" placeholder="描述*" autocomplete="off" class="layui-textarea"></textarea> <input type="text" name="desc" lay-verify="required" placeholder="描述*" autocomplete="off" class="layui-input">
</div> </div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序</label> <label class="layui-form-label">排序</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="sort" lay-verify="number|required" placeholder="请填数字" autocomplete="off" class="layui-input"> <input type="text" name="sort" lay-verify="number|required" placeholder="请填数字" autocomplete="off" class="layui-input">
@ -66,9 +61,8 @@
</div> </div>
</div> </div>
</form> </form>
{/block} <script src="/static/component/layui/layui.js"></script>
<script src="/static/component/pear/pear.js"></script>
{block name="js"}
<script> <script>
layui.use(['form', 'iconPicker', 'xmSelect',], function(){ layui.use(['form', 'iconPicker', 'xmSelect',], function(){
var $ = layui.jquery var $ = layui.jquery
@ -104,9 +98,9 @@
icon: 1, icon: 1,
time: 1000 time: 1000
}, function() { }, function() {
// parent.layui.table.reload("cate-table"); parent.layer.close(parent.layer.getFrameIndex(window
parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭当前页 .name)); //关闭当前页
window.parent.location.reload(); parent.layui.table.reload("cate-table");
}); });
} else { } else {
layer.msg(result.msg, { layer.msg(result.msg, {
@ -207,4 +201,5 @@
}) })
</script> </script>
{/block} </body>
</html>

View File

@ -1,6 +1,11 @@
{extend name="public:admin_form" /} <!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>
<body>
<form class="layui-form" action=""> <form class="layui-form" action="">
<div class="mainBox"> <div class="mainBox">
<div class="main-container"> <div class="main-container">
@ -42,7 +47,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">描述</label> <label class="layui-form-label">描述</label>
<div class="layui-input-block"> <div class="layui-input-block">
<textarea type="text" name="desc" lay-verify="required" value="{$cate.desc}" placeholder="描述*" autocomplete="off" class="layui-textarea">{$cate.desc}</textarea> <input type="text" name="desc" lay-verify="required" value="{$cate.desc}" placeholder="描述*" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
@ -69,9 +74,8 @@
</div> </div>
</div> </div>
</form> </form>
{/block} <script src="/static/component/layui/layui.js"></script>
<script src="/static/component/pear/pear.js"></script>
{block name="js"}
<script> <script>
layui.use(['form', 'iconPicker', 'xmSelect',], function(){ layui.use(['form', 'iconPicker', 'xmSelect',], function(){
var $ = layui.jquery var $ = layui.jquery
@ -79,7 +83,8 @@
var iconPicker = layui.iconPicker; var iconPicker = layui.iconPicker;
var xmSelect = layui.xmSelect; var xmSelect = layui.xmSelect;
var initPid = "{$cate.pid}"; var initPid = "{$cate.pid}";
let ADD_EDIT = "{:url('content.cate/addEdit')}";
let ADD_EDIT = "{:url('content.cate/addEdit')}";
//初始化图标选择 //初始化图标选择
iconPicker.render({ iconPicker.render({
@ -106,8 +111,9 @@
icon: 1, icon: 1,
time: 1000 time: 1000
}, function() { }, function() {
parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭当前页 parent.layer.close(parent.layer.getFrameIndex(window
window.parent.location.reload(); .name)); //关闭当前页
parent.layui.table.reload("cate-table");
}); });
} else { } else {
layer.msg(result.msg, { layer.msg(result.msg, {
@ -160,4 +166,5 @@
}) })
</script> </script>
{/block} </body>
</html>

View File

@ -146,7 +146,7 @@
type: 2, type: 2,
title: '新增', title: '新增',
shade: 0.1, shade: 0.1,
area: ['550px', '650px'], area: ['450px', '500px'],
content: 'addEdit.html' content: 'addEdit.html'
}); });
} }
@ -156,7 +156,7 @@
type: 2, type: 2,
title: '修改', title: '修改',
shade: 0.1, shade: 0.1,
area: ['550px', '650px'], area: ['450px', '500px'],
content: 'addEdit.html?id=' + obj.data.id content: 'addEdit.html?id=' + obj.data.id
}); });
} }

View File

@ -130,10 +130,7 @@
form.on('submit(comment-query)', function(data) { form.on('submit(comment-query)', function(data) {
table.reload('comment-table', { table.reload('comment-table', {
where: data.field, where: data.field
page: {
curr: 1 //重新从第 1 页开始
}
}) })
return false; return false;
}); });
@ -151,7 +148,7 @@
data:{id:data.id,status:status}, data:{id:data.id,status:status},
dataType:'json', dataType:'json',
success:function(res){ success:function(res){
if(res.code === 0){ if(res.code == 0){
layer.msg(res.msg,{ layer.msg(res.msg,{
icon:res.icon, icon:res.icon,
time:2000 time:2000
@ -173,7 +170,7 @@
window.remove = function(obj) { window.remove = function(obj) {
layer.confirm('确定要删除?', { layer.confirm('确定要删除该评论吗', {
icon: 3, icon: 3,
title: '提示' title: '提示'
}, function(index) { }, function(index) {
@ -215,7 +212,7 @@
return false; return false;
} }
layer.confirm('确定要删除?', { layer.confirm('确定要删除这些评论', {
icon: 3, icon: 3,
title: '提示' title: '提示'
}, function(index) { }, function(index) {
@ -228,7 +225,7 @@
data:{"id":checkIds}, data:{"id":checkIds},
success: function(result) { success: function(result) {
layer.close(loading); layer.close(loading);
if (result.code === 0) { if (result.success) {
layer.msg(result.msg, { layer.msg(result.msg, {
icon: 1, icon: 1,
time: 1000 time: 1000
@ -247,7 +244,7 @@
} }
window.refresh = function(param) { window.refresh = function(param) {
table.reload('comment-table'); table.reload('user-table');
} }

View File

@ -4,12 +4,6 @@
<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" />
<style>
#L_title {position: relative;}
.bdsug {height: auto; position: absolute; left: 0; top: 30px; z-index: 100; background: #fff; border-radius: 0 0 10px 10px; border: 1px solid #dadade!important; border-top: 0!important; box-shadow: none;}
.bdsug ul{display: block;margin: 5px 2px 0; padding: 5px 0 7px; background: 0 0; border-top: 0px solid #f5f5f6;}
.bdsug ul>li{margin-top: 0;height:30px;line-height: 25px;}
</style>
</head> </head>
<body> <body>
<form class="layui-form" action=""> <form class="layui-form" action="">
@ -19,7 +13,12 @@
<div class="layui-col-md3"> <div class="layui-col-md3">
<label class="layui-form-label">{:lang('special column')}</label> <label class="layui-form-label">{:lang('special column')}</label>
<div class="layui-input-block"> <div class="layui-input-block">
<div id="CateId" class="xm-select-demo"></div> <select lay-verify="required" name="cate_id" lay-filter="column">
<option></option>
{volist name="cateList" id="cate"}
<option value="{$cate.id}" {if ($Request.param.cate == $cate.ename)} selected {/if}>{:cookie('think_lang') == 'en-us' ? $cate.ename : $cate.catename}</option>
{/volist}
</select>
</div> </div>
</div> </div>
<div class="layui-col-md8"> <div class="layui-col-md8">
@ -27,6 +26,10 @@
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="L_title" name="title" required lay-verify="required" autocomplete="off" class="layui-input" style="position:relative;" value=""/> <input type="text" id="L_title" name="title" required lay-verify="required" autocomplete="off" class="layui-input" style="position:relative;" value=""/>
<input type="hidden" id="L_title_color" name="title_color" autocomplete="off" class="layui-input" /> <input type="hidden" id="L_title_color" name="title_color" autocomplete="off" class="layui-input" />
<div class="layui-input bdsug layui-hide">
<ul class="wordlist">
</ul>
</div>
</div> </div>
</div> </div>
<div class="layui-col-md1"> <div class="layui-col-md1">
@ -36,7 +39,7 @@
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<div class="layui-input-block"> <div class="layui-input-block">
<textarea id="L_content" name="content" lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea taonyeditor"> </textarea> <textarea id="L_content" name="content" required lay-verify="" placeholder="{:lang('please input the content')}" class="layui-textarea"> </textarea>
</div> </div>
</div> </div>
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
@ -85,40 +88,38 @@
<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 src="/static/addons/taonyeditor/tinymce/tinymce.min.js"></script>
<script src="/static/xm-select.js"></script>
<script> <script>
layui.use(["form", "colorpicker", "upload",'xmSelect'], function () {
layui.extend({
editor: '{/}/static/addons/taonyeditor/js/taonyeditor'
}).use(["form", "colorpicker", "upload",'editor','xmSelect'], function () {
var $ = layui.jquery, form = layui.form, colorpicker = layui.colorpicker, upload = layui.upload; var $ = layui.jquery, form = layui.form, colorpicker = layui.colorpicker, upload = layui.upload;
var editor = layui.editor;
var xmSelect = layui.xmSelect; var xmSelect = layui.xmSelect;
// 分类选择 editor.render({
$.get("{:url('content.forum/getCateList')}",function(res){ selector: 'textarea#L_content',
// 渲染下拉树 uploadUrl: "{:url('content.forum/uploads')}",
xmSelect.render({ imagePrependUrl: "{$domain}"
el: '#CateId',
name: 'cate_id',
height: '250px',
layVerify: 'required',
layVerType: 'tips',
data: res.data,
initValue: [res.data[0].id],
model: {label: {type: 'text'}},
prop: {
name: 'catename',
value: 'id'
},
radio: true,
clickClose: true,
tree: {
show: true,
indent: 15,
strict: false,
expandedKeys: true
},
tips: '请选择'
});
}); });
//获取百度标签标志tag或者word;
var flag = 'word';
// 从详情页自动调用端口过滤,获取描述信息
tinymce.get('L_content').on('mouseleave', function() {
var content = tinymce.get('L_content').getContent({format: 'text'});
content = content.replace(/[\r\n]/g,"").replace(/\n/g, '').replace(/\s/g, '').replace(/\t/g, '');
if(content.length >200) {
content = content.substring(0,200);
}
// var test = tinymce.activeEditor.getContent({format: 'text'});
$('[name="description"]').val(content);
});
// tag标签 // tag标签
$(function(){ $(function(){
//1.渲染标签 //1.渲染标签
@ -142,17 +143,70 @@
}); });
}) })
// 通过接口自动获取tag的内容
var conf = "{:empty(config('taoler.baidu.client_id'))}";
if (conf !== "1") {
$("#L_title").on("blur", function () {
var title = $(this).val();
var content = $("#L_content").val();
$.ajax({
type: "post",
url: "{:url('content.forum/getKeywords')}",
data: { keywords: title, content:content, flag: flag },
daType: "json",
success: function (data) {
if (data.code === 0) {
$("input[name='keywords']").val(data.data.join(','));
}
},
});
});
}
// 百度词条
var baidu_title_switch = "{:config('taoler.config.baidu_title_switch')}";
if(baidu_title_switch === 1) {
$("#L_title").bind('input propertychange',function () {
var title = $(this).val();
var str = '';
if(title.length > 0 ) {
$.post("{:url('content.forum/getWordList')}",{title:title},function(res){
// 动态生成ur>li内容
if (res.code === 0) {
// 显示动态框
$(".bdsug").removeClass('layui-hide');
for (var i = 0; i < res.data.length; i++) {
//str += '<li data-key=' + res.data[i].q + '><b>' + res.data[i].q.replace(title,'') + '</b></li>';
str += '<li data-key=' + res.data[i].q + '><b>' + res.data[i].q + '</b></li>';
}
// 清空ul并追加li
$('.wordlist').empty().append(str);
// 点击李获取li值并复制给#L_title input的value
$(".bdsug li").on('click',function(){
var word = $(this).attr('data-key');
var words = title + '(' + word + ')';
$("#L_title").val(words);
// 关闭动态框
$(".bdsug").addClass('layui-hide');
});
} else {
$(".bdsug").addClass('layui-hide');
}
});
} else {
$(".bdsug").addClass('layui-hide');
}
});
}
//上传附件 //上传附件
upload.render({ upload.render({
elem: "#zip-button", elem: "#zip-button",
url: "{:url('content.forum/uploads')}", //改成您自己的上传接口 url: "{:url('content.forum/uploads')}", //改成您自己的上传接口
data: { type: "zip" }, data: { type: "zip" },
accept: "file", accept: "file", //普通文件
before: function(obj){
layer.load();
},
done: function (res) { done: function (res) {
layer.closeAll('loading');
if (res.status === 0) { if (res.status === 0) {
$('input[name="upzip"]').val(res.url); $('input[name="upzip"]').val(res.url);
layer.msg("上传成功"); layer.msg("上传成功");
@ -187,8 +241,9 @@
icon: 1, icon: 1,
time: 1000 time: 1000
}, function() { }, function() {
parent.layui.table.reload("forum-table"); parent.layer.close(parent.layer.getFrameIndex(window
parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭当前页 .name)); //关闭当前页
parent.layui.table.reload("user-table");
}); });
} else { } else {
layer.msg(result.msg, { layer.msg(result.msg, {
@ -203,10 +258,5 @@
}); });
</script> </script>
{:hook('taonyeditor')}
{// 百度标题词条}
{:hook('seoBaiduTitle')}
{// 百度关键词}
{:hook('seoBaiduKeywords')}
</body> </body>
</html> </html>

View File

@ -4,12 +4,6 @@
<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" />
<style>
#L_title {position: relative;}
.bdsug {height: auto; position: absolute; left: 0; top: 30px; z-index: 100; background: #fff; border-radius: 0 0 10px 10px; border: 1px solid #dadade!important; border-top: 0!important; box-shadow: none;}
.bdsug ul{display: block;margin: 5px 2px 0; padding: 5px 0 7px; background: 0 0; border-top: 0px solid #f5f5f6;}
.bdsug ul>li{margin-top: 0;height:30px;line-height: 25px;}
</style>
</head> </head>
<body> <body>
<form class="layui-form" action=""> <form class="layui-form" action="">
@ -20,7 +14,12 @@
<div class="layui-col-md3"> <div class="layui-col-md3">
<label class="layui-form-label">{:lang('special column')}</label> <label class="layui-form-label">{:lang('special column')}</label>
<div class="layui-input-block"> <div class="layui-input-block">
<div id="CateId" class="xm-select-demo"></div> <select lay-verify="required" name="cate_id" lay-filter="column">
<option></option>
{volist name="cateList" id="cate"}
<option value="{$cate.id}" {if $article.cate_id == $cate.id} selected {/if}> {:cookie('think_lang') == 'en-us' ? $cate.ename : $cate.catename}</option>
{/volist}
</select>
</div> </div>
</div> </div>
<div class="layui-col-md8"> <div class="layui-col-md8">
@ -38,7 +37,7 @@
</div> </div>
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<div class="layui-input-block"> <div class="layui-input-block">
<textarea id="L_content" name="content" required lay-verify="required" placeholder="详细内容" class="layui-textarea taonyeditor">{$article.content}</textarea> <textarea id="L_content" name="content" required lay-verify="required" placeholder="详细内容" class="layui-textarea">{$article.content}</textarea>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
@ -90,15 +89,27 @@
</form> </form>
<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 src="/static/addons/taonyeditor/tinymce/tinymce.min.js"></script>
<script src="/static/xm-select.js"></script>
<script> <script>
layui.use(['colorpicker','form','upload','xmSelect'], function(){
layui.extend({
editor: '{/}/static/addons/taonyeditor/js/taonyeditor'
}).use(['colorpicker','form','upload', 'editor'], function(){
var $ = layui.jquery var $ = layui.jquery
,colorpicker = layui.colorpicker ,colorpicker = layui.colorpicker
,form = layui.form ,form = layui.form
,upload = layui.upload; ,upload = layui.upload;
var artId = "{$article.id}"; var artId = "{$article.id}";
var xmSelect = layui.xmSelect; var editor = layui.editor;
// 初始化编辑器
editor.render({
selector: 'textarea#L_content',
uploadUrl: "{:url('content.forum/uploads')}",
imagePrependUrl: "{$domain}"
});
$(function(){ $(function(){
//1.渲染标签 //1.渲染标签
@ -130,36 +141,55 @@
}); });
}) })
// 从详情页自动调用端口过滤,获取描述信息
// 分类选择 tinymce.get('L_content').on('mouseleave', function() {
$.get("{:url('content.forum/getCateList')}",function(res){ var content = tinymce.get('L_content').getContent({format: 'text'});
var INITCID = "{$article.cate_id}"; content = content.replace(/[\r\n]/g,"").replace(/\n/g, '').replace(/\s/g, '').replace(/\t/g, '');
// 渲染下拉树 if(content.length >200) {
xmSelect.render({ content = content.substring(0,200);
el: '#CateId', }
name: 'cate_id', // var test = tinymce.activeEditor.getContent({format: 'text'});
height: '250px', $('[name="description"]').val(content);
layVerify: 'required',
layVerType: 'tips',
data: res.data,
initValue: [INITCID],
model: {label: {type: 'text'}},
prop: {
name: 'catename',
value: 'id'
},
radio: true,
clickClose: true,
tree: {
show: true,
indent: 15,
strict: false,
expandedKeys: true
},
tips: '请选择'
});
}); });
// 获取描述的内容
$("#L_content").bind('input propertychange', function(){
var content = $(this).val()
$.ajax({
type:"post",
url:"{:url('content.forum/getDescription')}",
data:{"content":content},
daType:"json",
success:function (data){
if (data.code == 0) {
$('[name="description"]').val(data.data);
}
}
});
return false;
})
// 获取tag的内容
var conf = "{:empty(config('taoler.baidu.client_id'))}";
if(conf !== '1'){
$("#L_title").on('blur', function(){
var title = $(this).val();
var flag = 'on';
$.ajax({
type:"post",
url:"{:url('content.forum/getKeywords')}",
data:{"keywords":keywords,"flag":flag},
daType:"json",
success:function (data){
if (data.code === 0) {
$("input[name='keywords']").val("");
}
}
});
return false;
})
}
//预定义颜色项 //预定义颜色项
colorpicker.render({ colorpicker.render({
elem: '#color' elem: '#color'
@ -178,12 +208,8 @@
elem: '#zip-button' elem: '#zip-button'
,url: "{:url('content.forum/uploads')}" //改成您自己的上传接口 ,url: "{:url('content.forum/uploads')}" //改成您自己的上传接口
,data: {type:'zip'} ,data: {type:'zip'}
,accept: 'file', ,accept: 'file' //普通文件
before: function(obj){ ,done: function(res){
layer.load();
},
done: function(res){
layer.closeAll('loading');
if(res.status === 0){ if(res.status === 0){
$('input[name="upzip"]').val(res.url); $('input[name="upzip"]').val(res.url);
layer.msg('上传成功'); layer.msg('上传成功');
@ -206,8 +232,9 @@
icon: 1, icon: 1,
time: 1000 time: 1000
}, function() { }, function() {
parent.layui.table.reload("forum-table"); parent.layer.close(parent.layer.getFrameIndex(window
parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭当前页 .name)); //关闭当前页
parent.layui.table.reload("user-table");
}); });
} else { } else {
layer.msg(result.msg, { layer.msg(result.msg, {
@ -222,10 +249,5 @@
}); });
</script> </script>
{:hook('taonyeditor')}
{// 百度标题词条}
{:hook('seoBaiduTitle')}
{// 百度关键词}
{:hook('seoBaiduKeywords')}
</body> </body>
</html> </html>

View File

@ -9,32 +9,26 @@
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-body"> <div class="layui-card-body">
<form class="layui-form" action=""> <form class="layui-form" action="">
<div class="layui-row layui-col-space15 "> <div class="layui-form-item">
<div class="layui-col-md3"> <div class="layui-form-item layui-inline">
<label class="layui-form-label">选择类目</label>
<div class="layui-input-block">
<div id="CateId" class="xm-select-demo"></div>
</div>
</div>
<div class="layui-col-md3">
<label class="layui-form-label">帖子ID</label> <label class="layui-form-label">帖子ID</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="id" placeholder="请输入" autocomplete="off" class="layui-input"> <input type="text" name="id" placeholder="请输入" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-col-md3"> <div class="layui-form-item layui-inline">
<label class="layui-form-label">发帖人</label> <label class="layui-form-label">发帖人</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="name" placeholder="请输入" autocomplete="off" class="layui-input"> <input type="text" name="name" placeholder="请输入" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-col-md3"> <div class="layui-form-item layui-inline">
<label class="layui-form-label">标题</label> <label class="layui-form-label">标题</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="title" placeholder="请输入" autocomplete="off" class="layui-input"> <input type="text" name="title" placeholder="请输入" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-col-md3"> <div class="layui-form-item layui-inline">
<label class="layui-form-label">状态</label> <label class="layui-form-label">状态</label>
<div class="layui-input-block"> <div class="layui-input-block">
<select name="sec"> <select name="sec">
@ -48,7 +42,7 @@
</select> </select>
</div> </div>
</div> </div>
<div class="layui-col-md3"> <div class="layui-form-item layui-inline">
<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="forum-query"> <button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="forum-query">
<i class="layui-icon layui-icon-search"></i> <i class="layui-icon layui-icon-search"></i>
查询 查询
@ -106,13 +100,12 @@
<script> <script>
const FORUM_List = "{:url('content.forum/list')}"; const FORUM_List = "{:url('content.forum/list')}";
layui.use(['toast','jquery','form', 'table','common','xmSelect'], function(){ layui.use(['toast','jquery','form', 'table','common'], function(){
var $ = layui.jquery var $ = layui.jquery
,form = layui.form ,form = layui.form
,table = layui.table; ,table = layui.table;
let common = layui.common; let common = layui.common;
var toast = layui.toast; var toast = layui.toast;
var xmSelect = layui.xmSelect;
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。 //如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
var taonystatus = "{:hook('taonystatus')}"; var taonystatus = "{:hook('taonystatus')}";
@ -127,7 +120,6 @@
,{field: 'avatar', title: '头像', width: 60, templet: '#avatarTpl'} ,{field: 'avatar', title: '头像', width: 60, templet: '#avatarTpl'}
,{field: 'poster', title: '账号',width: 80} ,{field: 'poster', title: '账号',width: 80}
,{field: 'title', title: '标题', minWidth: 180,templet: '<div><a href="{{- d.url }}" target="_blank">{{- d.title }}</a></div>'} ,{field: 'title', title: '标题', minWidth: 180,templet: '<div><a href="{{- d.url }}" target="_blank">{{- d.title }}</a></div>'}
,{field: 'cate', title: '类别', width: 120}
,{field: 'content', title: '内容', 'escape':false, minWidth: 200} ,{field: 'content', title: '内容', 'escape':false, minWidth: 200}
,{field: 'posttime', title: '时间',width: 120, sort: true} ,{field: 'posttime', title: '时间',width: 120, sort: true}
,{field: 'top', title: '置顶', templet: '#forum-istop', width: 80, align: 'center'} ,{field: 'top', title: '置顶', templet: '#forum-istop', width: 80, align: 'center'}
@ -152,38 +144,6 @@
}, 'filter', 'print', 'exports'] }, 'filter', 'print', 'exports']
}); });
// 动态分类
function getSelectCate() {
// 分类选择
$.get("{:url('content.forum/getCateList')}", function(res){
// 渲染下拉树
xmSelect.render({
el: '#CateId',
name: 'cate_id',
height: '250px',
layVerify: '',
layVerType: 'tips',
data: res.data,
initValue: [],
model: {label: {type: 'text'}},
prop: {
name: 'catename',
value: 'id'
},
radio: true,
clickClose: true,
tree: {
show: true,
indent: 15,
strict: false,
expandedKeys: true
},
tips: '请选择'
});
});
}
getSelectCate();
table.on('tool(forum-table)', function(obj) { table.on('tool(forum-table)', function(obj) {
if (obj.event === 'remove') { if (obj.event === 'remove') {
window.remove(obj); window.remove(obj);
@ -204,10 +164,7 @@
form.on('submit(forum-query)', function(data) { form.on('submit(forum-query)', function(data) {
table.reload('forum-table', { table.reload('forum-table', {
where: data.field, where: data.field
page: {
curr: 1 //重新从第 1 页开始
}
}) })
return false; return false;
}); });
@ -281,7 +238,7 @@
window.remove = function(obj) { window.remove = function(obj) {
layer.confirm('确定要删除?', { layer.confirm('确定要删除该用户', {
icon: 3, icon: 3,
title: '提示' title: '提示'
}, function(index) { }, function(index) {
@ -312,7 +269,9 @@
} }
window.batchRemove = function(obj) { window.batchRemove = function(obj) {
var checkIds = common.checkField(obj,'id'); var checkIds = common.checkField(obj,'id');
if (checkIds === "") { if (checkIds === "") {
layer.msg("未选中数据", { layer.msg("未选中数据", {
icon: 3, icon: 3,
@ -321,25 +280,25 @@
return false; return false;
} }
layer.confirm('确定要删除?', { layer.confirm('确定要删除这些用户', {
icon: 3, icon: 3,
title: '提示' title: '提示'
}, function(index) { }, function(index) {
layer.close(index); layer.close(index);
let loading = layer.load(); let loading = layer.load();
$.ajax({ $.ajax({
url: "{:url('content.forum/delete')}?id=" + checkIds, url: "{:url('system.admin/delete')}",
dataType: 'json', dataType: 'json',
type: 'delete', type: 'delete',
data:{"id":checkIds}, data:{"id":checkIds},
success: function(result) { success: function(result) {
layer.close(loading); layer.close(loading);
if (result.code === 0) { if (result.success) {
layer.msg(result.msg, { layer.msg(result.msg, {
icon: 1, icon: 1,
time: 1000 time: 1000
}, function() { }, function() {
table.reload('forum-table'); table.reload('user-table');
}); });
} else { } else {
layer.msg(result.msg, { layer.msg(result.msg, {
@ -353,7 +312,7 @@
} }
window.refresh = function(param) { window.refresh = function(param) {
table.reload('forum-table'); table.reload('user-table');
} }
}); });

View File

@ -82,8 +82,8 @@
table.reload('tag-link', { table.reload('tag-link', {
where: {tag: data.value} where: {tag: data.value}
,page: { ,page: {
curr: 1 //重新从第 1 页开始 curr: 1 //重新从第 1 页开始
} }
}); });
}); });

File diff suppressed because it is too large Load Diff

View File

@ -108,7 +108,7 @@
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6"> <div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
<div class="pear-card2"> <div class="pear-card2">
<div class="title">待审文章</div> <div class="title">待审文章</div>
<div class="count pear-text">0</div> <div class="count pear-text">14</div>
</div> </div>
</div> </div>
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6"> <div class="layui-col-md6 layui-col-sm6 layui-col-xs6">

View File

@ -98,13 +98,13 @@
<li class="layui-col-xs6"> <li class="layui-col-xs6">
<a lay-href="javascript:;" class="layadmin-backlog-body"> <a lay-href="javascript:;" class="layadmin-backlog-body">
<h3>待审商品</h3> <h3>待审商品</h3>
<p><cite>0</cite></p> <p><cite>99</cite></p>
</a> </a>
</li> </li>
<li class="layui-col-xs6"> <li class="layui-col-xs6">
<a href="javascript:;" onclick="layer.tips('不跳转', this, {tips: 3});" class="layadmin-backlog-body"> <a href="javascript:;" onclick="layer.tips('不跳转', this, {tips: 3});" class="layadmin-backlog-body">
<h3>待发货</h3> <h3>待发货</h3>
<p><cite>0</cite></p> <p><cite>20</cite></p>
</a> </a>
</li> </li>
</ul> </ul>

View File

@ -243,18 +243,11 @@
</div> </div>
<hr> <hr>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">菜单位置</label> <label class="layui-form-label">百度词条</label>
<div class="layui-input-inline" style="width: 60px;"> <div class="layui-input-inline" style="width: 60px;">
<input type="checkbox" name="nav_top" lay-skin="switch" lay-text="顶部|子栏" value=1 {if config('taoler.config.nav_top') == 1} checked {/if}> <input type="checkbox" name="baidu_title_switch" lay-skin="switch" lay-text="开启|关闭" value=1 {if config('taoler.config.baidu_title_switch') == 1} checked {/if}>
</div> </div>
<div class="layui-form-mid layui-word-aux">导航菜单在顶部或第二栏显示</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" style="width: 60px;">
<input type="checkbox" name="top_show" lay-skin="switch" lay-text="列表|滚动" value=1 {if config('taoler.config.top_show') == 1} checked {/if}>
</div>
<div class="layui-form-mid layui-word-aux">置顶帖子列表或滚动显示</div>
</div> </div>
<hr> <hr>
{if hook('mailserveractivehook')} {if hook('mailserveractivehook')}
@ -419,6 +412,8 @@
} }
}); });
// 获取描述的内容 // 获取描述的内容
$("input[name='article_as']").bind('input propertychange', function(){ $("input[name='article_as']").bind('input propertychange', function(){
var content = $(this).val() var content = $(this).val()

View File

@ -12,13 +12,15 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">账号</label> <label class="layui-form-label">账号</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="请输入用户名" class="layui-input"> <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="请输入标题"
class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">邮箱</label> <label class="layui-form-label">邮箱</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="email" lay-verify="email" autocomplete="off" placeholder="请输入邮箱" class="layui-input"> <input type="text" name="email" lay-verify="email" autocomplete="off" placeholder="请输入邮箱"
class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
@ -31,13 +33,15 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">密码</label> <label class="layui-form-label">密码</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="password" lay-verify="password" autocomplete="off" placeholder="请输入密码" class="layui-input"> <input type="text" name="password" lay-verify="password" autocomplete="off" placeholder="请输入密码"
class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">电话</label> <label class="layui-form-label">电话</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="phone" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input"> <input type="text" name="phone" lay-verify="title" autocomplete="off" placeholder="请输入标题"
class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
@ -51,7 +55,8 @@
</div> </div>
<div class="bottom"> <div class="bottom">
<div class="button-container"> <div class="button-container">
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="user-save"> <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
lay-filter="user-save">
<i class="layui-icon layui-icon-ok"></i> <i class="layui-icon layui-icon-ok"></i>
提交 提交
</button> </button>
@ -85,8 +90,8 @@
icon: 1, icon: 1,
time: 1000 time: 1000
}, function() { }, function() {
parent.layui.table.reload("user-table");
parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭当前页 parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭当前页
parent.layui.table.reload("user-table");
}); });
} else { } else {
layer.msg(result.msg, { layer.msg(result.msg, {

View File

@ -76,7 +76,6 @@
layui.use(['form', 'jquery'], function() { layui.use(['form', 'jquery'], function() {
let form = layui.form; let form = layui.form;
let $ = layui.jquery; let $ = layui.jquery;
let upload = layui.upload;
form.on('submit(user-save)', function(data) { form.on('submit(user-save)', function(data) {
$.ajax({ $.ajax({
@ -91,8 +90,8 @@
icon: 1, icon: 1,
time: 1000 time: 1000
}, function() { }, function() {
parent.layui.table.reload("user-table");
parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭当前页 parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭当前页
parent.layui.table.reload("user-table");
}); });
} else { } else {
layer.msg(result.msg, { layer.msg(result.msg, {
@ -104,33 +103,6 @@
}) })
return false; return false;
}); });
//上传头像
upload.render({
elem: '#layuiadmin-upload-useradmin'
,url: "{:url('user.user/uploadImg')}"
,data: {type:'image'}
,accept: 'images'
,method: 'get'
,acceptMime: 'image/*'
,done: function(res){
$(this.item).prev("div").children("input").val(res.src);
if(res.code === 0){
layer.msg(res.msg,{
icon:6,
tiye:2000
});
} else {
layer.open({
title:"上传失败",
content:res.msg,
icon:5,
anim:6
});
}
}
});
}) })
</script> </script>
<script> <script>

View File

@ -13,13 +13,13 @@
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<label class="layui-form-label">ID</label> <label class="layui-form-label">ID</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="id" placeholder="请输入ID号" autocomplete="off" class="layui-input"> <input type="text" name="id" placeholder="请输入" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<label class="layui-form-label">用户</label> <label class="layui-form-label">用户</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" name="name" placeholder="用户名" class="layui-input"> <input type="text" name="name" placeholder="" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
@ -35,7 +35,7 @@
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<label class="layui-form-label">邮箱</label> <label class="layui-form-label">邮箱</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" name="email" placeholder="邮箱" class="layui-input"> <input type="text" name="email" placeholder="" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
@ -100,9 +100,9 @@
</script> </script>
<script type="text/html" id="user-sex"> <script type="text/html" id="user-sex">
{{#if (d.sex == 0) { }} {{#if (d.sex == 1) { }}
<span></span> <span></span>
{{# }else if(d.sex == 1){ }} {{# }else if(d.sex == 2){ }}
<span></span> <span></span>
{{# } }} {{# } }}
</script> </script>
@ -148,7 +148,7 @@
templet: '#imgTpl' templet: '#imgTpl'
}, },
{ {
title: '用户', title: '账号',
field: 'username', field: 'username',
align: 'center', align: 'center',
width: 100 width: 100
@ -191,7 +191,7 @@
align: 'center' align: 'center'
}, },
{ {
title: '状态', title: '启用',
field: 'check', field: 'check',
align: 'center', align: 'center',
width: 95, width: 95,
@ -212,7 +212,8 @@
{ {
title: '注册', title: '注册',
field: 'jointime', field: 'jointime',
align: 'center' align: 'center',
templet: '#user-createTime'
}, },
{ {
title: '操作', title: '操作',

View File

@ -79,14 +79,12 @@ if(!function_exists('getUserImg'))
function getArtContent($content) function getArtContent($content)
{ {
//过滤html标签 //过滤html标签
// $content = strip_tags($content); $content = strip_tags($content);
// 去除所有& nbsp和html标签
$content = preg_replace("/(\s|\&nbsp\;|\&ldquo\;|\&rdquo\;| |\xc2\xa0)/", "", strip_tags($content));
// 过滤音视频图片 // 过滤音视频图片
$content = preg_replace('/(?:img|audio|video)(\(\S+\))?\[\S+\]/','',$content); $content = preg_replace('/(?:img|audio|video)(\(\S+\))?\[\S+\]/','',$content);
$content = preg_replace('/\s*/','',$content); $content = preg_replace('/\s*/','',$content);
$content = preg_replace('/\[[^\]]+\]/','',$content); $content = preg_replace('/\[[^\]]+\]/','',$content);
return mb_substr($content,0,150).'...'; return mb_substr(strip_tags($content),0,150).'...';
} }
//根据帖子收藏主键ID查询帖子名称 //根据帖子收藏主键ID查询帖子名称
@ -253,66 +251,42 @@ function getSpaceNmu($level)
return str_repeat('---',$level); return str_repeat('---',$level);
} }
//链接投放开关,有设置则打开
function showSlider($type)
{
$sliders = new \app\common\model\Slider();
$sliderArr = $sliders->getSliderList($type);
if(!empty($sliderArr)) {
return true;
} else {
return false;
}
}
//提取内容第一张图片 //提取内容第一张图片
function getOnepic($str) function getOnepic($str)
{ {
//匹配格式为 <img src="http://img.com" /> //匹配格式为 <img src="http://img.com" />
$pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/"; $pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
preg_match($pattern,$str,$matchContent); preg_match_all($pattern,$str,$matchContent);
if(isset($matchContent[1])){ if(isset($matchContent[1][0])){
$img = $matchContent[1]; $img = $matchContent[1][0];
} else { } else {
//$temp="./images/no-image.jpg";//在相应位置放置一张命名为no-image的jpg图片 //$temp="./images/no-image.jpg";//在相应位置放置一张命名为no-image的jpg图片
//匹配格式为 img[/storage/1/article_pic/20220428/6c2647d24d5ca2c179e4a5b76990c00c.jpg] //匹配格式为 img[/storage/1/article_pic/20220428/6c2647d24d5ca2c179e4a5b76990c00c.jpg]
$pattern = "/(?<=img\[)[^\]]*(?=\])/"; $pattern = "/(?<=img\[)[^\]]*(?=\])/";
preg_match($pattern,$str,$matchContent); preg_match($pattern,$str,$matchContent);
if(isset($matchContent[0])){
if(isset($matchContent[0])){ $img = $matchContent[0];
$img = $matchContent[0]; }else{
}else{ return false;
return false; }
} }
}
return $img; return $img;
} }
if (!function_exists('get_all_img')) {
/**
* 提取字符串中所有图片
* @param $str
* @return array
*/
function get_all_img($str)
{
//匹配格式为 <img src="http://img.com" />的图片
$pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
preg_match_all($pattern, $str,$matchContent);
if(isset($matchContent[1][0])) {
return array_unique($matchContent[1]);
}
return [];
}
}
if (!function_exists('get_all_video')) {
/**
* 提取字符串中所有图片
* @param $str
* @return array
*/
function get_all_video($str)
{
//匹配格式为 <video src="http://img.com" > </video> 的视频
$pattern = "/<[video|VIDEO][\s\S]*src=[\'|\"](.*?(?:[\.mp4|\.mkv|\.flv|\.avi]))[\'|\"].*?[<\/video]>/";
preg_match_all($pattern, $str,$matchs);
if(isset($matchs[1][0])) {
return array_unique($matchs[1]);
}
return [];
}
}
//判断蜘蛛函数 //判断蜘蛛函数
function find_spider(){ function find_spider(){
$useragent = strtolower(empty($useragent) ? Request::header('USER_AGENT') : ''); $useragent = strtolower(empty($useragent) ? Request::header('USER_AGENT') : '');

View File

@ -17,7 +17,9 @@ use think\facade\View;
use think\facade\Db; use think\facade\Db;
use think\facade\Session; use think\facade\Session;
use think\facade\Cache; use think\facade\Cache;
use app\facade\Article;
use app\BaseController as BaseCtrl; use app\BaseController as BaseCtrl;
use app\common\model\Cate;
/** /**
* 控制器基础类 * 控制器基础类
@ -38,6 +40,8 @@ class BaseController extends BaseCtrl
//变量赋给模板 //变量赋给模板
View::assign([ View::assign([
//显示分类导航
'cateList' => $this->showNav(),
//显示子分类导航 //显示子分类导航
'subcatelist' => $this->showSubnav(), 'subcatelist' => $this->showSubnav(),
//当前登录用户 //当前登录用户
@ -62,14 +66,28 @@ class BaseController extends BaseCtrl
} }
} }
// 显示导航nav
protected function showNav()
{
//1.查询分类表获取所有分类
$cate = new Cate();
$cateList = $cate->menu();
$list = getTree($cateList);
// 排序
$cmf_arr = array_column($list, 'sort');
array_multisort($cmf_arr, SORT_ASC, $list);
return $list;
}
// 显示子导航subnav // 显示子导航subnav
protected function showSubnav() protected function showSubnav()
{ {
// dump($this->showNav());
//1.查询父分类id //1.查询父分类id
$pCate = Db::name('cate')->field('id,pid,ename,catename,is_hot')->where(['ename'=>input('ename'),'status'=>1,'delete_time'=>0])->find(); $pCate = Db::name('cate')->field('id,pid,ename,catename,is_hot')->where(['ename'=>input('ename'),'status'=>1,'delete_time'=>0])->find();
if(empty($pCate)) { // 没有点击任何分类,点击首页获取全部分类信息 if(empty($pCate)) { // 没有点击任何分类,点击首页获取全部分类信息
$subCateList = []; $subCateList = $this->showNav();
} else { // 点击分类,获取子分类信息 } else { // 点击分类,获取子分类信息
$parentId = $pCate['id']; $parentId = $pCate['id'];
$subCate = Db::name('cate')->field('id,ename,catename,is_hot,pid')->where(['pid'=>$parentId,'status'=>1,'delete_time'=>0])->select()->toArray(); $subCate = Db::name('cate')->field('id,ename,catename,is_hot,pid')->where(['pid'=>$parentId,'status'=>1,'delete_time'=>0])->select()->toArray();
@ -128,11 +146,21 @@ class BaseController extends BaseCtrl
{ {
//1.查询分类表获取所有分类 //1.查询分类表获取所有分类
$sysInfo = $this->getSystem(); $sysInfo = $this->getSystem();
$slider = new \app\common\model\Slider();
//头部链接
$head_links = $slider->getSliderList(10);
//页脚链接
$foot_links = $slider->getSliderList(11);
//友情链接
$friend_links = $slider->getSliderList(9);
//获取热门标签 //获取热门标签
$hotTag = $this->getHotTag(); $hotTag = $this->getHotTag();
$assign = [ $assign = [
'sysInfo' => $sysInfo, 'sysInfo' => $sysInfo,
'headlinks' => $head_links,
'footlinks' => $foot_links,
'flinks' => $friend_links,
'hotTag' => $hotTag, 'hotTag' => $hotTag,
'host' => Request::domain() . '/' 'host' => Request::domain() . '/'
]; ];

View File

@ -68,18 +68,9 @@ class Arts
*/ */
public function setKeywords(string $flag,string $title,string $content) :array public function setKeywords(string $flag,string $title,string $content) :array
{ {
// 获取seo插件配置
$conf = get_addons_config('seo');
$keywords = []; $keywords = [];
// seo插件配置
$addon = get_addons_instance('seo');
$config = $addon->getConfig();
$seo_token = $config['baidufenci']['access_token'];
// 百度分词自动生成关键词 // 百度分词自动生成关键词
if(!empty($seo_token)) { if(!empty(config('taoler.baidu.client_id'))) {
//headers数组内的格式 //headers数组内的格式
$headers = []; $headers = [];
$headers[] = "Content-Type:application/json"; $headers[] = "Content-Type:application/json";
@ -87,16 +78,16 @@ class Arts
switch($flag) { switch($flag) {
//分词 //分词
case 'word': case 'word':
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/lexer?charset=UTF-8&access_token='.$seo_token; $url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/lexer?charset=UTF-8&access_token='.config('taoler.baidu.access_token');
$body = ["text" => $title]; $body = ["text" => $title];
break; break;
//标签 //标签
case 'tag': case 'tag':
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/keyword?charset=UTF-8&access_token='.$seo_token; $url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/keyword?charset=UTF-8&access_token='.config('taoler.baidu.access_token');
$body = ['title' => $title, 'content' => $content]; $body = ['title' => $title, 'content' => $content];
break; break;
default: default:
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/lexer?charset=UTF-8&access_token='.$seo_token; $url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/lexer?charset=UTF-8&access_token='.config('taoler.baidu.access_token');
$body = ["text" => $title]; $body = ["text" => $title];
} }
@ -140,9 +131,9 @@ class Arts
} else { } else {
// 接口正常但获取数据失败可能参数错误重新获取token // 接口正常但获取数据失败可能参数错误重新获取token
$url = 'https://aip.baidubce.com/oauth/2.0/token'; $url = 'https://aip.baidubce.com/oauth/2.0/token';
$post_data['grant_type'] = $config['baidufenci']['grant_type'];; $post_data['grant_type'] = config('taoler.baidu.grant_type');;
$post_data['client_id'] = $config['baidufenci']['client_id']; $post_data['client_id'] = config('taoler.baidu.client_id');
$post_data['client_secret'] = $config['baidufenci']['client_secret']; $post_data['client_secret'] = config('taoler.baidu.client_secret');
$o = ""; $o = "";
foreach ( $post_data as $k => $v ) foreach ( $post_data as $k => $v )
@ -151,11 +142,12 @@ class Arts
} }
$post_data = substr($o,0,-1); $post_data = substr($o,0,-1);
$res = $this->request_post($url, $post_data); $res = $this->request_post($url, $post_data);
// 写入token
// 保存token SetArr::name('taoler')->edit([
$conf['baidufenci']['value']['access_token'] = json_decode($res)->access_token; 'baidu'=> [
set_addons_config('seo', $conf); 'access_token' => json_decode($res)->access_token,
]
]);
echo 'api接口数据错误 - '; echo 'api接口数据错误 - ';
echo $dataItem->error_msg; echo $dataItem->error_msg;
} }
@ -218,11 +210,8 @@ class Arts
*/ */
public function baiduPushUrl(string $link) public function baiduPushUrl(string $link)
{ {
// seo插件配置
$addon = get_addons_instance('seo');
$config = $addon->getConfig();
// baidu 接口 // baidu 接口
$api = $config['baidupush']['push_api']; $api = config('taoler.baidu.push_api');
if(!empty($api)) { if(!empty($api)) {
$url[] = $link; $url[] = $link;
$ch = curl_init(); $ch = curl_init();

View File

@ -4,7 +4,6 @@ declare (strict_types = 1);
namespace app\common\lib; namespace app\common\lib;
use think\facade\Lang; use think\facade\Lang;
use think\Response;
class Msgres class Msgres
{ {
@ -67,13 +66,13 @@ class Msgres
} }
/** /**
* 成功提示
* @param string $strMsg * @param string $strMsg
* @param string|null $url * @param string|null $url
* @param array|$data * @param string $data
* @return Response * @return string|\think\response\Json
*/ */
public static function success(string $strMsg = '',string $url = null, array $data = []): Response public static function success(string $strMsg = '',string $url = null, $data = '') {
{
$result = [ $result = [
'code' => self::getCode('success'), 'code' => self::getCode('success'),
'msg' => self::getMsg($strMsg), 'msg' => self::getMsg($strMsg),

View File

@ -93,7 +93,7 @@ class Uploads
} }
// 解析存储位置 SYS_开头为系统位置 // 解析存储位置 SYS_开头为系统位置
$isSys = stripos($dirName, 'SYS_'); $isSys = stripos($dirName, 'SYS_');
if($isSys) { if($isSys !== false) {
$disk = 'sys'; $disk = 'sys';
$dirName = substr($dirName,4); $dirName = substr($dirName,4);
$uploadDir = Config::get('filesystem.disks.sys.url'); $uploadDir = Config::get('filesystem.disks.sys.url');
@ -105,7 +105,7 @@ class Uploads
$rules = ['md5','date','sha1','uniqid']; $rules = ['md5','date','sha1','uniqid'];
// 解析是否自定义文件名 // 解析是否自定义文件名
if(!in_array($rule, $rules) && !is_null($rule)) { if(!in_array($rule, $rules) && !is_null($rule)) {
if(!stripos($rule, '.')) { if(stripos($rule, '.') == false) {
$rule = $file->getOriginalName(); $rule = $file->getOriginalName();
} }
$savename = Filesystem::disk($disk)->putFileAs($dirName, $file, $rule); $savename = Filesystem::disk($disk)->putFileAs($dirName, $file, $rule);
@ -160,7 +160,7 @@ class Uploads
// 解析存储位置 SYS_开头为系统位置 // 解析存储位置 SYS_开头为系统位置
$isSys = stripos($dirName, 'SYS_'); $isSys = stripos($dirName, 'SYS_');
if($isSys) { if($isSys !== false) {
$disk = 'sys'; $disk = 'sys';
$dirName = substr($dirName,4); $dirName = substr($dirName,4);
$uploadDir = Config::get('filesystem.disks.sys.url'); $uploadDir = Config::get('filesystem.disks.sys.url');

View File

@ -111,7 +111,7 @@ class Article extends Model
{ {
return Cache::remember('topArticle', function() use($num){ return Cache::remember('topArticle', function() use($num){
return $this::field('id,title,title_color,cate_id,user_id,content,create_time,is_top,pv,upzip,has_img,has_video,has_audio,read_type,art_pass') return $this::field('id,title,title_color,cate_id,user_id,create_time,is_top,pv,upzip,has_img,has_video,has_audio')
->where([['is_top', '=', 1], ['status', '=', 1]]) ->where([['is_top', '=', 1], ['status', '=', 1]])
->with([ ->with([
'cate' => function ($query) { 'cate' => function ($query) {
@ -140,7 +140,7 @@ class Article extends Model
public function getArtList(int $num) public function getArtList(int $num)
{ {
return Cache::remember('indexArticle', function() use($num){ return Cache::remember('indexArticle', function() use($num){
return $this::field('id,title,title_color,cate_id,user_id,content,create_time,is_hot,pv,jie,upzip,has_img,has_video,has_audio,read_type,art_pass') return $this::field('id,title,title_color,cate_id,user_id,create_time,is_hot,pv,jie,upzip,has_img,has_video,has_audio,read_type')
->with([ ->with([
'cate' => function($query){ 'cate' => function($query){
$query->where('delete_time',0)->field('id,catename,ename,detpl'); $query->where('delete_time',0)->field('id,catename,ename,detpl');
@ -247,7 +247,7 @@ class Article extends Model
$where[] = ['status', '=', 1]; $where[] = ['status', '=', 1];
return Cache::remember('cate_list_'.$ename.$type.$page, function() use($where,$page){ return Cache::remember('cate_list_'.$ename.$type.$page, function() use($where,$page){
return $this::field('id,cate_id,user_id,title,content,title_color,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio,read_type,art_pass') return $this::field('id,cate_id,user_id,title,content,title_color,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio,read_type')
->with([ ->with([
'cate' => function($query) { 'cate' => function($query) {
$query->field('id,catename,ename'); $query->field('id,catename,ename');
@ -383,17 +383,14 @@ class Article extends Model
// 获取所有帖子内容 // 获取所有帖子内容
public function getList(array $where, int $limit, int $page) public function getList(array $where, int $limit, int $page)
{ {
return $this::field('id,user_id,cate_id,title,content,is_top,is_hot,is_reply,status,update_time,read_type,art_pass') return $this::field('id,user_id,cate_id,title,content,is_top,is_hot,is_reply,status,update_time')->with([
->with([
'user' => function($query){ 'user' => function($query){
$query->field('id,name,user_img'); $query->field('id,name,user_img');
}, },
'cate' => function($query){ 'cate' => function($query){
$query->field('id,ename,catename'); $query->field('id,ename');
} }
]) ])->where($where)
->where(['status' => 1])
->where($where)
->order('create_time', 'desc') ->order('create_time', 'desc')
->paginate([ ->paginate([
'list_rows' => $limit, 'list_rows' => $limit,
@ -411,15 +408,5 @@ class Article extends Model
return (string) url('article_detail',['id' => $data['id']]); return (string) url('article_detail',['id' => $data['id']]);
} }
// 内容是否加密
public function getContentAttr($value, $data)
{
//解密
if($data['read_type'] == 1 && (session('art_pass_'.$data['id']) !== $data['art_pass'])) {
return '内容已加密!请输入正确密码查看!';
}
return $value;
}
} }

View File

@ -46,12 +46,6 @@ class Cate extends Model
return $this->field('ename,catename')->where('pid', $this::where('ename', $ename)->value('id'))->select(); return $this->field('ename,catename')->where('pid', $this::where('ename', $ename)->value('id'))->select();
} }
// 查询兄弟分类
public function getBrotherCate(string $ename)
{
return $this->field('id,ename,catename')->where('pid', $this::where('ename', $ename)->value('pid'))->append(['url'])->order('sort asc')->select();
}
/** /**
* 删除分类 * 删除分类
* @param $id * @param $id
@ -99,24 +93,6 @@ class Cate extends Model
} }
// 分类导航菜单
public function getNav()
{
try {
$cateList = $this->where(['status' => 1])
->cache('catename', 3600)
->append(['url'])
->select()
->toArray();
// 排序
$cmf_arr = array_column($cateList, 'sort');
array_multisort($cmf_arr, SORT_ASC, $cateList);
return getTree($cateList);
} catch (DbException $e) {
return $e->getMessage();
}
}
// 获取url // 获取url
public function getUrlAttr($value,$data) public function getUrlAttr($value,$data)
{ {

View File

@ -35,36 +35,12 @@ class Comment extends Model
//获取评论 //获取评论
public function getComment($id, $page) public function getComment($id, $page)
{ {
$comment = $this::withTrashed()->with(['user'=>function($query){ return $this::with(['user'])
$query->field('id,name,user_img,sign,city,vip');
}])
->where(['article_id'=>(int)$id,'status'=>1]) ->where(['article_id'=>(int)$id,'status'=>1])
->order(['cai'=>'asc','create_time'=>'asc']) ->order(['cai'=>'asc','create_time'=>'asc'])
// ->paginate(['list_rows'=>10, 'page'=>$page]) ->paginate(['list_rows'=>10, 'page'=>$page])
->append(['touser'])
->select()
->toArray(); ->toArray();
foreach ($comment as $k => $v)
{
if(empty($v['content'])){
unset($comment[$k]);
}
}
if(count($comment)) {
$data['data'] = getTree($comment);
$data['total'] = count($data['data']);
$arr = array_chunk($data['data'], 10);
//当前页
$page = $page - 1;
return ['total' => $data['total'], 'data' => $arr[$page]];
} else {
return ['total' => 0, 'data' => ''];
}
} }
//回帖榜 //回帖榜
@ -180,35 +156,4 @@ class Comment extends Model
} }
} }
// 获取to_user_id
public function getTouserAttr($value,$data)
{
if(isset($data['to_user_id'])) {
return User::where('id', $data['to_user_id'])->value('name');
}
return '';
}
/**
* 评论没有被删除正常显示
* 评论被删除,但它下面有跟评时自身会显示为“评论已删除”,跟评会显示,无跟评且已删除则不显示
* @param $value
* @param $data
* @return string
*/
public function getContentAttr($value,$data)
{
if($data['delete_time'] == 0) {
return $value;
} else {
if($this::getByPid($data['id'])) {
return '<span style="text-decoration:line-through;">评论已删除</span>';
} else {
return '';
}
}
}
} }

View File

@ -51,9 +51,9 @@ class User extends Model
public function login($data) public function login($data)
{ {
//查询使用邮箱或者用户名登陆 //查询使用邮箱或者用户名登陆
$user = $this::whereOr('phone',$data['name'])->whereOr('email',$data['name'])->whereOr('name',$data['name'])->findOrEmpty(); $user = $this::whereOr('email',$data['name'])->whereOr('name',$data['name'])->findOrEmpty();
if(!$user->isEmpty()){ if(!($user->isEmpty())){
//被禁用和待审核 //被禁用和待审核
if($user['status'] == -1){ if($user['status'] == -1){
return Lang::get('Account disabled'); return Lang::get('Account disabled');

View File

@ -11,27 +11,34 @@
namespace app\common\model; namespace app\common\model;
use think\Model; use think\Model;
//use think\model\concern\SoftDelete;
class UserZan extends Model class UserZan extends Model
{ {
protected $autoWriteTimestamp = true; //开启自动时间戳 protected $autoWriteTimestamp = true; //开启自动时间戳
protected $createTime = 'create_time'; protected $createTime = 'create_time';
//软删除
//use SoftDelete;
//protected $deleteTime = 'delete_time';
//protected $defaultSoftDelete = 0;
public function comment() public function comment()
{ {
//关联评论 //评论关联文章
return $this->belongsTo('Comment','comment_id','id'); return $this->belongsTo('Comment','comment_id','id');
} }
public function user() public function user()
{ {
//关联用户 //评论关联用户
return $this->belongsTo('User','user_id','id'); return $this->belongsTo('User','user_id','id');
} }
public function article() public function article()
{ {
//关联文章 //评论关联用户
return $this->belongsTo(Article::class); return $this->belongsTo(Article::class);
} }

View File

@ -8,11 +8,12 @@
* @FilePath: \TaoLer\app\common\taglib\Article.php * @FilePath: \TaoLer\app\common\taglib\Article.php
* Copyright (c) 2020~2022 https://www.aieok.com All rights reserved. * Copyright (c) 2020~2022 https://www.aieok.com All rights reserved.
*/ */
declare (strict_types = 1); //declare (strict_types = 1);
namespace app\common\taglib; namespace app\common\taglib;
use think\template\TagLib; use think\template\TagLib;
use app\common\model\Article as ArticleModel;
class Article extends TagLib class Article extends TagLib
{ {
@ -20,149 +21,71 @@ class Article extends TagLib
protected $tags = [ protected $tags = [
// 标签定义: attr 属性列表 close 是否闭合0 或者1 默认1 alias 标签别名 level 嵌套层次 // 标签定义: attr 属性列表 close 是否闭合0 或者1 默认1 alias 标签别名 level 嵌套层次
'id' => ['attr' => '', 'close' => 0], 'id' => ['attr' => '', 'close' => 0],
'title' => ['attr' => '', 'close' => 0], 'title' => ['attr' => 'cid', 'close' => 0],
'content' => ['attr' => '', 'close' => 0], 'content' => ['attr' => 'name', 'close' => 0],
'auther' => ['attr' => '', 'close' => 0],
'pv' => ['attr' => '', 'close' => 0],
'title_color' => ['attr' => '', 'close' => 0],
'comment_num' => ['attr' => '', 'close' => 0],
'keywords' => ['attr' => '', 'close' => 0],
'description' => ['attr' => '', 'close' => 0],
'link' => ['attr' => '', 'close' => 0],
'time' => ['attr' => '', 'close' => 0],
'cate' => ['attr' => 'name', 'close' => 0],
'user' => ['attr' => 'name', 'close' => 0],
'list' => ['attr' => '', 'close' => 1],
'comment' => ['attr' => '', 'close' => 1],
'istop' => ['attr' => '', 'close' => 0], 'istop' => ['attr' => '', 'close' => 0],
'aname' => ['attr' => 'name', 'close' => 0],
'detail' => ['attr' => 'name', 'close' => 0], 'commentnum' => ['attr' => 'name', 'close' => 0],
// 'detail' => ['attr' => '', 'close' => 0], 'comment' => ['attr' => '', 'close' => 1],
]; ];
// id // public function __construct($a)
public function tagId(): string // {
// $id = (int) input('id');
// $this->id = $id;
// $page = input('page') ? (int) input('page') : 1;
// //parent::__construct();
// if(request()->action() == 'detail') {
// $article = new ArticleModel();
// $this->article = $article->getArtDetail($id);
// // dump($this->article);
// }
// }
public function tagId($tag): string
{ {
return '{$article.id}'; //dump($tag);
$parseStr = $this->article;
//return $parseStr;
return '<?php echo "' . $parseStr['id'] . '"; ?>';
} }
public function tagTitle(): string public function tagTitle(array $tag, string $content): string
{ {
return '{$article.title}'; $cid = (int) $this->tpl->get('cid');
$article = new ArticleModel();
$art = $article->getArtDetail($cid);
//dump($art);
$parseStr = $art['title'];
//$parseStr = 123;
//return $parseStr;
return '<?php echo "' . $parseStr . '"; ?>';
} }
public function tagContent(): string public function tagContent($tag): string
{ {
return '{$article.content|raw}'; $parseStr = $this->article['content'];
//return $parseStr;
return '<?php echo "' . $parseStr . '"; ?>';
} }
public function tagAuther(): string public function tagAname($tag): string
{ {
return '{$article.user.nickname ?: $article.user.name}'; $parseStr = $this->article['user']['nickname'] ?: $this->article['user']['name'];
} // dump($parseStr);
public function tagPv()
{
return '{$article.pv}';
}
public function tagComment_num(): string
{
return '{$article.comments_count}';
}
public function tagTitle_color(): string
{
return '{$article.title_color ?: "#333"}';
}
public function tagKeywords(): string
{
return '{$article.keywords ?: $article.title}';
}
public function tagDescription(): string
{
return '{$article.description}';
}
public function tagLink(): string
{
return '{$article.url}';
}
public function tagTime(): string
{
return '{$article.create_time}';
}
// 详情分类
public function tagCate($tag): string
{
if($tag['name'] == 'name')
{
return '{$article.cate.catename}';
}
if($tag['name'] == 'ename')
{
return '{$article.cate.ename}';
}
if($tag['name'] == 'id')
{
return '{$article.cate_id}';
}
if($tag['name'] == 'link')
{
return '{:url(\'cate\',[\'ename\'=>$article.cate.ename])}';
}
return '';
}
public function tagUser($tag)
{
if($tag['name'] == 'link') {
return '{:url("user/home",["id"=>'.'$'.'article.user.id'.'])->domain(true)}';
}
return '{$article.user.' . $tag['name'] . '}';
}
public function tagCateName()
{
return '{$article.cate.catename}';
}
public function tagCateename()
{
return '{$article.cate.id}';
}
// 详情
// public function tagDetail($tag)
// {
// return '{$article.' . $tag['name'] . '}';
// }
// 详情
public function tagDetail($tag)
{
$parseStr = '{assign name="id" value="$Request.param.id" /}';
$parseStr .= '<?php ';
$parseStr .= '$__article__ = \app\facade\Article::find($id);';
$parseStr .= ' ?>';
$parseStr .= '{$__article__.'. $tag['name'] .'}';
return $parseStr; return $parseStr;
} }
public function tagCommentnum($tag): string
{
$parseStr = $this->article['comments_count'];
// dump($parseStr);
return $parseStr;
}
public function tagIstop($tag): string public function tagIstop($tag): string
{ {
@ -175,35 +98,18 @@ class Article extends TagLib
return $parseStr; return $parseStr;
} }
// 评论 // public function tagComment($tag, $content): string
public function tagComment2($tag, $content): string // {
{ // //
$parse = '<?php '; // //$arr = $this->getComments($this->id, $this->page);
$parse .= ' ?>'; // $parse = '<?php ';
$parse .= '{volist name="comments" id="comment" empty= "还没有内容"}'; // $parse .= '$comment_arr=[[1,3,5,7,9],[2,4,6,8,10]];'; // 这里是模拟数据
$parse .= $content; // $parse .= '$__LIST__ = $comment_arr[' . $type . '];';
$parse .= '{/volist}'; /** $parse .= ' ?>';*/
return $parse; // $parse .= '{volist name="__LIST__" id="' . $name . '"}';
} // $parse .= $content;
// $parse .= '{/volist}';
// 评论 // return $parse;
public function tagComment($tag, $content): string // }
{
$parse = '<?php ';
$parse .= ' ?>';
$parse .= '{volist name="comments['.'\'data\''.']" id="comment" empty= "还没有内容"}';
$parse .= $content;
$parse .= '{/volist}';
return $parse;
}
// 分类列表
public function tagList($tag, $content): string
{
$parse = '{volist name="artList['.'\'data\''.']" id="article" empty= "还没有内容"}';
$parse .= $content;
$parse .= '{/volist}';
return $parse;
}
} }

View File

@ -1,58 +0,0 @@
<?php
/**
* @Program: table.css 2023/4/17
* @FilePath: app\common\taglib\Cate.php
* @Description: Cate.php
* @LastEditTime: 2023-04-17 21:19:59
* @Author: Taoker <317927823@qq.com>
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
*/
namespace app\common\taglib;
use think\template\TagLib;
class Cate extends TagLib
{
protected $tags = [
'brother' => ['attr' => '', 'close' => 1],
'bro_name' => ['attr' => '', 'close' => 0],
'bro_ename' => ['attr' => '', 'close' => 0],
'bro_url' => ['attr' => '', 'close' => 0],
'list' => ['attr' => '', 'close' => 1]
];
public function tagBrother($tag, $content): string
{
$parse = '{assign name="ename" value="$Request.param.ename" /}';
$parse .= '{php}$__brotherCate__ = \app\facade\Cate::getBrotherCate($ename);{/php}';
$parse .= '{volist name="__brotherCate__" id="brother"}';
$parse .= $content;
$parse .= '{/volist}';
return $parse;
}
public function tagBro_name($tag): string
{
return '{$brother.catename}';
}
public function tagBro_ename($tag): string
{
return '{$brother.ename}';
}
public function tagBro_url($tag): string
{
return '{$brother.url}';
}
public function tagList($tag, $content): string
{
//$paras = ;
}
}

View File

@ -1,82 +0,0 @@
<?php
/*
* @Program: table.css 2023/4/16
* @FilePath: app\common\taglib\Comment.php
* @Description: Comment.php 评论标签
* @LastEditTime: 2023-04-16 11:37:01
* @Author: Taoker <317927823@qq.com>
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
*/
namespace app\common\taglib;
use think\template\TagLib;
/**
* 评论内容
*/
class Comment extends TagLib
{
/**
* @var array[]
*/
protected $tags = [
// 标签定义: attr 属性列表 close 是否闭合0 或者1 默认1 alias 标签别名 level 嵌套层次
'id' => ['attr' => '', 'close' => 0],
'content' => ['attr' => '', 'close' => 0],
'time' => ['attr' => '', 'close' => 0],
'zan' => ['attr' => '', 'close' => 0],
'uid' => ['attr' => '', 'close' => 0],
'uname' => ['attr' => '', 'close' => 0],
'uimg' => ['attr' => '', 'close' => 0],
'ulink' => ['attr' => '', 'close' => 0],
'usign' => ['attr' => '', 'close' => 0],
];
public function tagId()
{
return '{$comment.id}';
}
public function tagContent()
{
return '{$comment.content|raw}';
}
public function tagTime()
{
return '{$comment.create_time}';
}
public function tagZan()
{
return '{$comment.zan}';
}
public function tagUid()
{
return '{$comment.user_id}';
}
public function tagUname()
{
return '{$comment.user.nickname ?: $comment.user.name}';
}
public function tagUimg()
{
return '{$comment.user.user_img}';
}
public function tagUlink()
{
return '{:url("user/home",["id"=>'.'$'.'comment.user_id'.'])->domain(true)}';
}
public function tagUsign()
{
return '{$comment.user.sign|raw}';
}
}

View File

@ -1,95 +0,0 @@
<?php
/**
* @Program: table.css 2023/4/17
* @FilePath: app\common\taglib\Gnav.php
* @Description: Gnav.php
* @LastEditTime: 2023-04-17 15:37:40
* @Author: Taoker <317927823@qq.com>
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
*/
namespace app\common\taglib;
use think\template\TagLib;
class Gnav extends TagLib
{
protected $tags = [
// 标签定义: attr 属性列表 close 是否闭合0 或者1 默认1 alias 标签别名 level 嵌套层次
//'nav' => ['attr' => '', 'close' => 1],
'id' => ['attr' => '', 'close' => 0],
'pid' => ['attr' => '', 'close' => 0],
'icon' => ['attr' => '', 'close' => 0],
'name' => ['attr' => '', 'close' => 0],
'ename' => ['attr' => '', 'close' => 0],
'title' => ['attr' => '', 'close' => 0],
'detpl' => ['attr' => '', 'close' => 0],
'sort' => ['attr' => '', 'close' => 0],
'desc' => ['attr' => '', 'close' => 0],
'is_hot' => ['attr' => '', 'close' => 0],
'link' => ['attr' => '', 'close' => 0],
'children' => ['attr' => '', 'close' => 0],
];
public function tagId(): string
{
return '{$gnav.id}';
}
public function tagPid(): string
{
return '{$gnav.pid}';
}
public function tagIcon(): string
{
return '{$gnav.icon}';
}
public function tagName($tag): string
{
return '{$gnav.catename}';
}
public function tagEname(): string
{
return '{$gnav.ename}';
}
public function tagTitle(): string
{
return '{:cookie(\'think_lang\') == \'en-us\' ? $gnav.ename : $gnav.catename}';
}
public function tagDetpl(): string
{
return '{$gnav.detpl}';
}
public function tagSort(): string
{
return '{$gnav.sort}';
}
public function tagDesc(): string
{
return '{$gnav.desc}';
}
public function tagIs_hot(): string
{
return '{$gnav.is_hot}';
}
public function tagLink(): string
{
return '{$gnav.url}';
}
public function tagChildren(): string
{
return '{$gnav.children}';
}
}

View File

@ -1,96 +0,0 @@
<?php
/**
* @Program: table.css 2023/4/17
* @FilePath: app\common\taglib\Nav.php
* @Description: Nav.php
* @LastEditTime: 2023-04-17 14:25:08
* @Author: Taoker <317927823@qq.com>
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
*/
namespace app\common\taglib;
use think\template\TagLib;
class Nav extends TagLib
{
protected $tags = [
// 标签定义: attr 属性列表 close 是否闭合0 或者1 默认1 alias 标签别名 level 嵌套层次
//'nav' => ['attr' => '', 'close' => 1],
'id' => ['attr' => '', 'close' => 0],
'pid' => ['attr' => '', 'close' => 0],
'icon' => ['attr' => '', 'close' => 0],
'name' => ['attr' => '', 'close' => 0],
'ename' => ['attr' => '', 'close' => 0],
'title' => ['attr' => '', 'close' => 0],
'detpl' => ['attr' => '', 'close' => 0],
'sort' => ['attr' => '', 'close' => 0],
'desc' => ['attr' => '', 'close' => 0],
'is_hot' => ['attr' => '', 'close' => 0],
'link' => ['attr' => '', 'close' => 0],
'children' => ['attr' => '', 'close' => 0],
];
public function tagId(): string
{
return '{$nav.id}';
}
public function tagPid(): string
{
return '{$nav.pid}';
}
public function tagIcon(): string
{
return '{$nav.icon}';
}
public function tagName($tag): string
{
return '{$nav.catename}';
}
public function tagEname(): string
{
return '{$nav.ename}';
}
public function tagTitle(): string
{
return '{:cookie(\'think_lang\') == \'en-us\' ? $nav.ename : $nav.catename}';
}
public function tagDetpl(): string
{
return '{$nav.detpl}';
}
public function tagSort(): string
{
return '{$nav.sort}';
}
public function tagDesc(): string
{
return '{$nav.desc}';
}
public function tagIs_hot(): string
{
return '{$nav.is_hot}';
}
public function tagLink(): string
{
return '{$nav.url}';
}
public function tagChildren(): string
{
return '{$nav.children}';
}
}

View File

@ -1,95 +0,0 @@
<?php
/**
* @Program: table.css 2023/4/17
* @FilePath: app\common\taglib\Snav.php
* @Description: Snav.php
* @LastEditTime: 2023-04-17 15:37:30
* @Author: Taoker <317927823@qq.com>
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
*/
namespace app\common\taglib;
use think\template\TagLib;
class Snav extends TagLib
{
protected $tags = [
// 标签定义: attr 属性列表 close 是否闭合0 或者1 默认1 alias 标签别名 level 嵌套层次
//'nav' => ['attr' => '', 'close' => 1],
'id' => ['attr' => '', 'close' => 0],
'pid' => ['attr' => '', 'close' => 0],
'icon' => ['attr' => '', 'close' => 0],
'name' => ['attr' => '', 'close' => 0],
'ename' => ['attr' => '', 'close' => 0],
'title' => ['attr' => '', 'close' => 0],
'detpl' => ['attr' => '', 'close' => 0],
'sort' => ['attr' => '', 'close' => 0],
'desc' => ['attr' => '', 'close' => 0],
'is_hot' => ['attr' => '', 'close' => 0],
'link' => ['attr' => '', 'close' => 0],
'children' => ['attr' => '', 'close' => 0],
];
public function tagId(): string
{
return '{$snav.id}';
}
public function tagPid(): string
{
return '{$snav.pid}';
}
public function tagIcon(): string
{
return '{$snav.icon}';
}
public function tagName($tag): string
{
return '{$snav.catename}';
}
public function tagEname(): string
{
return '{$snav.ename}';
}
public function tagTitle(): string
{
return '{:cookie(\'think_lang\') == \'en-us\' ? $snav.ename : $snav.catename}';
}
public function tagDetpl(): string
{
return '{$snav.detpl}';
}
public function tagSort(): string
{
return '{$snav.sort}';
}
public function tagDesc(): string
{
return '{$snav.desc}';
}
public function tagIs_hot(): string
{
return '{$snav.is_hot}';
}
public function tagLink(): string
{
return '{$snav.url}';
}
public function tagChildren(): string
{
return '{$snav.children}';
}
}

View File

@ -1,120 +0,0 @@
<?php
/**
* @Program: table.css 2023/5/16
* @FilePath: app\common\taglib\System.php
* @Description: System.php
* @LastEditTime: 2023-05-16 21:34:18
* @Author: Taoker <317927823@qq.com>
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
*/
namespace app\common\taglib;
use think\template\TagLib;
class System extends TagLib
{
protected $tags = [
// 标签定义: attr 属性列表 close 是否闭合0 或者1 默认1 alias 标签别名 level 嵌套层次
'webname' => ['attr' => '', 'close' => 0],
'webtitle' => ['attr' => '', 'close' => 0],
'domain' => ['attr' => '', 'close' => 0],
'template' => ['attr' => '', 'close' => 0],
'logo' => ['attr' => '', 'close' => 0],
'm_logo' => ['attr' => '', 'close' => 0],
'cache' => ['attr' => '', 'close' => 0],
'upsize' => ['attr' => '', 'close' => 0],
'uptype' => ['attr' => '', 'close' => 0],
'copyright' => ['attr' => '', 'close' => 0],
'keywords' => ['attr' => '', 'close' => 0],
'descript' => ['attr' => '', 'close' => 0],
'state' => ['attr' => '', 'close' => 0],
'is_open' => ['attr' => '', 'close' => 0],
'is_comment' => ['attr' => '', 'close' => 0],
'is_reg' => ['attr' => '', 'close' => 0],
'icp' => ['attr' => '', 'close' => 0],
'showlist' => ['attr' => '', 'close' => 0],
'blackname' => ['attr' => '', 'close' => 0],
'sys_version_num'=> ['attr' => '', 'close' => 0],
'key' => ['attr' => '', 'close' => 0],
'clevel' => ['attr' => '', 'close' => 0],
'api_url' => ['attr' => '', 'close' => 0],
'base_url' => ['attr' => '', 'close' => 0],
'upcheck_url' => ['attr' => '', 'close' => 0],
'upgrade_url' => ['attr' => '', 'close' => 0],
'create_time' => ['attr' => '', 'close' => 0],
'update_time' => ['attr' => '', 'close' => 0]
];
public function tagWebname(): string
{
return '{$sysInfo.webname}';
}
public function tagWebtitle(): string
{
return '{$sysInfo.webtitle}';
}
public function tagDomain(): string
{
return '{$sysInfo.domain}';
}
public function tagTemplate(): string
{
return '{$sysInfo.template}';
}
public function tagLogo(): string
{
return '{$sysInfo.logo}';
}
public function tagMlogo(): string
{
return '{$sysInfo.m_logo}';
}
public function tagCopyright(): string
{
return '{$sysInfo.copyright}';
}
public function tagKeywords(): string
{
return '{$sysInfo.keywords}';
}
public function tagDescript(): string
{
return '{$sysInfo.descript}';
}
public function tagState(): string
{
return '{$sysInfo.state}';
}
public function tagIcp(): string
{
return '{$sysInfo.icp}';
}
public function tagSys_version(): string
{
return '{$sysInfo.sys_version_num}';
}
public function tagKey(): string
{
return '{$sysInfo.key}';
}
public function tagCreate_time(): string
{
return '{$sysInfo.create_time}';
}
}

View File

@ -1,72 +0,0 @@
<?php
/**
* @Program: table.css 2023/4/15
* @FilePath: app\common\taglib\Taoler.php
* @Description: Taoler.php
* @LastEditTime: 2023-04-15 11:09:54
* @Author: Taoker <317927823@qq.com>
* @Copyright (c) 2020~2023 https://www.aieok.com All rights reserved.
*/
namespace app\common\taglib;
use think\template\TagLib;
class Taoler extends TagLib
{
protected $tags = [
// 标签定义: attr 属性列表 close 是否闭合0 或者1 默认1 alias 标签别名 level 嵌套层次
'nav' => ['attr' => '', 'close' => 1],
'snav' => ['attr' => '', 'close' => 1],
'gnav' => ['attr' => '', 'close' => 1],
'if' => ['condition', 'expression' => true, 'close' => 1],
];
public function tagNav($tag, $content): string
{
$id = $tag['id'] ?? 'nav';
$parse = '{php}$__cate__ = \app\facade\Cate::getNav();{/php}';
$parse .= '{volist name="__cate__" id="'.$id.'"}';
$parse .= $content;
$parse .= '{/volist}';
return $parse;
}
public function tagSnav($tag, $content): string
{
$id = $tag['id'] ?? 'snav';
$parse = '{notempty name="nav.children"}';
$parse .= '{volist name="nav.children" id="'.$id.'"}';
$parse .= $content;
$parse .= '{/volist}';
$parse .= '{/notempty}';
return $parse;
}
public function tagGnav($tag, $content): string
{
$id = $tag['id'] ?? 'gnav';
$parse = '{notempty name="snav.children"}';
$parse .= '{volist name="snav.children" id="'.$id.'"}';
$parse .= $content;
$parse .= '{/volist}';
$parse .= '{/notempty}';
return $parse;
}
public function tagIf($tag, $content): string
{
$condition = !empty($tag['expression']) ? $tag['expression'] : $tag['condition'];
$condition = $this->parseCondition($condition);
$parseStr = '<?php if(' . $condition . '): ?>' . $content . '<?php endif; ?>';
return $parseStr;
// return '{if'.$tag.'}} '.$content.' {/if}';
}
}

View File

@ -17,7 +17,6 @@ class User extends Validate
protected $rule = [ protected $rule = [
'name|用户名' => 'require|min:2|max:18|chsDash|unique:user', 'name|用户名' => 'require|min:2|max:18|chsDash|unique:user',
'email|邮箱' => 'require|email|unique:user', 'email|邮箱' => 'require|email|unique:user',
'phone|手机号' => 'require|mobile|unique:user',
'password|密码' => 'require|min:6|max:20', 'password|密码' => 'require|min:6|max:20',
'repassword|确认密码'=>'require|confirm:password', 'repassword|确认密码'=>'require|confirm:password',
'nickname|昵称' => 'require|min:2|max:20', 'nickname|昵称' => 'require|min:2|max:20',
@ -49,23 +48,11 @@ class User extends Validate
->remove('email', 'unique'); ->remove('email', 'unique');
} }
//phone登陆验证场景 //注册验证场景
public function sceneLoginPhone()
{
return $this->only(['phone','password'])
->remove('phone', 'unique');
}
//注册验证场景
public function sceneReg() public function sceneReg()
{ {
return $this->only(['name','email','password','repassword']); return $this->only(['name','email','password','repassword']);
}
//后台注册验证场景
public function sceneUserReg()
{
return $this->only(['name','email','phone','password']);
} }
//密码找回 //密码找回

View File

@ -3,37 +3,13 @@
// | 模板设置 // | 模板设置
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
use think\facade\Db; use think\facade\Db;
use taoler\com\Files;
use think\facade\Cache;
//如果网站安装从数据库查询选择的模板 //如果网站安装从数据库查询选择的模板
if(file_exists('./install.lock')){ if(file_exists('./install.lock')){
$template = Db::name('system')->where('id',1)->cache(true)->value('template'); $template = Db::name('system')->where('id',1)->value('template');
} else { } else {
$template = ''; $template = '';
} }
$taglib_pre_load = Cache::remember('taglib', function(){
$tagsArr = [];
//获取应用公共标签app/common/taglib
$common_taglib = Files::getAllFile(root_path().'app/common/taglib');
foreach ($common_taglib as $t) {
$tagsArr[] = str_replace('/','\\',strstr(strstr($t, 'app/'), '.php', true));
}
//获取插件下标签 addons/taglib文件
$localAddons = Files::getDirName('../addons/');
foreach($localAddons as $v) {
$dir = root_path(). 'addons'. DIRECTORY_SEPARATOR . $v . DIRECTORY_SEPARATOR .'taglib';
if(!file_exists($dir)) continue;
$addons_taglib = Files::getAllFile($dir);
foreach ($addons_taglib as $a) {
$tagsArr[] = str_replace('/','\\',strstr(strstr($a, 'addons'), '.php', true));
}
}
return implode(',', $tagsArr);
});
return [ return [
// 模板引擎类型使用Think // 模板引擎类型使用Think
'type' => 'Think', 'type' => 'Think',
@ -43,10 +19,8 @@ return [
'view_dir_name' => 'view' . DIRECTORY_SEPARATOR . $template, 'view_dir_name' => 'view' . DIRECTORY_SEPARATOR . $template,
// 模板后缀 // 模板后缀
'view_suffix' => 'html', 'view_suffix' => 'html',
// 定义内置标签
//'taglib_build_in' => 'app\common\taglib\Article',
// 预先加载的标签库 // 预先加载的标签库
'taglib_pre_load' => $taglib_pre_load, 'taglib_pre_load' => 'app\common\taglib\Article',
// 模板文件名分隔符 // 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR, 'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记 // 模板引擎普通标签开始标记

View File

@ -1,2 +1 @@
Api.php Api.php
Works.php

View File

@ -12,6 +12,8 @@ use think\facade\Session;
use think\facade\Config; use think\facade\Config;
use app\common\model\Cate; use app\common\model\Cate;
use app\common\model\Comment; use app\common\model\Comment;
use app\common\model\Article as ArticleModel;
use app\common\model\Slider;
use app\common\model\UserZan; use app\common\model\UserZan;
use app\common\model\PushJscode; use app\common\model\PushJscode;
use taoler\com\Message; use taoler\com\Message;
@ -28,13 +30,15 @@ class Article extends BaseController
public function __construct(App $app) public function __construct(App $app)
{ {
parent::__construct($app); parent::__construct($app);
$this->model = new \app\common\model\Article(); $this->model = new ArticleModel();
} }
//文章分类 //文章分类
public function cate() public function cate()
{ {
$cate = new Cate(); $cate = new Cate();
$ad = new Slider();
$article = new ArticleModel();
//动态参数 //动态参数
$ename = Request::param('ename'); $ename = Request::param('ename');
$type = Request::param('type','all'); $type = Request::param('type','all');
@ -49,10 +53,13 @@ class Article extends BaseController
$path = substr($url,0,strrpos($url,"/")); $path = substr($url,0,strrpos($url,"/"));
//分类列表 //分类列表
$artList = $this->model->getCateList($ename,$type,$page); $artList = $article->getCateList($ename,$type,$page);
// 热议文章 // 热议文章
$artHot = $this->model->getArtHot(10); $artHot = $article->getArtHot(10);
//分类图片
$ad_cateImg = $ad->getSliderList(3);
//分类钻展赞助
$ad_comm = $ad->getSliderList(6);
$assignArr = [ $assignArr = [
'ename'=>$ename, 'ename'=>$ename,
@ -60,6 +67,8 @@ class Article extends BaseController
'type'=>$type, 'type'=>$type,
'artList'=>$artList, 'artList'=>$artList,
'artHot'=>$artHot, 'artHot'=>$artHot,
'ad_cateImg'=>$ad_cateImg,
'ad_comm'=>$ad_comm,
'path'=>$path, 'path'=>$path,
'jspage'=>'jie' 'jspage'=>'jie'
]; ];
@ -75,12 +84,24 @@ class Article extends BaseController
$id = input('id'); $id = input('id');
$page = input('page',1); $page = input('page',1);
//输出内容 //输出内容
$article = new ArticleModel();
$artDetail = $this->model->getArtDetail($id); $artDetail = $this->model->getArtDetail($id);
if(is_null($artDetail)){
throw new \think\exception\HttpException(404, '无内容'); if($artDetail['read_type'] == 1 && session('art_pass_'.$id) != $artDetail['art_pass']) {
$artDetail['content'] = '本文已加密!请输入正确密码查看!';
} }
//被赞
$zanCount = Db::name('user_zan')->where('user_id', $artDetail['user_id'])->count('id'); if(is_null($artDetail)){
// 抛出 HTTP 异常
throw new \think\exception\HttpException(404, '无内容');
}
//用户个人tag标签
$userTags = $this->model->where(['user_id'=>$artDetail['user_id'],'status'=>1])->where('keywords','<>','')->column('keywords');
//转换为字符串
$tagStr = implode(",",$userTags);
//转换为数组并去重
$tagArr = array_unique(explode(",",$tagStr));
$userTagCount = count($tagArr);
//赞列表 //赞列表
$userZanList = []; $userZanList = [];
@ -91,8 +112,9 @@ class Article extends BaseController
} }
} }
// 设置内容的tag内链 // 设置内容的tag内链
$artDetail->content = $this->setArtTagLink($artDetail->content); $artDetail['content'] = $this->setArtTagLink($artDetail['content']);
// 标签 // 标签
$tags = []; $tags = [];
@ -105,7 +127,7 @@ class Article extends BaseController
$tags[] = ['name'=>$tag['name'],'url'=> (string) url('tag_list',['ename'=>$tag['ename']])]; $tags[] = ['name'=>$tag['name'],'url'=> (string) url('tag_list',['ename'=>$tag['ename']])];
} }
//相关帖子 //相关帖子
$relationArticle = $this->model->getRelationTags($artTags[0]['tag_id'],$id,5); $relationArticle = $article->getRelationTags($artTags[0]['tag_id'],$id,5);
} }
$tpl = Db::name('cate')->where('id', $artDetail['cate_id'])->value('detpl'); $tpl = Db::name('cate')->where('id', $artDetail['cate_id'])->value('detpl');
@ -114,10 +136,9 @@ class Article extends BaseController
//浏览pv //浏览pv
Db::name('article')->where('id',$id)->inc('pv')->update(); Db::name('article')->where('id',$id)->inc('pv')->update();
$pv = Db::name('article')->field('pv')->where('id',$id)->value('pv'); $pv = Db::name('article')->field('pv')->where('id',$id)->value('pv');
$artDetail->pv = $pv;
//上一篇下一篇 //上一篇下一篇
$upDownArt = $this->model->getPrevNextArticle($id,$artDetail['cate_id']); $upDownArt = $article->getPrevNextArticle($id,$artDetail['cate_id']);
if(empty($upDownArt['previous'][0])) { if(empty($upDownArt['previous'][0])) {
$previous = '前面已经没有了!'; $previous = '前面已经没有了!';
} else { } else {
@ -134,7 +155,13 @@ class Article extends BaseController
//最新评论时间 //最新评论时间
$lrDate_time = Db::name('comment')->where('article_id', $id)->max('update_time',false) ?? time(); $lrDate_time = Db::name('comment')->where('article_id', $id)->max('update_time',false) ?? time();
// 热议文章 // 热议文章
$artHot = $this->model->getArtHot(10); $artHot = $article->getArtHot(10);
//广告
$ad = new Slider();
//分类图片
$ad_artImg = $ad->getSliderList(4);
//分类钻展赞助
$ad_comm = $ad->getSliderList(7);
//push //push
$push_js = Db::name('push_jscode')->where(['delete_time'=>0,'type'=>1])->cache(true)->select(); $push_js = Db::name('push_jscode')->where(['delete_time'=>0,'type'=>1])->cache(true)->select();
@ -142,6 +169,8 @@ class Article extends BaseController
'article' => $artDetail, 'article' => $artDetail,
'pv' => $pv, 'pv' => $pv,
'artHot' => $artHot, 'artHot' => $artHot,
'ad_art' => $ad_artImg,
'ad_comm' => $ad_comm,
'tags' => $tags, 'tags' => $tags,
'relationArticle' => $relationArticle, 'relationArticle' => $relationArticle,
'previous' => $previous, 'previous' => $previous,
@ -152,9 +181,9 @@ class Article extends BaseController
'cid' => $id, 'cid' => $id,
'lrDate_time' => $lrDate_time, 'lrDate_time' => $lrDate_time,
'userZanList' => $userZanList, 'userZanList' => $userZanList,
'zanCount' => $zanCount, 'userTagCount'=> $userTagCount,
'jspage' => 'jie', 'jspage' => 'jie',
'passJieMi' => session('art_pass_'.$id), 'passJieMi' => session('art_pass_'.$id),
$download, $download,
]); ]);
@ -176,10 +205,8 @@ class Article extends BaseController
if (Request::isAjax()){ if (Request::isAjax()){
//获取评论 //获取评论
$data = Request::only(['content','article_id','pid','to_user_id']); $data = Request::only(['content','article_id','user_id']);
$data['user_id'] = $this->uid;
$sendId = $data['user_id']; $sendId = $data['user_id'];
// halt($data);
$art = Db::name('article')->field('id,status,is_reply,delete_time')->find($data['article_id']); $art = Db::name('article')->field('id,status,is_reply,delete_time')->find($data['article_id']);
if($art['delete_time'] != 0 || $art['status'] != 1 || $art['is_reply'] != 1){ if($art['delete_time'] != 0 || $art['status'] != 1 || $art['is_reply'] != 1){
@ -256,11 +283,13 @@ class Article extends BaseController
$data['content'] = $this->downUrlPicsReaplace($data['content']); $data['content'] = $this->downUrlPicsReaplace($data['content']);
// 把中文,转换为英文,并去空格->转为数组->去掉空数组->再转化为带,号的字符串 // 把中文,转换为英文,并去空格->转为数组->去掉空数组->再转化为带,号的字符串
$data['keywords'] = implode(',',array_filter(explode(',',trim(str_replace('',',',$data['keywords']))))); $data['keywords'] = implode(',',array_filter(explode(',',trim(str_replace('',',',$data['keywords'])))));
$data['description'] = strip_tags($this->filterEmoji($data['description']));
// 获取分类ename,appname // 获取分类ename,appname
$cateName = Db::name('cate')->field('ename,appname')->find($data['cate_id']); $cateName = Db::name('cate')->field('ename,appname')->find($data['cate_id']);
$result = $this->model->add($data); $article = new ArticleModel();
$result = $article->add($data);
if ($result['code'] == 1) { if ($result['code'] == 1) {
// 获取到的最新ID // 获取到的最新ID
$aid = $result['data']['id']; $aid = $result['data']['id'];
@ -322,7 +351,7 @@ class Article extends BaseController
*/ */
public function edit($id) public function edit($id)
{ {
$article = $this->model->find($id); $article = ArticleModel::find($id);
if(Request::isAjax()){ if(Request::isAjax()){
$data = Request::only(['id','cate_id','title','title_color','read_type','art_pass','content','upzip','keywords','description','captcha']); $data = Request::only(['id','cate_id','title','title_color','read_type','art_pass','content','upzip','keywords','description','captcha']);
@ -349,7 +378,7 @@ class Article extends BaseController
$data['content'] = $this->downUrlPicsReaplace($data['content']); $data['content'] = $this->downUrlPicsReaplace($data['content']);
// 把,转换为,并去空格->转为数组->去掉空数组->再转化为带,号的字符串 // 把,转换为,并去空格->转为数组->去掉空数组->再转化为带,号的字符串
$data['keywords'] = implode(',',array_filter(explode(',',trim(str_replace('',',',$data['keywords']))))); $data['keywords'] = implode(',',array_filter(explode(',',trim(str_replace('',',',$data['keywords'])))));
$data['description'] = strip_tags($this->filterEmoji($data['description']));
$result = $article->edit($data); $result = $article->edit($data);
if($result == 1) { if($result == 1) {
@ -408,7 +437,7 @@ class Article extends BaseController
*/ */
public function delete() public function delete()
{ {
$article = $this->model->find(input('id')); $article = ArticleModel::find(input('id'));
$result = $article->together(['comments'])->delete(); $result = $article->together(['comments'])->delete();
if($result) { if($result) {
return Msgres::success('delete_success'); return Msgres::success('delete_success');
@ -443,11 +472,45 @@ class Article extends BaseController
return download($zip,'my'); return download($zip,'my');
} }
/**
* 获取描述过滤html
*
* @return void
*/
public function getDescription()
{
$data = Request::only(['content']);
$description = getArtContent($data['content']);
return json(['code'=>0,'data'=>$description]);
}
/**
* 标题调用百度关键词词条
*
* @return void
*/
public function getWordList()
{
$title = input('title');
return $this->getBdiduSearchWordList($title);
}
/**
* 关键词
* @return \think\response\Json
*/
public function keywords()
{
$data = Request::only(['flag','keywords','content']);
$keywords = $this->setKeywords($data);
return json(['code'=>0, 'msg' => 'ok', 'data'=> $keywords]);
}
// 文章置顶、加精、评论状态 // 文章置顶、加精、评论状态
public function jieset() public function jieset()
{ {
$data = Request::param(); $data = Request::param();
$article = $this->model->field('id,is_top,is_hot,is_reply')->find($data['id']); $article = ArticleModel::field('id,is_top,is_hot,is_reply')->find($data['id']);
switch ($data['field']){ switch ($data['field']){
case 'top': case 'top':
if($data['rank']==1){ if($data['rank']==1){
@ -487,7 +550,7 @@ class Article extends BaseController
public function titleColor() public function titleColor()
{ {
$data = Request::param(); $data = Request::param();
$result = $this->model->update($data); $result = ArticleModel::update($data);
if($result){ if($result){
//清除文章缓存 //清除文章缓存
Cache::tag(['tagArt','tagArtDetail'])->clear(); Cache::tag(['tagArt','tagArtDetail'])->clear();
@ -574,22 +637,15 @@ class Article extends BaseController
/** /**
* 分类树 * 分类树
* @return \think\response\Json * @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/ */
public function getCateTree() public function getCateTree()
{ {
$cateList = Cate::field('id,pid,catename,sort')->where(['status' => 1])->select()->toArray(); $data = $this->showNav();
$list = getTree($cateList); $count = count($data);
// 排序
$cmf_arr = array_column($list, 'sort');
array_multisort($cmf_arr, SORT_ASC, $list);
$count = count($list);
$tree = []; $tree = [];
if($count){ if($count){
$tree = ['code'=>0, 'msg'=>'ok','count'=>$count]; $tree = ['code'=>0, 'msg'=>'ok','count'=>$count];
$tree['data'] = $list; $tree['data'] = $data;
} }
return json($tree); return json($tree);

View File

@ -10,6 +10,10 @@ use think\facade\Db;
class Collection extends BaseController class Collection extends BaseController
{ {
// protected $type = [
// 'cid' => 'integer',
// ];
//文章收藏 //文章收藏
public function add(){ public function add(){
//$data = Request::param(); //$data = Request::param();

View File

@ -35,8 +35,9 @@ class Comment extends BaseController
//删除评论 //删除评论
public function jiedaDelete() public function jiedaDelete()
{ {
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
$id = input('id'); $id = input('id');
//$arid = intval($id);
$comms = CommentModel::find($id); $comms = CommentModel::find($id);
$result = $comms->delete(); $result = $comms->delete();
if($result){ if($result){
@ -51,7 +52,7 @@ class Comment extends BaseController
public function getDa() public function getDa()
{ {
//获取原评论 //获取原评论
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']); $this->isLogin();
$id = input('id'); $id = input('id');
$comms = CommentModel::find($id); $comms = CommentModel::find($id);
$res['rows'] = []; $res['rows'] = [];
@ -65,7 +66,7 @@ class Comment extends BaseController
//更新评论 //更新评论
public function updateDa() public function updateDa()
{ {
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']); $this->isLogin();
$id = input('id'); $id = input('id');
$content = input('content'); $content = input('content');
$comms = CommentModel::find($id); $comms = CommentModel::find($id);
@ -82,7 +83,6 @@ class Comment extends BaseController
//更新评论 //更新评论
public function edit() public function edit()
{ {
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
if(Request::isAjax()) { if(Request::isAjax()) {
$param = Request::param(); $param = Request::param();
// halt($param); // halt($param);
@ -101,7 +101,7 @@ class Comment extends BaseController
//评论点赞 //评论点赞
public function jiedaZan() public function jiedaZan()
{ {
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']); $this->isLogin();
$data['comment_id'] = input('post.id'); $data['comment_id'] = input('post.id');
$data['user_id'] = session('user_id'); $data['user_id'] = session('user_id');
//查询是否已存在点赞 //查询是否已存在点赞

View File

@ -11,11 +11,11 @@
namespace app\index\controller; namespace app\index\controller;
use app\common\controller\BaseController; use app\common\controller\BaseController;
use app\common\lib\facade\HttpHelper;
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\facade\Article; use app\facade\Article;
use app\common\model\Slider;
use app\common\lib\Msgres; use app\common\lib\Msgres;
class Index extends BaseController class Index extends BaseController
@ -30,18 +30,39 @@ class Index extends BaseController
public function index() public function index()
{ {
$types = input('type'); $types = input('type');
$slider = new Slider();
//幻灯
$sliders = Request::isMobile() ? $slider->getSliderList(12) : $slider->getSliderList(1);
//置顶文章 //置顶文章
$artTop = Article::getArtTop(5); $artTop = Article::getArtTop(5);
//首页文章列表,显示10个 //首页文章列表,显示20个
$artList = Article::getArtList(15); $artList = Article::getArtList(22);
//热议文章 //热议文章
$artHot = Article::getArtHot(10); $artHot = Article::getArtHot(10);
//首页广告
$indexAd = $slider->getSliderList(13);
//温馨通道
$fast_links = $slider->getSliderList(8);
//首页赞助
$ad_index = $slider->getSliderList(5);
//首页右栏图片
$ad_comm = $slider->getSliderList(2);
//友情链接申请
$adminEmail = Db::name('user')->where('id',1)->cache(true)->value('email');
$vs = [ $vs = [
'slider' => $sliders,
'artTop' => $artTop, 'artTop' => $artTop,
'artList' => $artList, 'artList' => $artList,
'artHot' => $artHot, 'artHot' => $artHot,
'ad_index_r'=> $indexAd,
'type' => $types, 'type' => $types,
'ad_index' => $ad_index,
'ad_comm' => $ad_comm,
'fastlinks' => $fast_links,
'adminEmail' => $adminEmail,
'jspage' => '', 'jspage' => '',
]; ];
View::assign($vs); View::assign($vs);

View File

@ -54,24 +54,8 @@ class Login extends BaseController
//邮箱正则表达式 //邮箱正则表达式
$pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i"; $pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
//判断输入的是邮箱还是用户名
if(preg_match("/^1[34578]\d{9}$/",$data['name'])) if (preg_match($pattern, $data['name'])){
{
//手机验证登录
$data['phone'] = $data['name'];
unset($data['name']);
try{
validate(userValidate::class)
->scene('loginPhone')
->check($data);
} catch (ValidateException $e) {
// 验证失败 输出错误信息
return json(['code'=>-1,'msg'=>$e->getError()]);
}
$data['name'] = $data['phone'];
unset($data['phone']);
} elseif (preg_match($pattern, $data['name'])){
//输入邮箱email登陆验证 //输入邮箱email登陆验证
$data['email'] = $data['name']; $data['email'] = $data['name'];
unset($data['name']); unset($data['name']);

View File

@ -15,6 +15,7 @@ use app\common\controller\BaseController;
use think\facade\View; use think\facade\View;
use think\facade\Request; use think\facade\Request;
use app\facade\Article; use app\facade\Article;
use app\common\model\Slider;
class Search extends BaseController class Search extends BaseController
{ {
@ -24,6 +25,9 @@ class Search extends BaseController
$ser = Request::only(['keywords']); $ser = Request::only(['keywords']);
$artList = Article::getSearchKeyWord($ser['keywords']); $artList = Article::getSearchKeyWord($ser['keywords']);
$counts = $artList->count(); $counts = $artList->count();
$slider = new Slider();
//首页右栏
$ad_comm = $slider->getSliderList(2);
// 查询热议 // 查询热议
$artHot = Article::getArtHot(10); $artHot = Article::getArtHot(10);
@ -31,6 +35,7 @@ class Search extends BaseController
'artList' => $artList, 'artList' => $artList,
'keywords' => $ser['keywords'], 'keywords' => $ser['keywords'],
'counts' => $counts, 'counts' => $counts,
'ad_comm'=>$ad_comm,
'artHot'=>$artHot, 'artHot'=>$artHot,
'jspage'=>'' 'jspage'=>''
]; ];

View File

@ -133,7 +133,7 @@ class User extends BaseController
$validate = new userValidate; $validate = new userValidate;
$result = $validate->scene('Set')->check($data); $result = $validate->scene('Set')->check($data);
if(!$result){ if(!$result){
return json(['code'=>-1,'msg' =>$validate->getError()]); $this->error($validate->getError());
} else { } else {
//防止重复的email //防止重复的email
$resEmail = Db::name('user')->where('email',$data['email'])->where('id','<>',$this->uid)->find(); $resEmail = Db::name('user')->where('email',$data['email'])->where('id','<>',$this->uid)->find();
@ -151,7 +151,7 @@ class User extends BaseController
Cache::tag('user')->clear(); Cache::tag('user')->clear();
return json(['code'=>0,'msg'=>'资料更新成功']); return json(['code'=>0,'msg'=>'资料更新成功']);
} else { } else {
return json(['code'=>-1,'msg' =>$result]); $this->error($result);
} }
} }
} }
@ -275,8 +275,7 @@ class User extends BaseController
$validate = new userValidate; $validate = new userValidate;
$res = $validate->scene('setPass')->check($data); $res = $validate->scene('setPass')->check($data);
if(!$res){ if(!$res){
return json(['code'=>-1,'msg' =>$validate->getError()]); return $this->error($validate->getError());
} }
$user = new userModel; $user = new userModel;
$result = $user->setpass($data); $result = $user->setpass($data);
@ -285,7 +284,7 @@ class User extends BaseController
Cookie::delete('auth'); Cookie::delete('auth');
return $this->success('密码修改成功 请登录', (string) url('login/index')); return $this->success('密码修改成功 请登录', (string) url('login/index'));
} else { } else {
return json(['code'=>-1,'msg' =>$result]); return $this->error($result);
} }
} }
} }
@ -299,8 +298,9 @@ class User extends BaseController
//Cookie::delete('user_id'); //Cookie::delete('user_id');
if(Session::has('user_id')){ if(Session::has('user_id')){
return json(['code' => -1, 'msg' => '退出失败']); return json(['code' => -1, 'msg' => '退出失败']);
} else {
return json(['code' => 200, 'msg' => '退出成功', 'url' => '/']);
} }
return json(['code' => 200, 'msg' => '退出成功', 'url' => '/']);
} }
} }

View File

@ -30,7 +30,7 @@ return [
'index' => 'index', 'index' => 'index',
'home page' => '首页', 'home page' => '首页',
'user center' => '用户中心', 'user center' => '用户中心',
'set info' => '个人设置', 'set info' => '设置',
'my message' => '我的消息', 'my message' => '我的消息',
'my page' => '我的主页', 'my page' => '我的主页',

View File

@ -1,2 +1 @@
myroute.php myroute.php
a.php

View File

@ -9,7 +9,6 @@
* Copyright (c) 2020~2022 https://www.aieok.com All rights reserved. * Copyright (c) 2020~2022 https://www.aieok.com All rights reserved.
*/ */
use think\facade\Route; use think\facade\Route;
use think\facade\Request;
//详情页URL别称 //详情页URL别称
$detail_as = config('taoler.url_rewrite.article_as'); $detail_as = config('taoler.url_rewrite.article_as');
@ -69,24 +68,19 @@ Route::group('art',function () use($detail_as,$cate_as){
Route::get('tag','tag/getAllTag')->name('get_all_tag'); Route::get('tag','tag/getAllTag')->name('get_all_tag');
Route::get('arttag','tag/getArticleTag')->name('get_art_tag'); Route::get('arttag','tag/getArticleTag')->name('get_art_tag');
Route::rule('search/[:keywords]', 'index/search'); // 搜索
// article分类和详情路由 !放到最后!
Route::group(function () use($detail_as, $cate_as){ Route::group(function () use($detail_as, $cate_as){
// 动态路径路由会影响下面的路由,所以动态路由放下面 // 动态路径路由会影响下面的路由,所以动态路由放下面
Route::get($detail_as . ':id$', 'article/detail')->name('article_detail'); Route::get($detail_as . ':id$', 'article/detail')->name('article_detail');
Route::get($detail_as . '<id>/<page>$', 'article/detail')->name('article_comment'); Route::get($detail_as . '<id>/<page>$', 'article/detail')->name('article_comment');
//分类
Route::get($cate_as . '<ename>$','article/cate')->name('cate'); Route::get($cate_as . '<ename>$','article/cate')->name('cate');
Route::get($cate_as . '<ename>/<type>$', 'article/cate')->name('cate_type'); Route::get($cate_as . '<ename>/<type>$', 'article/cate')->name('cate_type');
Route::get($cate_as . '<ename>/<type>/<page>$', 'article/cate')->name('cate_page'); Route::get($cate_as . '<ename>/<type>/<page>$', 'article/cate')->name('cate_page');
})->pattern([ })->pattern([
'ename' => '[\w|\-]+', 'ename' => '\w+',
'type' => '\w+', 'type' => '\w+',
'page' => '\d+', 'page' => '\d+',
'id' => '\d+', 'id' => '\d+',
]); ]);
Route::rule('search/[:keywords]', 'index/search'); // 搜索

View File

@ -142,7 +142,7 @@ return [
// 数据库连接参数 // 数据库连接参数
'params' => [], 'params' => [],
// 数据库编码默认采用utf8 // 数据库编码默认采用utf8
'charset' => 'utf8mb4', 'charset' => 'utf8',
// 数据库表前缀 // 数据库表前缀
'prefix' => env('database.prefix', '{$data['DB_PREFIX']}'), 'prefix' => env('database.prefix', '{$data['DB_PREFIX']}'),
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
@ -168,39 +168,21 @@ return [
], ],
]; ];
EOV; EOV;
// 创建数据库链接配置文件 // 创建数据库链接配置文件
$database = config_path() . 'database.php'; $database = '../config/database.php';
if (file_exists($database) && is_writable($database)) { if (file_exists($database)) {
$fp = fopen($database,"w"); if(is_writable($database)){
$resf = fwrite($fp, $db_str); $fp = fopen($database,"w");
fclose($fp); $resf = fwrite($fp, $db_str);
if(!$resf) return json(['code' => -1,'msg'=>'数据库配置文件创建失败!']); fclose($fp);
} else { if(!$resf){
return json(['code' => -1,'msg'=>'数据库配置文件创建失败!']);
}
}
return json(['code' => -1,'msg'=>'config/database.php 无写入权限']); return json(['code' => -1,'msg'=>'config/database.php 无写入权限']);
} }
} }
$env = <<<ENV
APP_DEBUG = false
[APP]
DEFAULT_TIMEZONE = Asia/Shanghai
[DATABASE]
TYPE = mysql
HOSTNAME = {$data['DB_HOST']}
DATABASE = {$data['DB_NAME']}
USERNAME = {$data['DB_USER']}
PASSWORD = {$data['DB_PWD']}
HOSTPORT = {$data['DB_PORT']}
CHARSET = utf8mb4
DEBUG = false
[LANG]
default_lang = zh-cn
ENV;
file_put_contents(root_path() . '.env', $env);
//安装上锁 //安装上锁
file_put_contents('./install.lock', 'lock'); file_put_contents('./install.lock', 'lock');
Session::clear(); Session::clear();

View File

@ -5,7 +5,7 @@
Target Server Version : 80020 (8.0.20) Target Server Version : 80020 (8.0.20)
File Encoding : 65001 File Encoding : 65001
Date: 8/06/2023 19:57:43 Date: 14/03/2023 19:57:43
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
@ -48,7 +48,7 @@ DROP TABLE IF EXISTS `tao_article`;
CREATE TABLE `tao_article` ( CREATE TABLE `tao_article` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '用户ID', `id` int NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '标题', `title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '标题',
`content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容', `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '内容',
`status` enum('0','-1','1') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '1' COMMENT '状态1显示0待审-1禁止', `status` enum('0','-1','1') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '1' COMMENT '状态1显示0待审-1禁止',
`cate_id` int NOT NULL COMMENT '分类id', `cate_id` int NOT NULL COMMENT '分类id',
`user_id` int NOT NULL COMMENT '用户id', `user_id` int NOT NULL COMMENT '用户id',
@ -266,11 +266,6 @@ INSERT INTO `tao_auth_rule` VALUES (120, 'content.cate/edit', '编辑分类', 1,
INSERT INTO `tao_auth_rule` VALUES (121, 'content.cate/delete', '删除分类', 1, 1, 117, 2, '', 2, 50, '', 0, 0, 0); INSERT INTO `tao_auth_rule` VALUES (121, 'content.cate/delete', '删除分类', 1, 1, 117, 2, '', 2, 50, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (122, 'content.cate/hot', '热点分类', 1, 1, 117, 2, '', 2, 50, '', 0, 0, 0); INSERT INTO `tao_auth_rule` VALUES (122, 'content.cate/hot', '热点分类', 1, 1, 117, 2, '', 2, 50, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (123, 'content.cate/getAppNameView', '分类应用模板', 1, 1, 117, 2, '', 2, 50, '', 0, 0, 0); INSERT INTO `tao_auth_rule` VALUES (123, 'content.cate/getAppNameView', '分类应用模板', 1, 1, 117, 2, '', 2, 50, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (124, 'content.tag/index', '标签管理', 1, 1, 4, 1, '', 1, 50, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (125, 'content.tag/list', '标签列表', 1, 1, 124, 2, '', 2, 50, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (126, 'content.tag/add', '添加标签', 1, 1, 124, 2, '', 2, 50, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (127, 'content.tag/edit', '编辑标签', 1, 1, 124, 2, '', 2, 50, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (128, 'content.tag/delete', '删除标签', 1, 1, 124, 2, '', 2, 50, '', 0, 0, 0);
-- ---------------------------- -- ----------------------------
-- Table structure for tao_cate -- Table structure for tao_cate
@ -318,29 +313,36 @@ CREATE TABLE `tao_collection` (
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文章收藏表' ROW_FORMAT = Dynamic; ) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文章收藏表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tao_collection
-- ----------------------------
-- ---------------------------- -- ----------------------------
-- Table structure for tao_comment -- Table structure for tao_comment
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `tao_comment`; DROP TABLE IF EXISTS `tao_comment`;
CREATE TABLE `tao_comment` ( CREATE TABLE `tao_comment` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '评论id', `id` int NOT NULL AUTO_INCREMENT COMMENT '评论id',
`pid` int NOT NULL DEFAULT 0 COMMENT '父id', `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评论',
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评论', `article_id` int NOT NULL COMMENT '文章id',
`article_id` int NOT NULL COMMENT '文章id', `user_id` int NOT NULL COMMENT '评论用户',
`user_id` int NOT NULL COMMENT '评论用户', `zan` tinyint NOT NULL DEFAULT 0 COMMENT '',
`to_user_id` int NULL DEFAULT NULL COMMENT '给用户留言', `cai` enum('1','0') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '0求解1采纳',
`zan` tinyint NOT NULL DEFAULT 0 COMMENT '', `status` enum('0','-1','1') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '1通过0待审-1禁止',
`cai` enum('1','0') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '0求解1采纳', `create_time` int NOT NULL DEFAULT 0 COMMENT '创建时间',
`status` enum('0','-1','1') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '1通过0待审-1禁止', `update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间',
`type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '评论类型1帖子2其它', `delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间',
`create_time` int NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `aiticle_id`(`article_id` ASC) USING BTREE COMMENT '文章评论索引', INDEX `aiticle_id`(`article_id` ASC) USING BTREE COMMENT '文章评论索引',
INDEX `user_id`(`user_id` ASC) USING BTREE COMMENT '评论用户索引' INDEX `user_id`(`user_id` ASC) USING BTREE COMMENT '评论用户索引'
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '评论表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '评论表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tao_comment
-- ----------------------------
INSERT INTO `tao_comment` VALUES (1, 'https://www.aieok.com', 1, 1, 0, '0', '1', 1555127897, 1578977505, 0);
INSERT INTO `tao_comment` VALUES (2, 'face[嘻嘻] ddddd', 1, 1, 0, '0', '1', 1677900207, 1677975943, 1677975943);
INSERT INTO `tao_comment` VALUES (3, 'ddddfdfd', 1, 1, 0, '0', '1', 1677900215, 1677975943, 1677975943);
-- ---------------------------- -- ----------------------------
-- Table structure for tao_cunsult -- Table structure for tao_cunsult
@ -357,6 +359,10 @@ CREATE TABLE `tao_cunsult` (
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '反馈表' ROW_FORMAT = Dynamic; ) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '反馈表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tao_cunsult
-- ----------------------------
-- ---------------------------- -- ----------------------------
-- Table structure for tao_friend_link -- Table structure for tao_friend_link
-- ---------------------------- -- ----------------------------
@ -370,12 +376,14 @@ CREATE TABLE `tao_friend_link` (
`update_time` int NOT NULL COMMENT '更新时间', `update_time` int NOT NULL COMMENT '更新时间',
`delete_time` int NOT NULL, `delete_time` int NOT NULL,
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '友情链接' ROW_FORMAT = Dynamic; ) ENGINE = MyISAM AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '友情链接' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of tao_friend_link -- Records of tao_friend_link
-- ---------------------------- -- ----------------------------
INSERT INTO `tao_friend_link` VALUES (1, 'taoler', 'https://www.aieok.com', '', 0, 0, 0); INSERT INTO `tao_friend_link` VALUES (1, 'taobao', 'https://www.taobao.com', '', 0, 0, 0);
INSERT INTO `tao_friend_link` VALUES (2, 'baidu', 'https://www.baidu.com', '', 0, 0, 0);
INSERT INTO `tao_friend_link` VALUES (3, 'tensent', 'https://www.qq.com', '', 0, 0, 0);
-- ---------------------------- -- ----------------------------
-- Table structure for tao_mail_server -- Table structure for tao_mail_server
@ -413,7 +421,13 @@ CREATE TABLE `tao_message` (
`update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间', `update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间', `delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息表' ROW_FORMAT = Dynamic; ) ENGINE = MyISAM AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tao_message
-- ----------------------------
INSERT INTO `tao_message` VALUES (1, '测试后台帖子', '评论通知', 1, 'http://www.tp6.com/index/ask/1.html', 2, 1677900207, 1677900207, 0);
INSERT INTO `tao_message` VALUES (2, '测试后台帖子', '评论通知', 1, 'http://www.tp6.com/index/ask/1.html', 2, 1677900215, 1677900215, 0);
-- ---------------------------- -- ----------------------------
-- Table structure for tao_message_to -- Table structure for tao_message_to
@ -430,7 +444,13 @@ CREATE TABLE `tao_message_to` (
`update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间', `update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间', `delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息详细表' ROW_FORMAT = Dynamic; ) ENGINE = MyISAM AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息详细表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tao_message_to
-- ----------------------------
INSERT INTO `tao_message_to` VALUES (1, 1, 1, '1', 2, 0, 1677900207, 1677900207, 0);
INSERT INTO `tao_message_to` VALUES (2, 1, 1, '2', 2, 0, 1677900215, 1677900215, 0);
-- ---------------------------- -- ----------------------------
-- Table structure for tao_push_jscode -- Table structure for tao_push_jscode
@ -447,6 +467,10 @@ CREATE TABLE `tao_push_jscode` (
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '站长平台自动推送js代码' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '站长平台自动推送js代码' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tao_push_jscode
-- ----------------------------
-- ---------------------------- -- ----------------------------
-- Table structure for tao_slider -- Table structure for tao_slider
-- ---------------------------- -- ----------------------------
@ -465,7 +489,13 @@ CREATE TABLE `tao_slider` (
`update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间', `update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间', `delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; ) ENGINE = MyISAM AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tao_slider
-- ----------------------------
INSERT INTO `tao_slider` VALUES (1, 'CODING', 1, '/storage/slider/F1.jpg', '#', '', 1574870400, 1575043200, '1', 0, 0, 0);
INSERT INTO `tao_slider` VALUES (2, '通用右栏底部广告', 2, '/storage/slider/20200101/851c0b88a72590293bcb45454bdce056.jpg', 'https://www.aieok.com', '', 1571155200, 1609344000, '1', 0, 0, 0);
-- ---------------------------- -- ----------------------------
-- Table structure for tao_system -- Table structure for tao_system
@ -526,6 +556,10 @@ CREATE TABLE `tao_tag` (
INDEX `ename`(`ename` ASC) USING BTREE COMMENT 'ename查询tag索引' INDEX `ename`(`ename` ASC) USING BTREE COMMENT 'ename查询tag索引'
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文章tag表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文章tag表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tao_tag
-- ----------------------------
-- ---------------------------- -- ----------------------------
-- Table structure for tao_taglist -- Table structure for tao_taglist
-- ---------------------------- -- ----------------------------
@ -621,6 +655,10 @@ CREATE TABLE `tao_user_sign` (
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户签到表' ROW_FORMAT = Fixed; ) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户签到表' ROW_FORMAT = Fixed;
-- ----------------------------
-- Records of tao_user_sign
-- ----------------------------
-- ---------------------------- -- ----------------------------
-- Table structure for tao_user_signrule -- Table structure for tao_user_signrule
-- ---------------------------- -- ----------------------------
@ -676,11 +714,15 @@ DROP TABLE IF EXISTS `tao_user_zan`;
CREATE TABLE `tao_user_zan` ( CREATE TABLE `tao_user_zan` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '点赞主键id', `id` int NOT NULL AUTO_INCREMENT COMMENT '点赞主键id',
`article_id` int NULL DEFAULT NULL COMMENT '文章id', `article_id` int NULL DEFAULT NULL COMMENT '文章id',
`comment_id` int NULL DEFAULT NULL COMMENT '评论id', `comment_id` int NOT NULL COMMENT '评论id',
`user_id` int NOT NULL COMMENT '用户id', `user_id` int NOT NULL COMMENT '用户id',
`type` tinyint NOT NULL DEFAULT 2 COMMENT '1文章点赞2评论点赞', `type` tinyint NOT NULL DEFAULT 2 COMMENT '1文章点赞2评论点赞',
`create_time` int NOT NULL DEFAULT 0 COMMENT '点赞时间', `create_time` int NOT NULL DEFAULT 0 COMMENT '点赞时间',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed; ) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Records of tao_user_zan
-- ----------------------------
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;

View File

@ -25,18 +25,16 @@ class UserLogin
*/ */
public function handle($user) public function handle($user)
{ {
$type = $user->user['type']; $type = $user->user['type'];
$id = $user->user['id']; $id = $user->user['id'];
$u = User::find($id);
$ip = request()->ip();
$url = 'http://ip-api.com/json/' . $ip . '?lang=zh-CN&fields=57361';
$city = 'earth';
//日志
if($type == 'log'){
//$name = $user->user['name'];
$u = User::find($id);
//日志
if($type == 'log'){
//$name = $user->user['name'];
$ip = request()->ip();
$url = 'http://ip-api.com/json/' . $ip . '?lang=zh-CN&fields=57361';
$city = 'earth';
try{ try{
$ipInfo = HttpHelper::get($url)->toJson(); $ipInfo = HttpHelper::get($url)->toJson();
if($ipInfo->status == 'success') if($ipInfo->status == 'success')
@ -64,21 +62,20 @@ class UserLogin
// } // }
// } // }
} $u->allowField(['city','last_login_ip','last_login_time','login_error_num'])->save(
[
'city' => $city,
'last_login_ip' => $ip,
'last_login_time' => time(),
'login_error_num' => 0
]
);
Log::channel('login')->info('login:{user} {ip}',['user'=>$u->name,'ip'=>$ip]);
}
if($type == 'logError'){ if($type == 'logError'){
$u->allowField(['login_error_num','login_error_time'])->save(['login_error_num'=>$u->login_error_num + 1,'login_error_time'=>time()]); $res = $u->allowField(['login_error_num','login_error_time'])->save(['login_error_num'=>$u->login_error_num + 1,'login_error_time'=>time()]);
} }
$u->allowField(['city','last_login_ip','last_login_time','login_error_num'])->save(
[
'city' => $city,
'last_login_ip' => $ip,
'last_login_time' => time(),
'login_error_num' => 0
]
);
Log::channel('login')->info('login:{user} {ip}',['user'=>$u->name,'ip'=>$ip]);
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "taoser/taoler", "name": "taoser/taoler",
"description": "the new thinkphp taolerCMS system", "description": "the new thinkphp taoler bbs system",
"type": "project", "type": "project",
"keywords": [ "keywords": [
"taoler", "taoler",
@ -24,6 +24,7 @@
"topthink/think-view": "^1.0", "topthink/think-view": "^1.0",
"topthink/think-captcha": "^3.0", "topthink/think-captcha": "^3.0",
"phpmailer/phpmailer": "^6.1", "phpmailer/phpmailer": "^6.1",
"firebase/php-jwt": "^5.2",
"lotofbadcode/phpspirit_databackup": "^1.1", "lotofbadcode/phpspirit_databackup": "^1.1",
"wamkj/thinkphp6.0-databackup": "^1.0", "wamkj/thinkphp6.0-databackup": "^1.0",
"taoser/think-addons": "^1.0", "taoser/think-addons": "^1.0",

699
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@ return [
// 应用名,此项不可更改 // 应用名,此项不可更改
'appname' => 'TaoLer', 'appname' => 'TaoLer',
// 版本配置 // 版本配置
'version' => '2.3.9', 'version' => '2.3.0',
// 加盐 // 加盐
'salt' => 'taoler', 'salt' => 'taoler',
// 数据库备份目录 // 数据库备份目录

View File

@ -14,7 +14,6 @@ use think\Response;
class Api class Api
{ {
public $code;
/** /**
* @param $url * @param $url
* @param $data * @param $data

View File

@ -28,10 +28,9 @@ class Files
$arr = array(); $arr = array();
$data = scandir($path); $data = scandir($path);
foreach ($data as $value){ foreach ($data as $value){
if (in_array($value, ['.', '..','.gitignore'])) continue; if($value !='.' && $value != '..' && !stripos($value,".") && $value != '.gitignore'){
if(!stripos($value,".")) { $arr[] = strtolower($value);
$arr[] = strtolower($value); }
}
} }
//return array_merge(array_diff($arr, array('install'))); //return array_merge(array_diff($arr, array('install')));
return $arr; return $arr;

View File

@ -282,7 +282,7 @@ class FormHlp
$switchStr = $switchArr ? lang($switchArr[1]) . '|' . lang($switchArr[0]) : lang('open') . '|' . 'close'; $switchStr = $switchArr ? lang($switchArr[1]) . '|' . lang($switchArr[0]) : lang('open') . '|' . 'close';
$str = '<div class="layui-form-item">' .$this->label($label,$options) . ' $str = '<div class="layui-form-item">' .$this->label($label,$options) . '
<div class="layui-input-block"> <div class="layui-input-block">
<input ' . $this->addextend($options) . ' ' . $this->addstyle($options) . ' class="' . $this->addClass($options) . '" type="checkbox" value="' . $value . '" checked="'.$checked.'" name="' . $name . '" ' . $this->verify($options) . $this->filter($options) . $this->readonlyOrdisabled($options) . ' lay-skin="switch" lay-text="' . $switchStr . '" data-text="' . lang($value) . '"/> <input ' . $this->addextend($options) . ' ' . $this->addstyle($options) . ' class="' . $this->addClass($options) . '" type="checkbox" value="' . $value . '" checked="" name="' . $name . '" ' . $this->verify($options) . $this->filter($options) . $this->readonlyOrdisabled($options) . ' lay-skin="switch" lay-text="' . $switchStr . '" data-text="' . lang($value) . '"/>
' . $this->tips($options) . ' ' . $this->tips($options) . '
</div> </div>
</div>'; </div>';

View File

@ -32,9 +32,9 @@ if (!function_exists('form_switch')) {
* @param $value * @param $value
* @return string * @return string
*/ */
function form_switch($name, $switch=[], $option=[], $value='') function form_switch($name,$switch=[] , $option=[],$value='')
{ {
return FormHelper::switchs($name, $switch, $option, $value); return FormHelper::switchs($name,$switch , $option,$value);
} }
} }
if (!function_exists('form_checkbox')) { if (!function_exists('form_checkbox')) {

File diff suppressed because one or more lines are too long

View File

@ -14,17 +14,7 @@
/> />
<missing-glyph /> <missing-glyph />
<glyph glyph-name="edge" unicode="&#59019;" d="M240.185509 821.062741C322.180562 871.479699 415.37494 897.48813 509.969233 895.934224 845.948962 895.934224 1023.938224 648.353161 1023.938224 456.964708c-0.199988-65.396055-25.998431-127.79229-71.795669-174.389479-45.797237-46.397201-107.993485-72.995596-173.389539-73.995536-150.390927 0-182.98896 46.197213-182.98896 63.996139 0 7.599542 2.399855 12.399252 9.599421 18.798866l1.99988 2.399855 0.799951 3.199807c20.998733 22.998612 31.798082 52.396839 31.798082 83.194981 0 157.390504-164.390082 285.382782-367.977799 285.382782-75.075471 0.599964-149.071006-17.798926-215.027027-53.796754 53.996742 115.03306 165.430019 195.188224 182.628981 207.627473 1.599903 1.099934 0.599964 1.679899 0.599964 1.679899z m31.198118-636.081624c-2.799831-59.99638 9.199445-119.992761 32.798021-174.389479 27.198359-52.796815 65.396055-101.993847 112.993183-138.591638-118.992821 22.998612-222.966548 87.794703-298.781974 178.589225C42.237452 143.383627 0 259.176641 0 380.169341c0 102.393822 124.792471 188.78861 271.983591 188.78861 73.195584 1.199928 144.791264-21.798685 203.587717-65.396054l-7.199566-2.399856c-102.993786-35.197876-196.988115-181.389056-196.988115-316.180924zM939.543315 95.986486l-1.399915-0.199987c-23.598576-37.597732-51.796875-70.195765-84.394908-98.994028-61.596284-55.996622-136.191783-90.99451-217.586873-99.793979-37.197756-0.599964-73.59556 6.399614-107.593509 22.798624-51.196911 20.598757-94.194317 59.99638-123.192567 105.993605-28.798263 47.797116-42.197454 103.393762-37.997708 159.190396-1.199928 40.197575 10.799348 80.595138 29.99819 116.392978 27.798323-66.196006 74.995475-122.592604 135.191844-161.590251 60.196368-38.997647 130.992097-58.996441 202.787766-57.196549 61.99626-0.599964 124.192507 13.399192 180.389116 40.997526l3.799771 1.799892c7.799529 4.599722 15.399071 7.799529 23.1986 0 8.999457-9.799409 3.599783-18.39889-2.399855-27.998311-0.399976-0.399976-0.599964-0.99994-0.799952-1.399916z" horiz-adv-x="1024" /> <glyph glyph-name="github" unicode="&#59047;" d="M512 852.11428587c258.43809493 0 468.11428587-209.67619093 468.11428587-468.11428587 0-206.63344747-134.07573333-382.17630507-319.99512427-444.35748587-23.7568-4.2520384-32.29988587 10.37653333-32.29988587 22.54750507 0 15.25272427 0.62415253 65.80906667 0.62415254 128.6144 0 43.88571413-14.62857173 71.9335616-31.67573334 86.56213333 104.23344747 11.58582827 213.92822827 51.21950507 213.92822934 231.0144 0 51.21950507-18.29546667 92.6476192-48.13775254 125.57165654 4.87619093 12.2099808 20.7140576 59.7235808-4.87619093 124.32335253-39.00952427 12.2099808-128.6144-48.13775253-128.6144-48.13775253a440.02742827 440.02742827 0 0 1-234.0571424 0S305.4055616 670.4859424 266.3960384 658.2759616c-25.59024747-64.59977173-9.7523808-112.1523808-4.87619093-124.32335253-29.88129493-32.9240384-48.13775253-74.35215253-48.13775254-125.57165654 0-179.20975253 109.1096384-219.42857173 213.34308587-231.0144-13.41927573-12.2099808-25.59024747-32.9240384-29.88129493-62.76632426-26.83855253-12.2099808-95.1052192-32.9240384-135.9091808 39.00952426-25.59024747 44.50986667-71.9335616 48.13775253-71.93356267 48.13775254-45.7191616 0.62415253-3.0427424-28.63299093-3.0427424-28.63299094 30.4664384-14.0044192 51.80464747-68.26666667 51.80464747-68.26666666 27.42369493-83.51939093 157.8715424-55.4715424 157.87154346-55.4715424 0-39.00952427 0.62415253-75.56144747 0.62415147-87.1472768 0-12.2099808-8.54308587-26.83855253-32.2998848-22.547504C178.03946667 1.8627050699999472 43.96373333 177.40556160000006 43.96373333 384.03900907c0 258.43809493 209.67619093 468.11428587 468.11428587 468.11428586zM221.2620192 179.82415253c1.20929493 2.4576-0.62415253 5.5003424-4.2520384 7.2947808-3.66689493 1.20929493-6.7096384 0.62415253-7.91893333-1.20929493-1.20929493-2.4576 0.62415253-5.5003424 4.2520384-7.2947808 3.0427424-1.83344747 6.7096384-1.20929493 7.91893333 1.20929493z m18.88060907-20.75306666c2.4576 1.83344747 1.83344747 6.08548587-1.20929494 9.7523808-3.0427424 3.0427424-7.2947808 4.2520384-9.7523808 1.83344746-2.4576-1.83344747-1.83344747-6.08548587 1.20929494-9.7523808 3.0427424-3.0427424 7.2947808-4.2520384 9.7523808-1.83344746z m18.29546666-27.42369494c3.0427424 2.4576 3.0427424 7.2947808 0 11.58582827-2.4576 4.2520384-7.2947808 6.08548587-10.37653333 3.66689493-3.0427424-1.83344747-3.0427424-6.7096384 0-10.96167573s7.91893333-6.08548587 10.37653333-4.2520384z m25.59024747-25.59024853c2.4576 2.4576 1.20929493 7.91893333-2.4576 11.58582933-4.2520384 4.2520384-9.7523808 4.87619093-12.2099808 1.83344747-3.0427424-2.4576-1.83344747-7.91893333 2.4576-11.58582827 4.2520384-4.2520384 9.7523808-4.87619093 12.2099808-1.83344853z m34.75748587-15.2527232c1.20929493 3.66689493-2.4576 7.91893333-7.91893334 9.7523808-4.87619093 1.20929493-10.37653333-0.62415253-11.58582826-4.2520384s2.4576-7.91893333 7.91893333-9.12822827c4.87619093-1.83344747 10.37653333 0 11.58582827 3.66689494z m38.38537173-3.04274347c0 4.2520384-4.87619093 7.2947808-10.37653333 6.7096384-5.5003424 0-9.7523808-3.0427424-9.7523808-6.7096384 0-4.2520384 4.2520384-7.2947808 10.37653333-6.70963733 5.5003424 0 9.7523808 3.0427424 9.7523808 6.70963733z m35.34262827 6.08548587c-0.62415253 3.66689493-5.5003424 6.08548587-10.96167574 5.50034347-5.5003424-1.20929493-9.12822827-4.87619093-8.54308586-9.12822934 0.62415253-3.66689493 5.5003424-6.08548587 10.96167573-4.87618986s9.12822827 4.87619093 8.54308587 8.54308586z" horiz-adv-x="1024" />
<glyph glyph-name="leaf" unicode="&#59137;" d="M1017.948269 886.876437c-4.863707 5.785251-12.031275 9.113051-19.557222 9.113051l-26.110427 0c-258.032454 0.102394-461.847374 0.153591-611.905533-35.735447-80.635142-19.301237-142.992985-48.432282-190.606116-89.031436-51.401703-43.82456-86.420393-101.216302-107.155144-175.554223-13.77197-49.353826-20.222782-138.487656 6.96278-227.160714 10.034595-32.766026 25.700852-63.688963 46.589193-92.103251-62.255449-97.530124-116.063407-225.983185-116.063407-378.805977 0-14.130349 11.468109-25.598458 25.598458-25.598458s25.598458 11.468109 25.598458 25.598458c0 235.761795 139.665185 410.650458 222.91137 493.845446 59.7468 59.7468 127.275532 110.175762 195.367429 145.808815 63.381781 33.175601 123.947732 51.4529 170.536925 51.4529 14.130349 0 25.598458 11.468109 25.598458 25.598458s-11.468109 25.598458-25.598458 25.598458c-55.497456 0-122.667809-19.813206-194.241097-57.340545-72.597226-38.039308-144.477695-91.591282-207.80828-154.973063-26.72479-26.72479-58.876453-62.357843-90.823328-105.977615-12.389654 19.506025-22.014674 40.189579-28.619076 61.794677-25.598458 83.553366-16.178225 164.034917-6.604402 198.388047 73.211589 262.384191 351.313233 263.049751 855.858835 262.896161-60.156376-321.926204-172.328817-530.29765-333.599101-619.533873-149.597387-82.785412-297.966048-37.629733-354.845821-14.335136-11.980078 4.914904-24.06255 10.95614-35.786644 17.91892-12.133669 7.218765-27.851122 3.225406-35.069887-8.908263s-3.225406-27.851122 8.908263-35.069887c13.925561-8.2939 28.260697-15.461468 42.595834-21.349114 31.844481-13.004017 83.143791-29.694211 146.679163-35.172281 14.027955-1.228726 27.902319-1.791892 41.674289-1.791892 75.208269 0 145.860012 18.072511 210.675307 53.910352 82.375837 45.565255 153.641943 119.749585 211.904033 220.351524 68.296685 118.00889 119.698388 274.51786 152.720399 465.175173 1.279923 7.423553-0.767954 15.051893-5.631661 20.837145z" horiz-adv-x="1025" />
<glyph glyph-name="folder" unicode="&#60094;" d="M970.666667 682.666667H542.173333L429.793333 795.046667A52.986667 52.986667 0 0 1 392.08 810.666667H96a53.393333 53.393333 0 0 1-53.333333-53.333334v-704a53.393333 53.393333 0 0 1 53.333333-53.333333h874.666667a53.393333 53.393333 0 0 1 53.333333 53.333333V629.333333a53.393333 53.393333 0 0 1-53.333333 53.333334zM96 768h296.08a10.573333 10.573333 0 0 0 7.54-3.126667L481.826667 682.666667H96a53.546667 53.546667 0 0 1-10.666667-1.073334V757.333333a10.666667 10.666667 0 0 0 10.666667 10.666667z m885.333333-714.666667a10.666667 10.666667 0 0 0-10.666666-10.666666H96a10.666667 10.666667 0 0 0-10.666667 10.666666V629.333333a10.666667 10.666667 0 0 0 10.666667 10.666667h874.666667a10.666667 10.666667 0 0 0 10.666666-10.666667z" horiz-adv-x="1024" />
<glyph glyph-name="folder-open" unicode="&#60097;" d="M1003.153333 491.04a52.933333 52.933333 0 0 1-42.38 20.96H896V629.333333a53.393333 53.393333 0 0 1-53.333333 53.333334H461.253333a10.573333 10.573333 0 0 0-7.54 3.126666L344.46 795.046667A52.986667 52.986667 0 0 1 306.746667 810.666667H53.333333a53.393333 53.393333 0 0 1-53.333333-53.333334v-704a53.393333 53.393333 0 0 1 53.333333-53.333333h796.893334a53.453333 53.453333 0 0 1 51.453333 39.333333l110.546667 405.333334a52.953333 52.953333 0 0 1-9.073334 46.373333zM53.333333 768h253.413334a10.573333 10.573333 0 0 0 7.54-3.126667l109.253333-109.253333A52.986667 52.986667 0 0 1 461.253333 640H842.666667a10.666667 10.666667 0 0 0 10.666666-10.666667v-117.333333H173.773333a53.453333 53.453333 0 0 1-51.453333-39.333333L42.666667 180.633333V757.333333a10.666667 10.666667 0 0 0 10.666666 10.666667z m917.726667-312.14l-110.546667-405.333333a10.666667 10.666667 0 0 0-10.286666-7.86H63.226667a10.666667 10.666667 0 0 0-10.286667 13.473333l110.546667 405.333333A10.666667 10.666667 0 0 0 173.773333 469.333333h787a10.666667 10.666667 0 0 0 10.286667-13.473333z" horiz-adv-x="1024" />
<glyph glyph-name="gitee" unicode="&#59035;" d="M512-128C229.222-128 0 101.222 0 384S229.222 896 512 896s512-229.222 512-512-229.222-512-512-512z m259.149 568.883h-290.74a25.293 25.293 0 0 1-25.292-25.293l-0.026-63.206c0-13.952 11.315-25.293 25.267-25.293h177.024c13.978 0 25.293-11.315 25.293-25.267v-12.646a75.853 75.853 0 0 0-75.853-75.853h-240.23a25.293 25.293 0 0 0-25.267 25.293V478.797a75.853 75.853 0 0 0 75.827 75.853h353.946a25.293 25.293 0 0 1 25.267 25.292l0.077 63.207a25.293 25.293 0 0 1-25.268 25.293H417.152a189.62 189.62 0 0 1-189.62-189.645V124.85c0-13.977 11.316-25.293 25.294-25.293h372.94a170.65 170.65 0 0 1 170.65 170.65V415.616a25.293 25.293 0 0 1-25.293 25.267z" horiz-adv-x="1024" />
<glyph glyph-name="github" unicode="&#59047;" d="M512 883.32190493c275.66730126 0 499.32190493-223.65460366 499.32190493-499.32190493 0-220.40901063-143.01411555-407.65472541-341.32813256-473.98131826-25.34058667-4.53550763-34.45321159 11.06830222-34.45321159 24.05067207 0 16.26957255 0.6657627 70.19633778 0.66576271 137.18869334 0 46.81142841-15.60380985 76.72913237-33.7874489 92.33294222 111.18234397 12.35821682 228.19011015 54.63413874 228.1901113 246.41536 0 54.63413874-19.51516445 98.82412715-51.34693604 133.9431003 5.20127033 13.02397952 22.09499477 63.70515285-5.20127033 132.61157604-41.61015922 13.02397952-137.18869333-51.34693603-137.18869333-51.34693604a469.36259015 469.36259015 0 0 1-249.6609519 0S291.63259904 689.58500523 250.02244096 676.56102571c-27.29626397-68.90642318-10.40253952-119.62920619-5.20127033-132.61157604-31.87338126-35.11897429-51.34693603-79.3089627-51.34693604-133.9431003 0-191.15706937 116.38361429-234.05714318 227.56595826-246.41536-14.31389411-13.02397952-27.29626397-35.11897429-31.87338126-66.95074588-28.62778937-13.02397952-101.44556715-35.11897429-144.96979285 41.61015921-27.29626397 47.47719111-76.72913237 51.34693603-76.72913351 51.34693604-48.76710571 0.6657627-3.24559189-30.54185699-3.2455919-30.541857 32.49753429-14.93804715 55.25829063-72.81777778 55.25829064-72.81777777 29.25194126-89.08735033 168.39631189-59.16964523 168.39631302-59.16964523 0-41.61015922 0.6657627-80.5988773 0.66576157-92.95709525 0-13.02397952-9.11262493-28.62778937-34.45321045-24.05067094C155.77543111-23.61311459000001 12.76131555 163.63259903999995 12.76131555 384.04160967c0 275.66730126 223.65460366 499.32190493 499.32190493 499.32190492zM201.87948715 166.21242937c1.28991459 2.62144-0.6657627 5.86703189-4.53550763 7.78109952-3.91135459 1.28991459-7.15694763 0.6657627-8.44686222-1.2899146-1.28991459-2.62144 0.6657627-5.86703189 4.53550763-7.78109952 3.24559189-1.9556773 7.15694763-1.28991459 8.44686222 1.2899146z m20.13931634-22.13660444c2.62144 1.9556773 1.9556773 6.49118493-1.2899146 10.40253952-3.24559189 3.24559189-7.78109952 4.53550763-10.40253952 1.95567729-2.62144-1.9556773-1.9556773-6.49118493 1.2899146-10.40253952 3.24559189-3.24559189 7.78109952-4.53550763 10.40253952-1.95567729z m19.51516444-29.25194127c3.24559189 2.62144 3.24559189 7.78109952 0 12.35821682-2.62144 4.53550763-7.78109952 6.49118493-11.06830222 3.91135459-3.24559189-1.9556773-3.24559189-7.15694763 0-11.69245411s8.44686222-6.49118493 11.06830222-4.53550763z m27.29626396-27.2962651c2.62144 2.62144 1.28991459 8.44686222-2.62144 12.35821795-4.53550763 4.53550763-10.40253952 5.20127033-13.02397952 1.9556773-3.24559189-2.62144-1.9556773-8.44686222 2.62144-12.35821682 4.53550763-4.53550763 10.40253952-5.20127033 13.02397952-1.95567843z m37.0746516-16.26957141c1.28991459 3.91135459-2.62144 8.44686222-8.44686223 10.40253952-5.20127033 1.28991459-11.06830222-0.6657627-12.35821681-4.53550763s2.62144-8.44686222 8.44686222-9.73677682c5.20127033-1.9556773 11.06830222 0 12.35821682 3.9113546z m40.94439651-3.24559304c0 4.53550763-5.20127033 7.78109952-11.06830222 7.15694763-5.86703189 0-10.40253952-3.24559189-10.40253952-7.15694763 0-4.53550763 4.53550763-7.78109952 11.06830222-7.15694648 5.86703189 0 10.40253952 3.24559189 10.40253952 7.15694648z m37.69880349 6.49118493c-0.6657627 3.91135459-5.86703189 6.49118493-11.69245412 5.86703303-5.86703189-1.28991459-9.73677682-5.20127033-9.11262492-9.73677796 0.6657627-3.91135459 5.86703189-6.49118493 11.69245411-5.20126918s9.73677682 5.20127033 9.11262493 9.11262492z" horiz-adv-x="1024" />
<glyph glyph-name="disabled" unicode="&#59084;" d="M509.20496914 834c-245.9627332 0-447.20496914-201.24223594-447.20496914-447.20496914s201.24223594-447.20496914 447.20496914-447.20496914 447.20496914 201.24223594 447.20496914 447.20496914-201.24223594 447.20496914-447.20496914 447.20496914zM509.20496914-10.09937930000001C291.19254628-10.09937930000001 112.31055898 168.78260888 112.31055898 386.79503086c0 95.03105625 33.54037295 184.4720499 95.03105625 257.14285752l553.41614883-553.41614883C693.67701904 23.440993649999996 604.23602451-10.09937930000001 509.20496914-10.09937930000001z m296.27329131 134.16149092l-559.00621055 553.41614883C319.14285752 738.96894375 408.58385117 778.0993793 509.20496914 778.0993793c218.01242197 0 396.89441016-178.8819873 396.89441016-396.89441016 0-95.03105625-39.13043467-190.06211162-100.62111885-257.14285752z" horiz-adv-x="1024" /> <glyph glyph-name="disabled" unicode="&#59084;" d="M509.20496914 834c-245.9627332 0-447.20496914-201.24223594-447.20496914-447.20496914s201.24223594-447.20496914 447.20496914-447.20496914 447.20496914 201.24223594 447.20496914 447.20496914-201.24223594 447.20496914-447.20496914 447.20496914zM509.20496914-10.09937930000001C291.19254628-10.09937930000001 112.31055898 168.78260888 112.31055898 386.79503086c0 95.03105625 33.54037295 184.4720499 95.03105625 257.14285752l553.41614883-553.41614883C693.67701904 23.440993649999996 604.23602451-10.09937930000001 509.20496914-10.09937930000001z m296.27329131 134.16149092l-559.00621055 553.41614883C319.14285752 738.96894375 408.58385117 778.0993793 509.20496914 778.0993793c218.01242197 0 396.89441016-178.8819873 396.89441016-396.89441016 0-95.03105625-39.13043467-190.06211162-100.62111885-257.14285752z" horiz-adv-x="1024" />
@ -68,6 +58,8 @@
<glyph glyph-name="chrome" unicode="&#59018;" d="M515.436 583.685H914.285C840.842 730.955 688.748 832.132 513 832.132c-141.284 0-267.274-65.395-349.42-167.546l151.66-262.682c8.535 102.325 95.704 181.781 200.196 181.781zM514.218 550.803c-91.476 0-165.631-74.155-165.631-165.631s74.155-165.631 165.631-165.631c52.7 0 99.615 24.642 129.95 62.999l1.428 2.474 0.355-0.205c21.252 27.852 33.898 62.624 33.898 100.363 0 84.774-63.702 154.626-145.841 164.413l-6.393 0.632c-4.424 0.354-8.882 0.586-13.397 0.586zM929.561 549.585H627.443c52.209-36.066 86.506-96.297 86.506-164.413 0-45.547-18.268-81.598-41.12-121.192L483.898-63.257c9.624-0.617 19.322-0.966 29.102-0.966 247.521 0 448.177 200.656 448.177 448.177 0 58.508-11.225 114.391-31.616 165.631zM514.218 185.441c-83.583 0-144.927 54.804-185.034 124.651l-0.235-0.136-187.482 324.727C93.081 563.124 64.823 476.84 64.823 383.954c0-225.02 165.839-411.288 381.958-443.298l152.278 263.752c-25.769-12.143-54.518-18.967-84.841-18.967z" horiz-adv-x="1024" /> <glyph glyph-name="chrome" unicode="&#59018;" d="M515.436 583.685H914.285C840.842 730.955 688.748 832.132 513 832.132c-141.284 0-267.274-65.395-349.42-167.546l151.66-262.682c8.535 102.325 95.704 181.781 200.196 181.781zM514.218 550.803c-91.476 0-165.631-74.155-165.631-165.631s74.155-165.631 165.631-165.631c52.7 0 99.615 24.642 129.95 62.999l1.428 2.474 0.355-0.205c21.252 27.852 33.898 62.624 33.898 100.363 0 84.774-63.702 154.626-145.841 164.413l-6.393 0.632c-4.424 0.354-8.882 0.586-13.397 0.586zM929.561 549.585H627.443c52.209-36.066 86.506-96.297 86.506-164.413 0-45.547-18.268-81.598-41.12-121.192L483.898-63.257c9.624-0.617 19.322-0.966 29.102-0.966 247.521 0 448.177 200.656 448.177 448.177 0 58.508-11.225 114.391-31.616 165.631zM514.218 185.441c-83.583 0-144.927 54.804-185.034 124.651l-0.235-0.136-187.482 324.727C93.081 563.124 64.823 476.84 64.823 383.954c0-225.02 165.839-411.288 381.958-443.298l152.278 263.752c-25.769-12.143-54.518-18.967-84.841-18.967z" horiz-adv-x="1024" />
<glyph glyph-name="edge" unicode="&#59019;" d="M854.794 669.297C797.923 743.783 683.626 823.59 548.62 830.822 136.707 852.889 85.742 435.448 85.742 435.448c55.449 53.038 58.01 97.116 163.936 154.293C673.983 818.768 676.394 476.432 676.394 476.432H346.111c-7.232 65.092 62.681 137.417 62.681 137.417-202.509-98.844-216.974-284.477-216.974-284.477s-28.93-279.655 219.385-364.034 452.029 42.189 452.029 42.189V193.16c-59.065-32.546-102.292-54.405-153.087-63.887-361.623-67.503-364.034 188.044-364.034 188.044h585.83c0 0.001 39.075 199.761-77.147 351.98z" horiz-adv-x="1024" />
<glyph glyph-name="heart" unicode="&#59020;" d="M512 4.100000000000023c-108.9 0-447.3 277.5-447.3 522.2 0 131 106.6 237.6 237.6 237.6 94.9 0 174.8-50.2 209.7-76.1 34.9 25.9 114.8 76.1 209.7 76.1 131 0 237.6-106.6 237.6-237.6 0-244.7-338.4-522.2-447.3-522.2zM302.3 708c-100.2 0-181.7-81.5-181.7-181.7 0-221 326.8-466.3 391.4-466.3s391.4 245.3 391.4 466.3c0 100.2-81.5 181.7-181.7 181.7-103.9 0-190.2-76-191.1-76.8-10.6-9.5-26.7-9.5-37.3 0-0.8 0.8-87.7 76.8-191 76.8z" horiz-adv-x="1024" /> <glyph glyph-name="heart" unicode="&#59020;" d="M512 4.100000000000023c-108.9 0-447.3 277.5-447.3 522.2 0 131 106.6 237.6 237.6 237.6 94.9 0 174.8-50.2 209.7-76.1 34.9 25.9 114.8 76.1 209.7 76.1 131 0 237.6-106.6 237.6-237.6 0-244.7-338.4-522.2-447.3-522.2zM302.3 708c-100.2 0-181.7-81.5-181.7-181.7 0-221 326.8-466.3 391.4-466.3s391.4 245.3 391.4 466.3c0 100.2-81.5 181.7-181.7 181.7-103.9 0-190.2-76-191.1-76.8-10.6-9.5-26.7-9.5-37.3 0-0.8 0.8-87.7 76.8-191 76.8z" horiz-adv-x="1024" />
<glyph glyph-name="key" unicode="&#59011;" d="M819.2 588.8c0-172.8-140.8-307.2-307.2-307.2-172.8 0-307.2 140.8-307.2 307.2C204.8 755.2 339.2 896 512 896S819.2 755.2 819.2 588.8L819.2 588.8zM512 838.4c-140.8 0-249.6-115.2-249.6-249.6 0-134.4 108.8-256 249.6-256s256 115.2 256 249.6S652.8 838.4 512 838.4L512 838.4zM480 300.79999999999995l64 0L544-128l-64 0L480 300.79999999999995 480 300.79999999999995zM512 192l192 0 0-64L512 128 512 192 512 192zM512 64l192 0 0-64L512 0 512 64 512 64z" horiz-adv-x="1024" /> <glyph glyph-name="key" unicode="&#59011;" d="M819.2 588.8c0-172.8-140.8-307.2-307.2-307.2-172.8 0-307.2 140.8-307.2 307.2C204.8 755.2 339.2 896 512 896S819.2 755.2 819.2 588.8L819.2 588.8zM512 838.4c-140.8 0-249.6-115.2-249.6-249.6 0-134.4 108.8-256 249.6-256s256 115.2 256 249.6S652.8 838.4 512 838.4L512 838.4zM480 300.79999999999995l64 0L544-128l-64 0L480 300.79999999999995 480 300.79999999999995zM512 192l192 0 0-64L512 128 512 192 512 192zM512 64l192 0 0-64L512 0 512 64 512 64z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 322 KiB

After

Width:  |  Height:  |  Size: 316 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,111 +0,0 @@
/**
images压缩扩展模块
changlin_zhao@qq.com
2021.5.25
**/
layui.define(['upload','layer'],function(exports){
var upload = layui.upload;
var layer = layui.layer;
var compressImage = {
uploads: function(obj){
//obj.preview(function(index, file, result){
//执行实例
var files = obj.pushFile();
var filesArry = [];
for (var key in files) { //将上传的文件转为数组形式
filesArry.push(files[key])
}
var index = filesArry.length - 1;
var file = filesArry[index]; //获取最后选择的图片,即处理多选情况
if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion.split(";")[1]
.replace(/[ ]/g, "").replace("MSIE", "")) < 9) {
return obj.upload(index, file)
}
canvasDataURL(file, function (blob) {
var aafile = new File([blob], file.name, {
type: file.type
})
var isLt1M;
if (file.size < aafile.size) {
isLt1M = file.size
} else {
isLt1M = aafile.size
}
if (isLt1M / 1024 / 1024 > 2) {
return layer.alert('上传图片过大!')
} else {
if (file.size < aafile.size) {
return obj.upload(index, file)
}
obj.upload(index, aafile)
}
})
function canvasDataURL(file, callback) { //压缩转化为base64
var reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = function (e) {
const img = new Image()
const quality = 0.8 // 图像质量
const canvas = document.createElement('canvas')
const drawer = canvas.getContext('2d')
img.src = this.result
img.onload = function () {
var originWidth = img.width,/* 图片的宽度 */
originHeight = img.height; /* 图片的高度 */
// 设置最大尺寸限制将所有图片都压缩到小于1m
const maxWidth = 2560, maxHeight = 1600;
// 需要压缩的目标尺寸
let targetWidth = originWidth, targetHeight = originHeight;
// 等比例计算超过最大限制时缩放后的图片尺寸
if (originWidth > maxWidth || originHeight > maxHeight) {
if (originWidth / originHeight > 1) {
// 宽图片
targetWidth = maxWidth;
targetHeight = Math.round(maxWidth * (originHeight / originWidth));
} else {
// 高图片
targetHeight = maxHeight;
targetWidth = Math.round(maxHeight * (originWidth / originHeight));
}
}
canvas.width = targetWidth;
canvas.height = targetHeight;
drawer.drawImage(img, 0, 0, canvas.width, canvas.height)
convertBase64UrlToBlob(canvas.toDataURL(file.type, quality), callback);
}
}
}
function convertBase64UrlToBlob(urlData, callback) { //将base64转化为文件格式
const arr = urlData.split(',')
const mime = arr[0].match(/:(.*?);/)[1]
const bstr = atob(arr[1])
let n = bstr.length
const u8arr = new Uint8Array(n)
while (n--) {
u8arr[n] = bstr.charCodeAt(n)
}
callback(new Blob([u8arr], {
type: mime
}));
}
//})
}
}
//输出 imgcom 接口
exports('imgcom', compressImage);
});

View File

@ -80,7 +80,7 @@ layui.define(['form', 'upload'], function(exports){
var field = data.field; var field = data.field;
var URL = $(this).data('url'); var URL = $(this).data('url');
$.post(URL, field,function(res){ $.post(URL, field,function(res){
if(res.code === 0){ if(res.code == 0){
layer.msg(res.msg,{icon:6,tiye:2000},function(){ layer.msg(res.msg,{icon:6,tiye:2000},function(){
location.reload(); location.reload();
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 322 KiB

After

Width:  |  Height:  |  Size: 299 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,14 @@
 /**
@Name: Fly社区
@Author: 贤心
@Site: fly.layui.com
*/
/* 全局 */ /* 全局 */
html,body{overflow-x: hidden;} html,body{overflow-x: hidden;}
html body{margin-top: 61px;} html body{margin-top: 61px;}
html{background-color: #F2F2F2;} html{background-color: #F2F2F2;}
i{font-style: normal;} i{font-style: normal;}
h1,h2,h3 {font-weight: 400;}
/* 布局 */ /* 布局 */
.layui-mm{position: fixed; top: 100px; bottom: 0;} .layui-mm{position: fixed; top: 100px; bottom: 0;}
@ -181,11 +185,9 @@ pre{overflow-y: auto;
/* 头部 */ /* 头部 */
.fly-header{position: fixed; left: 0; top: 0; z-index: 10000; width: 100%; height: 60px; border-bottom: 1px solid #404553; border-right: 1px solid #404553; border-radius: 0;} .fly-header{position: fixed; left: 0; top: 0; z-index: 10000; width: 100%; height: 60px; border-bottom: 1px solid #404553; border-right: 1px solid #404553; border-radius: 0;}
.fly-header .layui-container{position: relative; height: 100%; line-height: 60px; text-align: center;} .fly-logo{position: absolute; left: 15px; top: 11px;}
.fly-logo{position: absolute; left: 15px;} .fly-logo-m{position: absolute; left:calc(50% - 45px); top: 11px;}
.fly-logo img {width:135px; height: 37px;} .fly-nav{margin-left: 200px;}
.fly-logo-m{width: 91px;}
.fly-nav{position: absolute; left: 200px;}
.fly-nav a i{position: absolute; left: 15px; top: 0; padding-right: 10px; font-size: 22px;} .fly-nav a i{position: absolute; left: 15px; top: 0; padding-right: 10px; font-size: 22px;}
.fly-nav a .icon-shouye, .nav a .icon-shezhi{top: 2px;} .fly-nav a .icon-shouye, .nav a .icon-shezhi{top: 2px;}
@ -196,7 +198,7 @@ pre{overflow-y: auto;
.fly-nav-avatar .fly-badge-vip{position: relative; margin-left: 10px;} .fly-nav-avatar .fly-badge-vip{position: relative; margin-left: 10px;}
.fly-nav-user .layui-nav-child a i{position: relative; top: 2px; margin-right: 10px; font-size: 26px;} .fly-nav-user .layui-nav-child a i{position: relative; top: 2px; margin-right: 10px; font-size: 26px;}
.fly-nav-msg{position:absolute; top: 10px; right: 1px; width:16px; height: 16px; line-height: 16px; background-color: #FF7200; color: #fff; font-size:12px; border-radius: 10px;} .fly-nav-msg{position:absolute; top: 50%; right: 5px; height: 20px; line-height: 20px; margin-top: -10px; padding:0 6px; background-color: #FF7200; color: #fff; border-radius: 2px;}
.fly-nav-msg:hover{color:#fff;} .fly-nav-msg:hover{color:#fff;}
.fly-header .layui-nav{padding: 0; background: none;} .fly-header .layui-nav{padding: 0; background: none;}
@ -210,30 +212,19 @@ pre{overflow-y: auto;
.fly-header .layui-nav .layui-nav-bar, .fly-header .layui-nav .layui-nav-bar,
.fly-header .fly-nav-user .layui-nav-more{display: none !important;} .fly-header .fly-nav-user .layui-nav-more{display: none !important;}
.fly-header .fly-nav-user .layui-nav-child{left: auto; right: 0; width: 120px; min-width: 0;} .fly-header .fly-nav-user .layui-nav-child{left: auto; right: 0; width: 120px; min-width: 0;}
/*
/*第二排导航*/ .fly-html-layui .fly-nav-avatar .layui-nav-more{display: none !important;}
.layui-nav.layui-bg-white { .fly-header .fly-nav-user .layui-nav-child{left: auto; right: 0; width: 120px; min-width: 0;}
background-color: #FFFFFF !important; .fly-html-layui .fly-nav-msg{left: -30px;}
color: #2F363C !important; .fly-html-layui .layui-header .layui-nav-child dd{text-align: center;}
} .fly-html-layui .layui-header .layui-nav-item a cite{padding: 0 0 0 10px;}
.layui-nav.layui-bg-white li a { .fly-html-layui .layui-header .layui-nav .fly-layui-user{margin: 0; margin-left: 40px;}
height: 50px; .fly-html-layui .layui-header .layui-nav .fly-layui-user a{padding: 0;}
color: #0A0E11; .fly-layui-user .layui-nav-child{left: auto; right: 0; min-width: 0; width: 120px;}
} */
.layui-nav.layui-bg-white li a:hover {
color: #0A0E11;
}
.layui-nav.layui-bg-white .layui-this:after {
content: none !important;
}
.layui-nav.layui-bg-white .layui-nav-item {
height: 50px;
line-height: 50px;
text-align: center;
}
/* 搜索 */ /* 搜索 */
.fly-search{display: inline-block; width: 50px; margin-right: 10px; cursor: pointer; font-size: 20px;} .fly-search{display: inline-block; vertical-align: top; width: 50px; height: 50px; padding-top:20px;margin-right: 10px; text-align: center; cursor: pointer; font-size: 20px;}
.fly-search .layui-icon{font-size: 20px;} .fly-search .layui-icon{font-size: 20px;}
.fly-search:hover{color: #5FB878;} .fly-search:hover{color: #5FB878;}
.fly-layer-search input{height: 75px; line-height: 75px; width: 500px; padding: 0 15px; font-size: 20px; border: none 0; background: none;} .fly-layer-search input{height: 75px; line-height: 75px; width: 500px; padding: 0 15px; font-size: 20px; border: none 0; background: none;}
@ -392,7 +383,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
.que-body .que-user-info .que-avatar i{position: absolute; left: 35px; top: 15px; } .que-body .que-user-info .que-avatar i{position: absolute; left: 35px; top: 15px; }
.que-body .que-user-info span{display: inline-block; font-size: 12px; padding-left: 5px;} .que-body .que-user-info span{display: inline-block; font-size: 12px; padding-left: 5px;}
/* 签到 */ /* 签到 */
.fly-signin cite{padding: 0 5px; color: #FF5722; font-style: normal;} .fly-signin cite{padding: 0 5px; color: #FF5722; font-style: normal;}
.fly-signin .layui-badge-dot{top: -7px; margin-left: 0px;} .fly-signin .layui-badge-dot{top: -7px; margin-left: 0px;}
.fly-signin-list{padding: 0; line-height: 30px;} .fly-signin-list{padding: 0; line-height: 30px;}
@ -525,7 +516,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
*/ */
.layui-form-pane{position:relative; width:100%;} .layui-form-pane{position:relative; width:100%;}
.que-comments{position:absolute; right:15px; bottom:15px;} .que-comments{position:absolute;right:20px;bottom:5px;}
.wenda-user{height:200px; margin: 0,auto; text-align: center; pardding-top:20px;} .wenda-user{height:200px; margin: 0,auto; text-align: center; pardding-top:20px;}
.wenda-user .user-img{posation:relative; width:100%;} .wenda-user .user-img{posation:relative; width:100%;}
@ -538,7 +529,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
.detail-zan span{padding-right:5px; color:#999; cursor:pointer;} .detail-zan span{padding-right:5px; color:#999; cursor:pointer;}
.detail-zan span:hover{color:#666;} .detail-zan span:hover{color:#666;}
.detail-zan span .icon-zan{font-size: 22px;} .detail-zan span .icon-zan{font-size: 22px;}
.detail-zan span img{height: 25px; width:25px; border-radius: 100%; object-fit: cover;} .detail-zan span img{height: 25px; border-radius: 100%;}
/* 详情页的底部操作条 */ /* 详情页的底部操作条 */
@ -578,7 +569,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
.detail-about-reply .detail-hits{left: 0; bottom: 0;} .detail-about-reply .detail-hits{left: 0; bottom: 0;}
.detail-about-reply .fly-avatar{left: 0; top: 0;} .detail-about-reply .fly-avatar{left: 0; top: 0;}
.jieda-body{margin: 10px 0; min-height: 0; line-height: 24px; font-size:14px;} .jieda-body{margin: 25px 0 20px; min-height: 0; line-height: 24px; font-size:14px;}
.jieda-body p{margin-bottom: 10px;} .jieda-body p{margin-bottom: 10px;}
.jieda-body a{color:#4f99cf} .jieda-body a{color:#4f99cf}
.jieda-reply{position:relative; font-size: 14px} .jieda-reply{position:relative; font-size: 14px}
@ -600,10 +591,6 @@ body .fly-user-main{position: relative; min-height: 600px;}
.fly-user-main .fly-none{min-height: 0;} .fly-user-main .fly-none{min-height: 0;}
.fly-panel-user[pad20]{padding-top: 5px;} .fly-panel-user[pad20]{padding-top: 5px;}
@media screen and (min-width: 768px) {
.fly-panel-user{height: calc(100vh - 280px)}
}
.fly-form-app{margin-top:30px;} .fly-form-app{margin-top:30px;}
.fly-form-app .iconfont{font-size:26px; padding: 0 5px;} .fly-form-app .iconfont{font-size:26px; padding: 0 5px;}
.fly-form-app .icon-qq{color:#7CA9C9} .fly-form-app .icon-qq{color:#7CA9C9}
@ -725,7 +712,7 @@ body .fly-user-main{position: relative; min-height: 600px;}
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.fly-main{width: 100%;} .fly-main{width: 100%;}
/* 顶边距 */ /* 顶边距 */
.fly-marginTop{margin-top: 0;} .fly-marginTop{margin-top: 0;}
@ -839,7 +826,7 @@ blockquote {
@media (max-width:767px) {.footer-col {margin-right:0} @media (max-width:767px) {.footer-col {margin-right:0}
} }
@media (max-width:1239px) { @media (max-width:1239px) {
.footer-col-logo {display:none} .footer-col-logo {display:none}
} }
.footer-col-logo img {display:block;max-width:160px;max-height:60px;height:auto} .footer-col-logo img {display:block;max-width:160px;max-height:60px;height:auto}
.footer-col-sns {float:right;margin-right:0} .footer-col-sns {float:right;margin-right:0}
@ -869,19 +856,19 @@ blockquote {
@media (min-width: 768px) { @media (min-width: 768px) {
.container { .container {
width:750px; width:750px;
} }
} }
@media (min-width: 992px) { @media (min-width: 992px) {
.container { .container {
width:970px; width:970px;
} }
} }
@media (min-width: 1200px) { @media (min-width: 1200px) {
.container { .container {
width:1170px; width:1170px;
} }
} }
@ -896,189 +883,3 @@ blockquote {
.layui-fixbar li { .layui-fixbar li {
border-radius:100%; border-radius:100%;
} }
/*首页列表新增*/
.section {
display: block;
}
.list-grid.list-grid-padding .list-item {
padding: 1rem;
}
.list-grid .list-item {
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
}
.list-item {
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
}
.list-grid .list-item .media {
border-radius: inherit;
}
.media {
position: relative;
display: block;
overflow: hidden;
padding: 0;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
border-radius: inherit;
}
.media-content img{
width: 233px;
height: 155px;
border-radius: 5px;
object-fit: cover;
}
.d-none {
display: none !important;
}
.media {
display: -ms-flexbox;
display: flex;
-ms-flex-align: start;
align-items: flex-start;
}
.col-4 {
-ms-flex: 0 0 33.333333%;
flex: 0 0 33.333333%;
max-width: 33.333333%;
}
.card, .block {
background: #fff;
border-width: 0;
border-radius: 2px;
-webkit-box-shadow: 0 0 10px -2px rgba(158,158,158,.2);
box-shadow: 0 0 10px -2px rgba(158,158,158,.2);
}
.list-grid.list-grid-padding .list-content {
padding: 0 0 0 1rem;
}
.list-width {
width: 100%;
}
.list-content {
padding: 1rem 0;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
-webkit-box-flex: 1;
flex: 1 1 auto;
-webkit-box-pack: center;
justify-content: center;
min-width: 0;
}
.list-body {
-webkit-box-flex: 1;
flex: 1 1 auto;
}
.h-3x {
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
line-height: 1.7;
}
.text-secondary {
color: #5e646d !important;
}
.text-sm {
font-size: .875rem !important;
}
.text-secondary {
color: #6c757d !important;
}
.mb-3, .my-3 {
margin-bottom: 1rem !important;
}
.mt-3, .my-3 {
margin-top: 1rem !important;
}
@media (min-width: 768px) {
.d-md-block {
display: block !important;
}
}
figure {
margin: 0;
}
@media (min-width: 768px){
.ml-md-2, .mx-md-2 {
margin-left: .5rem !important;
}
}
@media (min-width: 768px){
.mr-md-2, .mx-md-2 {
margin-right: .5rem !important;
}
}
.ml-1, .mx-1 {
margin-left: .25rem !important;
}
.mr-1, .mx-1 {
margin-right: .25rem !important;
}
.d-inline-block {
display: inline-block !important;
}
.text-muted {
color: #9ca0ad !important;
}
.text-xs {
font-size: .75rem !important;
}
.text-muted {
color: #6c757d !important;
}
.align-items-center {
-ms-flex-align: center !important;
align-items: center !important;
}
.flex-fill {
-ms-flex: 1 1 auto !important;
flex: 1 1 auto !important;
}
.list-footer {
margin-top: .5rem;
}
.d-flex {
display: -ms-flexbox !important;
display: flex !important;
}
@media (min-width: 768px) and (max-width: 991.98px) {
.card, .block {margin-bottom: 1rem;}
}

View File

@ -1,105 +0,0 @@
/**
images压缩扩展模块
changlin_zhao@qq.com
2023.5.23
**/
layui.define(['upload','layer'],function(exports){
var layer = layui.layer;
var Compressor = {
upload: function (obj) {
// opthions = {
// width: option[0],
// height: option[1],
// quality: option[2]
// }
obj.preview(function(index, file, result){
canvasDataURL(result, {quality: 0.7}, function(base64Codes){
obj.upload(index, convertBase64UrlTo(base64Codes, file.name));
});
});
}
}
// 已知 base64
// canvasDataURL(base64, {quality: 0.7}, function(base64Codes){
// // base64Codes 为压缩后的
// // 其中 convertBase64UrlTo(base64Codes, file.name) 可返回 File 对象和 Blob
// obj.upload(index, convertBase64UrlTo(base64Codes, file.name));
// });
// 未知 base64
// imageCompress(file, {quality: 0.7}, function(base64Codes){
// // base64Codes 为压缩后的
// obj.upload(index, convertBase64UrlTo(base64Codes, file.name));
// });
/**
* 读取文件
* @param {file or Blob} file 上传文件
* @param {object} config 压缩配置 可配置压缩长宽质量等
* @param {function} callback
*/
function imageCompress(file, config, callback){
var ready = new FileReader();
ready.readAsDataURL(file);
ready.onload=function(){
canvasDataURL(this.result, config, callback)
}
}
/**
*
* @param {string} path
* @param {object} config -- {width: '', height: '', quality: 0.7}
* @param {function} callback
*/
function canvasDataURL(path, config, callback){
var img = new Image();
img.src = path;
img.onload = function(){
var that = this, quality = 0.7;
var w = that.width, h = that.height, scale = w / h;
w = config.width || w;
h = config.height || (w / scale);
//生成canvas
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
var anw = document.createAttribute("width");
anw.nodeValue = w;
var anh = document.createAttribute("height");
anh.nodeValue = h;
canvas.setAttributeNode(anw);
canvas.setAttributeNode(anh);
ctx.drawImage(that, 0, 0, w, h);
if(config.quality && config.quality <= 1 && config.quality > 0){
quality = config.quality;
}
callback(canvas.toDataURL('image/jpeg', quality));
}
}
/**
* 将图片 base64 转为 File 对象或者 Blob
* @param {*} urlData 图片 base64
* @param {*} filename 图片名 没有图片名将转为 Blob
*/
function convertBase64UrlTo(urlData, filename = null){
var base64Arr = urlData.split(','), mime = base64Arr[0].match(/:(.*?);/)[1],
bstr = atob(base64Arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while(n--){
u8arr[n] = bstr.charCodeAt(n);
}
return filename ? new File([u8arr], filename, {type:mime}) : new Blob([u8arr], {type:mime});
}
//输出 imagecut接口
exports('imagecut', Compressor);
});

View File

@ -696,6 +696,42 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'],
//console.log(othis.attr('src')); //console.log(othis.attr('src'));
}); });
//头条轮播
if($('#FLY_topline')[0]){
layui.use('carousel', function(){
var carousel = layui.carousel;
var ins = carousel.render({
elem: '#FLY_topline'
,width: '100%'
,height: '172px'
,anim: 'fade'
});
var resizeTopline = function(){
var width = $(this).prop('innerWidth');
if(width >= 1200){
ins.reload({
height: '172px'
});
} else if(width >= 992){
ins.reload({
height: '141px'
});
} else if(width >= 768){
ins.reload({
height: '166px'
});
}
};
resizeTopline()
$(window).on('resize', resizeTopline);
});
}
//签到 //签到
//活跃榜 //活跃榜

View File

@ -234,30 +234,28 @@ layui.define('fly', function(exports){
}); });
}); });
} }
}
,del: function(span){ //删除评论
if(taonystatus == 0) {
layer.confirm('确认删除该回答么?', function(index){
layer.close(index);
fly.json(commentJiedaDelete, {
id: li.data('id')
}, function(res){
if(res.status === 0){
var count = dom.jiedaCount.text()|0;
dom.jiedaCount.html(--count);
li.remove();
//如果删除了最佳答案
if(li.hasClass('jieda-daan')){
$('.jie-status').removeClass('jie-status-ok').text('求解中');
}
} else {
layer.msg(res.msg);
}
});
});
}
} }
,del: function(li){ //删除评论
layer.confirm('确认删除该回答么?', function(index){
layer.close(index);
fly.json(commentJiedaDelete, {
id: li.data('id')
}, function(res){
if(res.status === 0){
var count = dom.jiedaCount.text()|0;
dom.jiedaCount.html(--count);
li.remove();
//如果删除了最佳答案
if(li.hasClass('jieda-daan')){
$('.jie-status').removeClass('jie-status-ok').text('求解中');
}
} else {
layer.msg(res.msg);
}
});
});
}
}; };
$('.jieda-reply span').on('click', function(){ $('.jieda-reply span').on('click', function(){

File diff suppressed because it is too large Load Diff

View File

@ -294,7 +294,7 @@ layui.define(['laypage', 'fly', 'element', 'flow', 'imgcom'], function(exports){
//我的消息 //我的消息
gather.minemsg = function(){ gather.minemsg = function(){
var delAll = $('#LAY_delallmsg') var delAll = $('#LAY_delallmsg')
,tpl = '{{# var len = d.rows.length;\ ,tpl = '{{# var len = d.rows.length;\
if(len === 0){ }}\ if(len === 0){ }}\
<div class="fly-none">您暂时没有最新消息</div>\ <div class="fly-none">您暂时没有最新消息</div>\
{{# } else { }}\ {{# } else { }}\

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -42,37 +42,35 @@ namespace Composer\Autoload;
*/ */
class ClassLoader class ClassLoader
{ {
/** @var \Closure(string):void */ /** @var ?string */
private static $includeFile;
/** @var string|null */
private $vendorDir; private $vendorDir;
// PSR-4 // PSR-4
/** /**
* @var array<string, array<string, int>> * @var array[]
* @psalm-var array<string, array<string, int>>
*/ */
private $prefixLengthsPsr4 = array(); private $prefixLengthsPsr4 = array();
/** /**
* @var array<string, list<string>> * @var array[]
* @psalm-var array<string, array<int, string>>
*/ */
private $prefixDirsPsr4 = array(); private $prefixDirsPsr4 = array();
/** /**
* @var list<string> * @var array[]
* @psalm-var array<string, string>
*/ */
private $fallbackDirsPsr4 = array(); private $fallbackDirsPsr4 = array();
// PSR-0 // PSR-0
/** /**
* List of PSR-0 prefixes * @var array[]
* * @psalm-var array<string, array<string, string[]>>
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/ */
private $prefixesPsr0 = array(); private $prefixesPsr0 = array();
/** /**
* @var list<string> * @var array[]
* @psalm-var array<string, string>
*/ */
private $fallbackDirsPsr0 = array(); private $fallbackDirsPsr0 = array();
@ -80,7 +78,8 @@ class ClassLoader
private $useIncludePath = false; private $useIncludePath = false;
/** /**
* @var array<string, string> * @var string[]
* @psalm-var array<string, string>
*/ */
private $classMap = array(); private $classMap = array();
@ -88,29 +87,29 @@ class ClassLoader
private $classMapAuthoritative = false; private $classMapAuthoritative = false;
/** /**
* @var array<string, bool> * @var bool[]
* @psalm-var array<string, bool>
*/ */
private $missingClasses = array(); private $missingClasses = array();
/** @var string|null */ /** @var ?string */
private $apcuPrefix; private $apcuPrefix;
/** /**
* @var array<string, self> * @var self[]
*/ */
private static $registeredLoaders = array(); private static $registeredLoaders = array();
/** /**
* @param string|null $vendorDir * @param ?string $vendorDir
*/ */
public function __construct($vendorDir = null) public function __construct($vendorDir = null)
{ {
$this->vendorDir = $vendorDir; $this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
} }
/** /**
* @return array<string, list<string>> * @return string[]
*/ */
public function getPrefixes() public function getPrefixes()
{ {
@ -122,7 +121,8 @@ class ClassLoader
} }
/** /**
* @return array<string, list<string>> * @return array[]
* @psalm-return array<string, array<int, string>>
*/ */
public function getPrefixesPsr4() public function getPrefixesPsr4()
{ {
@ -130,7 +130,8 @@ class ClassLoader
} }
/** /**
* @return list<string> * @return array[]
* @psalm-return array<string, string>
*/ */
public function getFallbackDirs() public function getFallbackDirs()
{ {
@ -138,7 +139,8 @@ class ClassLoader
} }
/** /**
* @return list<string> * @return array[]
* @psalm-return array<string, string>
*/ */
public function getFallbackDirsPsr4() public function getFallbackDirsPsr4()
{ {
@ -146,7 +148,8 @@ class ClassLoader
} }
/** /**
* @return array<string, string> Array of classname => path * @return string[] Array of classname => path
* @psalm-return array<string, string>
*/ */
public function getClassMap() public function getClassMap()
{ {
@ -154,7 +157,8 @@ class ClassLoader
} }
/** /**
* @param array<string, string> $classMap Class to filename map * @param string[] $classMap Class to filename map
* @psalm-param array<string, string> $classMap
* *
* @return void * @return void
*/ */
@ -171,25 +175,24 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix, either * Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix. * appending or prepending to the ones previously set for this prefix.
* *
* @param string $prefix The prefix * @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 root directories * @param string[]|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories * @param bool $prepend Whether to prepend the directories
* *
* @return void * @return void
*/ */
public function add($prefix, $paths, $prepend = false) public function add($prefix, $paths, $prepend = false)
{ {
$paths = (array) $paths;
if (!$prefix) { if (!$prefix) {
if ($prepend) { if ($prepend) {
$this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0 = array_merge(
$paths, (array) $paths,
$this->fallbackDirsPsr0 $this->fallbackDirsPsr0
); );
} else { } else {
$this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0, $this->fallbackDirsPsr0,
$paths (array) $paths
); );
} }
@ -198,19 +201,19 @@ class ClassLoader
$first = $prefix[0]; $first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) { if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = $paths; $this->prefixesPsr0[$first][$prefix] = (array) $paths;
return; return;
} }
if ($prepend) { if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix] = array_merge(
$paths, (array) $paths,
$this->prefixesPsr0[$first][$prefix] $this->prefixesPsr0[$first][$prefix]
); );
} else { } else {
$this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix], $this->prefixesPsr0[$first][$prefix],
$paths (array) $paths
); );
} }
} }
@ -219,9 +222,9 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace, either * Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace. * appending or prepending to the ones previously set for this namespace.
* *
* @param string $prefix The prefix/namespace, with trailing '\\' * @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories * @param string[]|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories * @param bool $prepend Whether to prepend the directories
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* *
@ -229,18 +232,17 @@ class ClassLoader
*/ */
public function addPsr4($prefix, $paths, $prepend = false) public function addPsr4($prefix, $paths, $prepend = false)
{ {
$paths = (array) $paths;
if (!$prefix) { if (!$prefix) {
// Register directories for the root namespace. // Register directories for the root namespace.
if ($prepend) { if ($prepend) {
$this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4 = array_merge(
$paths, (array) $paths,
$this->fallbackDirsPsr4 $this->fallbackDirsPsr4
); );
} else { } else {
$this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4, $this->fallbackDirsPsr4,
$paths (array) $paths
); );
} }
} elseif (!isset($this->prefixDirsPsr4[$prefix])) { } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
@ -250,18 +252,18 @@ class ClassLoader
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
} }
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = $paths; $this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) { } elseif ($prepend) {
// Prepend directories for an already registered namespace. // Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix] = array_merge(
$paths, (array) $paths,
$this->prefixDirsPsr4[$prefix] $this->prefixDirsPsr4[$prefix]
); );
} else { } else {
// Append directories for an already registered namespace. // Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix], $this->prefixDirsPsr4[$prefix],
$paths (array) $paths
); );
} }
} }
@ -270,8 +272,8 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix, * Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix. * replacing any others previously set for this prefix.
* *
* @param string $prefix The prefix * @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 base directories * @param string[]|string $paths The PSR-0 base directories
* *
* @return void * @return void
*/ */
@ -288,8 +290,8 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace, * Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace. * replacing any others previously set for this namespace.
* *
* @param string $prefix The prefix/namespace, with trailing '\\' * @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories * @param string[]|string $paths The PSR-4 base directories
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* *
@ -423,8 +425,7 @@ class ClassLoader
public function loadClass($class) public function loadClass($class)
{ {
if ($file = $this->findFile($class)) { if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile; includeFile($file);
$includeFile($file);
return true; return true;
} }
@ -475,9 +476,9 @@ class ClassLoader
} }
/** /**
* Returns the currently registered loaders keyed by their corresponding vendor directories. * Returns the currently registered loaders indexed by their corresponding vendor directories.
* *
* @return array<string, self> * @return self[]
*/ */
public static function getRegisteredLoaders() public static function getRegisteredLoaders()
{ {
@ -554,26 +555,18 @@ class ClassLoader
return false; return false;
} }
}
/**
* @return void /**
*/ * Scope isolated include.
private static function initializeIncludeClosure() *
{ * Prevents access to $this/self from included files.
if (self::$includeFile !== null) { *
return; * @param string $file
} * @return void
* @private
/** */
* Scope isolated include. function includeFile($file)
* {
* Prevents access to $this/self from included files. include $file;
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
} }

View File

@ -98,7 +98,7 @@ class InstalledVersions
{ {
foreach (self::getInstalled() as $installed) { foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) { if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
} }
} }
@ -119,7 +119,7 @@ class InstalledVersions
*/ */
public static function satisfies(VersionParser $parser, $packageName, $constraint) public static function satisfies(VersionParser $parser, $packageName, $constraint)
{ {
$constraint = $parser->parseConstraints((string) $constraint); $constraint = $parser->parseConstraints($constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName)); $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint); return $provided->matches($constraint);
@ -328,9 +328,7 @@ class InstalledVersions
if (isset(self::$installedByVendor[$vendorDir])) { if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir]; $installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) { } elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1]; self::$installed = $installed[count($installed) - 1];
} }
@ -342,17 +340,12 @@ class InstalledVersions
// only require the installed.php file if this file is loaded from its dumped location, // only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') { if (substr(__DIR__, -8, 1) !== 'C') {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ self::$installed = require __DIR__ . '/installed.php';
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else { } else {
self::$installed = array(); self::$installed = array();
} }
} }
$installed[] = self::$installed;
if (self::$installed !== array()) {
$installed[] = self::$installed;
}
return $installed; return $installed;
} }

View File

@ -14,7 +14,7 @@ return array(
'think\\composer\\' => array($vendorDir . '/topthink/think-installer/src'), 'think\\composer\\' => array($vendorDir . '/topthink/think-installer/src'),
'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'), 'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'),
'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'), 'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'),
'think\\' => array($vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src', $vendorDir . '/topthink/framework/src/think'), 'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-template/src', $vendorDir . '/topthink/think-orm/src'),
'taoser\\think\\' => array($vendorDir . '/taoser/think-auth/src'), 'taoser\\think\\' => array($vendorDir . '/taoser/think-auth/src'),
'taoser\\' => array($vendorDir . '/taoser/think-addons/src', $vendorDir . '/taoser/think-setarr/src'), 'taoser\\' => array($vendorDir . '/taoser/think-addons/src', $vendorDir . '/taoser/think-setarr/src'),
'phpspirit\\databackup\\' => array($vendorDir . '/lotofbadcode/phpspirit_databackup/src'), 'phpspirit\\databackup\\' => array($vendorDir . '/lotofbadcode/phpspirit_databackup/src'),
@ -49,6 +49,7 @@ return array(
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'),
'Endroid\\QrCode\\' => array($vendorDir . '/endroid/qr-code/src'), 'Endroid\\QrCode\\' => array($vendorDir . '/endroid/qr-code/src'),
'DI\\' => array($vendorDir . '/php-di/php-di/src'), 'DI\\' => array($vendorDir . '/php-di/php-di/src'),
'DASPRiD\\Enum\\' => array($vendorDir . '/dasprid/enum/src'), 'DASPRiD\\Enum\\' => array($vendorDir . '/dasprid/enum/src'),

View File

@ -33,18 +33,25 @@ class ComposerAutoloaderInit1b32198725235c8d6500c87262ef30c2
$loader->register(true); $loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$files; $includeFiles = \Composer\Autoload\ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) { foreach ($includeFiles as $fileIdentifier => $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { composerRequire1b32198725235c8d6500c87262ef30c2($fileIdentifier, $file);
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}, null, null);
foreach ($filesToLoad as $fileIdentifier => $file) {
$requireFile($fileIdentifier, $file);
} }
return $loader; return $loader;
} }
} }
/**
* @param string $fileIdentifier
* @param string $file
* @return void
*/
function composerRequire1b32198725235c8d6500c87262ef30c2($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}

View File

@ -119,6 +119,10 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
'GuzzleHttp\\Promise\\' => 19, 'GuzzleHttp\\Promise\\' => 19,
'GuzzleHttp\\' => 11, 'GuzzleHttp\\' => 11,
), ),
'F' =>
array (
'Firebase\\JWT\\' => 13,
),
'E' => 'E' =>
array ( array (
'Endroid\\QrCode\\' => 15, 'Endroid\\QrCode\\' => 15,
@ -176,10 +180,10 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
), ),
'think\\' => 'think\\' =>
array ( array (
0 => __DIR__ . '/..' . '/topthink/think-helper/src', 0 => __DIR__ . '/..' . '/topthink/framework/src/think',
1 => __DIR__ . '/..' . '/topthink/think-orm/src', 1 => __DIR__ . '/..' . '/topthink/think-helper/src',
2 => __DIR__ . '/..' . '/topthink/think-template/src', 2 => __DIR__ . '/..' . '/topthink/think-template/src',
3 => __DIR__ . '/..' . '/topthink/framework/src/think', 3 => __DIR__ . '/..' . '/topthink/think-orm/src',
), ),
'taoser\\think\\' => 'taoser\\think\\' =>
array ( array (
@ -318,6 +322,10 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
array ( array (
0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
), ),
'Firebase\\JWT\\' =>
array (
0 => __DIR__ . '/..' . '/firebase/php-jwt/src',
),
'Endroid\\QrCode\\' => 'Endroid\\QrCode\\' =>
array ( array (
0 => __DIR__ . '/..' . '/endroid/qr-code/src', 0 => __DIR__ . '/..' . '/endroid/qr-code/src',

View File

@ -401,6 +401,72 @@
], ],
"install-path": "../endroid/qr-code" "install-path": "../endroid/qr-code"
}, },
{
"name": "firebase/php-jwt",
"version": "v5.5.1",
"version_normalized": "5.5.1.0",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
"reference": "83b609028194aa042ea33b5af2d41a7427de80e6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/83b609028194aa042ea33b5af2d41a7427de80e6",
"reference": "83b609028194aa042ea33b5af2d41a7427de80e6",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": ">=4.8 <=9"
},
"suggest": {
"paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
},
"time": "2021-11-08T20:18:51+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Firebase\\JWT\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Neuman Vong",
"email": "neuman+pear@twilio.com",
"role": "Developer"
},
{
"name": "Anant Narayanan",
"email": "anant@php.net",
"role": "Developer"
}
],
"description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
"homepage": "https://github.com/firebase/php-jwt",
"keywords": [
"jwt",
"php"
],
"support": {
"issues": "https://github.com/firebase/php-jwt/issues",
"source": "https://github.com/firebase/php-jwt/tree/v5.5.1"
},
"install-path": "../firebase/php-jwt"
},
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "7.0.0", "version": "7.0.0",
@ -491,24 +557,18 @@
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
"version": "1.5.3", "version": "1.5.2",
"version_normalized": "1.5.3.0", "version_normalized": "1.5.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/promises.git", "url": "https://github.com/guzzle/promises.git",
"reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" "reference": "b94b2807d85443f9719887892882d0329d1e2598"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598",
"reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", "reference": "b94b2807d85443f9719887892882d0329d1e2598",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5" "php": ">=5.5"
@ -516,8 +576,13 @@
"require-dev": { "require-dev": {
"symfony/phpunit-bridge": "^4.4 || ^5.1" "symfony/phpunit-bridge": "^4.4 || ^5.1"
}, },
"time": "2023-05-21T12:31:43+00:00", "time": "2022-08-28T14:55:35+00:00",
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
},
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
"files": [ "files": [
@ -559,7 +624,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/promises/issues", "issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/1.5.3" "source": "https://github.com/guzzle/promises/tree/1.5.2"
}, },
"funding": [ "funding": [
{ {
@ -579,24 +644,18 @@
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "1.9.1", "version": "1.9.0",
"version_normalized": "1.9.1.0", "version_normalized": "1.9.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318",
"reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.4.0", "php": ">=5.4.0",
@ -613,8 +672,13 @@
"suggest": { "suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
}, },
"time": "2023-04-17T16:00:37+00:00", "time": "2022-06-20T21:43:03+00:00",
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
"files": [ "files": [
@ -673,7 +737,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/psr7/issues", "issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/1.9.1" "source": "https://github.com/guzzle/psr7/tree/1.9.0"
}, },
"funding": [ "funding": [
{ {
@ -850,17 +914,17 @@
}, },
{ {
"name": "laravel/serializable-closure", "name": "laravel/serializable-closure",
"version": "v1.3.1", "version": "v1.2.2",
"version_normalized": "1.3.1.0", "version_normalized": "1.2.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/serializable-closure.git", "url": "https://github.com/laravel/serializable-closure.git",
"reference": "e5a3057a5591e1cfe8183034b0203921abe2c902" "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/e5a3057a5591e1cfe8183034b0203921abe2c902", "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae",
"reference": "e5a3057a5591e1cfe8183034b0203921abe2c902", "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -872,7 +936,7 @@
"phpstan/phpstan": "^1.8.2", "phpstan/phpstan": "^1.8.2",
"symfony/var-dumper": "^5.4.11" "symfony/var-dumper": "^5.4.11"
}, },
"time": "2023-07-14T13:56:28+00:00", "time": "2022-09-08T13:45:54+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -1164,24 +1228,18 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/lotofbadcode/phpspirit_databackup.git", "url": "https://github.com/lotofbadcode/phpspirit_databackup.git",
"reference": "77c2421f8461392c044cf8c29918f495c22a5612" "reference": "1835cf8230531840ada1ed2b25eba23de5ad32c5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/lotofbadcode/phpspirit_databackup/zipball/77c2421f8461392c044cf8c29918f495c22a5612", "url": "https://api.github.com/repos/lotofbadcode/phpspirit_databackup/zipball/1835cf8230531840ada1ed2b25eba23de5ad32c5",
"reference": "77c2421f8461392c044cf8c29918f495c22a5612", "reference": "1835cf8230531840ada1ed2b25eba23de5ad32c5",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.0" "php": ">=7.0"
}, },
"time": "2023-05-12T12:02:05+00:00", "time": "2022-06-18T12:21:57+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@ -1394,18 +1452,24 @@
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.8.0", "version": "v6.7.1",
"version_normalized": "6.8.0.0", "version_normalized": "6.7.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "df16b615e371d81fb79e506277faea67a1be18f1" "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55",
"reference": "df16b615e371d81fb79e506277faea67a1be18f1", "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-ctype": "*", "ext-ctype": "*",
@ -1433,7 +1497,7 @@
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
}, },
"time": "2023-03-06T14:43:22+00:00", "time": "2022-12-08T13:30:06+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@ -1465,7 +1529,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP", "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": { "support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues", "issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0" "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.7.1"
}, },
"funding": [ "funding": [
{ {
@ -1642,24 +1706,24 @@
}, },
{ {
"name": "psr/http-client", "name": "psr/http-client",
"version": "1.0.2", "version": "1.0.1",
"version_normalized": "1.0.2.0", "version_normalized": "1.0.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/http-client.git", "url": "https://github.com/php-fig/http-client.git",
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.0 || ^8.0", "php": "^7.0 || ^8.0",
"psr/http-message": "^1.0 || ^2.0" "psr/http-message": "^1.0"
}, },
"time": "2023-04-10T20:12:12+00:00", "time": "2020-06-29T06:28:15+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -1679,7 +1743,7 @@
"authors": [ "authors": [
{ {
"name": "PHP-FIG", "name": "PHP-FIG",
"homepage": "https://www.php-fig.org/" "homepage": "http://www.php-fig.org/"
} }
], ],
"description": "Common interface for HTTP clients", "description": "Common interface for HTTP clients",
@ -1691,7 +1755,7 @@
"psr-18" "psr-18"
], ],
"support": { "support": {
"source": "https://github.com/php-fig/http-client/tree/1.0.2" "source": "https://github.com/php-fig/http-client/tree/master"
}, },
"install-path": "../psr/http-client" "install-path": "../psr/http-client"
}, },
@ -2289,18 +2353,24 @@
}, },
{ {
"name": "symfony/var-exporter", "name": "symfony/var-exporter",
"version": "v5.4.26", "version": "v5.4.21",
"version_normalized": "5.4.26.0", "version_normalized": "5.4.21.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/var-exporter.git", "url": "https://github.com/symfony/var-exporter.git",
"reference": "11401fe94f960249b3c63a488c63ba73091c1e4a" "reference": "be74908a6942fdd331554b3cec27ff41b45ccad4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/11401fe94f960249b3c63a488c63ba73091c1e4a", "url": "https://api.github.com/repos/symfony/var-exporter/zipball/be74908a6942fdd331554b3cec27ff41b45ccad4",
"reference": "11401fe94f960249b3c63a488c63ba73091c1e4a", "reference": "be74908a6942fdd331554b3cec27ff41b45ccad4",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
@ -2309,7 +2379,7 @@
"require-dev": { "require-dev": {
"symfony/var-dumper": "^4.4.9|^5.0.9|^6.0" "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0"
}, },
"time": "2023-07-20T07:21:16+00:00", "time": "2023-02-21T19:46:44+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@ -2345,7 +2415,7 @@
"serialize" "serialize"
], ],
"support": { "support": {
"source": "https://github.com/symfony/var-exporter/tree/v5.4.26" "source": "https://github.com/symfony/var-exporter/tree/v5.4.21"
}, },
"funding": [ "funding": [
{ {
@ -2365,18 +2435,24 @@
}, },
{ {
"name": "taoser/think-addons", "name": "taoser/think-addons",
"version": "v1.0.9", "version": "v1.0.6",
"version_normalized": "1.0.9.0", "version_normalized": "1.0.6.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/taoser/think-addons.git", "url": "https://github.com/taoser/think-addons.git",
"reference": "00112adf200b897deecbd1bbabc33ad22377b008" "reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/taoser/think-addons/zipball/00112adf200b897deecbd1bbabc33ad22377b008", "url": "https://api.github.com/repos/taoser/think-addons/zipball/e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
"reference": "00112adf200b897deecbd1bbabc33ad22377b008", "reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.1.0", "php": ">=7.1.0",
@ -2385,7 +2461,7 @@
"topthink/think-helper": "^3.0.0", "topthink/think-helper": "^3.0.0",
"topthink/think-view": "^1.0" "topthink/think-view": "^1.0"
}, },
"time": "2023-06-10T05:08:45+00:00", "time": "2022-10-06T13:11:38+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"think": { "think": {
@ -2419,7 +2495,7 @@
"description": "The ThinkPHP6 Addons Package", "description": "The ThinkPHP6 Addons Package",
"support": { "support": {
"issues": "https://github.com/taoser/think-addons/issues", "issues": "https://github.com/taoser/think-addons/issues",
"source": "https://github.com/taoser/think-addons/tree/v1.0.9" "source": "https://github.com/taoser/think-addons/tree/v1.0.6"
}, },
"install-path": "../taoser/think-addons" "install-path": "../taoser/think-addons"
}, },
@ -2593,18 +2669,24 @@
}, },
{ {
"name": "topthink/framework", "name": "topthink/framework",
"version": "v6.1.4", "version": "v6.1.2",
"version_normalized": "6.1.4.0", "version_normalized": "6.1.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/top-think/framework.git", "url": "https://github.com/top-think/framework.git",
"reference": "66eb9cf4d627df12911344cd328faf9bb596bf2c" "reference": "67235be5b919aaaf1de5aed9839f65d8e766aca3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/top-think/framework/zipball/66eb9cf4d627df12911344cd328faf9bb596bf2c", "url": "https://api.github.com/repos/top-think/framework/zipball/67235be5b919aaaf1de5aed9839f65d8e766aca3",
"reference": "66eb9cf4d627df12911344cd328faf9bb596bf2c", "reference": "67235be5b919aaaf1de5aed9839f65d8e766aca3",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
@ -2623,7 +2705,7 @@
"mockery/mockery": "^1.2", "mockery/mockery": "^1.2",
"phpunit/phpunit": "^7.0" "phpunit/phpunit": "^7.0"
}, },
"time": "2023-07-11T15:16:03+00:00", "time": "2023-02-08T02:24:01+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@ -2655,35 +2737,29 @@
], ],
"support": { "support": {
"issues": "https://github.com/top-think/framework/issues", "issues": "https://github.com/top-think/framework/issues",
"source": "https://github.com/top-think/framework/tree/v6.1.4" "source": "https://github.com/top-think/framework/tree/v6.1.2"
}, },
"install-path": "../topthink/framework" "install-path": "../topthink/framework"
}, },
{ {
"name": "topthink/think-captcha", "name": "topthink/think-captcha",
"version": "v3.0.9", "version": "v3.0.8",
"version_normalized": "3.0.9.0", "version_normalized": "3.0.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/top-think/think-captcha.git", "url": "https://github.com/top-think/think-captcha.git",
"reference": "b1ef360670578214edeebcf824aaf6ab7ee0528b" "reference": "52fba122c953995bec3013c635025172491ae299"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/top-think/think-captcha/zipball/b1ef360670578214edeebcf824aaf6ab7ee0528b", "url": "https://api.github.com/repos/top-think/think-captcha/zipball/52fba122c953995bec3013c635025172491ae299",
"reference": "b1ef360670578214edeebcf824aaf6ab7ee0528b", "reference": "52fba122c953995bec3013c635025172491ae299",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"topthink/framework": "^6.0|^8.0" "topthink/framework": "^6.0"
}, },
"time": "2023-04-27T07:18:40+00:00", "time": "2022-10-26T07:59:42+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"think": { "think": {
@ -2717,7 +2793,7 @@
"description": "captcha package for thinkphp", "description": "captcha package for thinkphp",
"support": { "support": {
"issues": "https://github.com/top-think/think-captcha/issues", "issues": "https://github.com/top-think/think-captcha/issues",
"source": "https://github.com/top-think/think-captcha/tree/v3.0.9" "source": "https://github.com/top-think/think-captcha/tree/v3.0.8"
}, },
"install-path": "../topthink/think-captcha" "install-path": "../topthink/think-captcha"
}, },
@ -2832,21 +2908,27 @@
}, },
{ {
"name": "topthink/think-migration", "name": "topthink/think-migration",
"version": "v3.0.6", "version": "v3.0.4",
"version_normalized": "3.0.6.0", "version_normalized": "3.0.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/top-think/think-migration.git", "url": "https://github.com/top-think/think-migration.git",
"reference": "82c4226cb14f973b9377c7fc6e89c525cbb8b030" "reference": "c5880669b277762d5ff935e551bc0d5c71de6811"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/top-think/think-migration/zipball/82c4226cb14f973b9377c7fc6e89c525cbb8b030", "url": "https://api.github.com/repos/top-think/think-migration/zipball/c5880669b277762d5ff935e551bc0d5c71de6811",
"reference": "82c4226cb14f973b9377c7fc6e89c525cbb8b030", "reference": "c5880669b277762d5ff935e551bc0d5c71de6811",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"topthink/framework": "^6.0 || ^8.0", "topthink/framework": "^6.0",
"topthink/think-helper": "^3.0.3" "topthink/think-helper": "^3.0.3"
}, },
"require-dev": { "require-dev": {
@ -2855,7 +2937,7 @@
"suggest": { "suggest": {
"fzaninotto/faker": "Required to use the factory builder (^1.8)." "fzaninotto/faker": "Required to use the factory builder (^1.8)."
}, },
"time": "2023-07-01T11:01:52+00:00", "time": "2022-10-26T07:57:54+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"think": { "think": {
@ -2883,23 +2965,23 @@
], ],
"support": { "support": {
"issues": "https://github.com/top-think/think-migration/issues", "issues": "https://github.com/top-think/think-migration/issues",
"source": "https://github.com/top-think/think-migration/tree/v3.0.6" "source": "https://github.com/top-think/think-migration/tree/v3.0.4"
}, },
"install-path": "../topthink/think-migration" "install-path": "../topthink/think-migration"
}, },
{ {
"name": "topthink/think-multi-app", "name": "topthink/think-multi-app",
"version": "v1.0.17", "version": "v1.0.16",
"version_normalized": "1.0.17.0", "version_normalized": "1.0.16.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/top-think/think-multi-app.git", "url": "https://github.com/top-think/think-multi-app.git",
"reference": "4055a6187296ac16c0bc7bbab4ed5d92f82f791c" "reference": "07b9183855150455e1f76f8cbe9d77d6d1bc399f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/top-think/think-multi-app/zipball/4055a6187296ac16c0bc7bbab4ed5d92f82f791c", "url": "https://api.github.com/repos/top-think/think-multi-app/zipball/07b9183855150455e1f76f8cbe9d77d6d1bc399f",
"reference": "4055a6187296ac16c0bc7bbab4ed5d92f82f791c", "reference": "07b9183855150455e1f76f8cbe9d77d6d1bc399f",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -2912,7 +2994,7 @@
"php": ">=7.1.0", "php": ">=7.1.0",
"topthink/framework": "^6.0|^8.0" "topthink/framework": "^6.0|^8.0"
}, },
"time": "2023-03-29T02:04:29+00:00", "time": "2023-02-07T08:40:09+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"think": { "think": {
@ -2937,26 +3019,26 @@
"email": "liu21st@gmail.com" "email": "liu21st@gmail.com"
} }
], ],
"description": "thinkphp multi app support", "description": "thinkphp6 multi app support",
"support": { "support": {
"issues": "https://github.com/top-think/think-multi-app/issues", "issues": "https://github.com/top-think/think-multi-app/issues",
"source": "https://github.com/top-think/think-multi-app/tree/v1.0.17" "source": "https://github.com/top-think/think-multi-app/tree/v1.0.16"
}, },
"install-path": "../topthink/think-multi-app" "install-path": "../topthink/think-multi-app"
}, },
{ {
"name": "topthink/think-orm", "name": "topthink/think-orm",
"version": "v2.0.61", "version": "v2.0.60",
"version_normalized": "2.0.61.0", "version_normalized": "2.0.60.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/top-think/think-orm.git", "url": "https://github.com/top-think/think-orm.git",
"reference": "10528ebf4a5106b19c3bac9c6deae7a67ff49de6" "reference": "8bc34a4307fa27186c0e96a9b3de3cb23aa1ed46"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/top-think/think-orm/zipball/10528ebf4a5106b19c3bac9c6deae7a67ff49de6", "url": "https://api.github.com/repos/top-think/think-orm/zipball/8bc34a4307fa27186c0e96a9b3de3cb23aa1ed46",
"reference": "10528ebf4a5106b19c3bac9c6deae7a67ff49de6", "reference": "8bc34a4307fa27186c0e96a9b3de3cb23aa1ed46",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -2976,7 +3058,7 @@
"require-dev": { "require-dev": {
"phpunit/phpunit": "^7|^8|^9.5" "phpunit/phpunit": "^7|^8|^9.5"
}, },
"time": "2023-04-20T14:27:51+00:00", "time": "2023-03-19T04:51:56+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@ -3004,7 +3086,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/top-think/think-orm/issues", "issues": "https://github.com/top-think/think-orm/issues",
"source": "https://github.com/top-think/think-orm/tree/v2.0.61" "source": "https://github.com/top-think/think-orm/tree/v2.0.60"
}, },
"install-path": "../topthink/think-orm" "install-path": "../topthink/think-orm"
}, },
@ -3263,24 +3345,30 @@
}, },
{ {
"name": "workerman/phpsocket.io", "name": "workerman/phpsocket.io",
"version": "v1.1.18", "version": "v1.1.16",
"version_normalized": "1.1.18.0", "version_normalized": "1.1.16.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/walkor/phpsocket.io.git", "url": "https://github.com/walkor/phpsocket.io.git",
"reference": "b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b" "reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b", "url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/f4dc14e69e9d0d8ce69c6180f93b76b7743f2304",
"reference": "b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b", "reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"workerman/channel": ">=1.0.0", "workerman/channel": ">=1.0.0",
"workerman/workerman": "^4.0.0" "workerman/workerman": ">=4.0.0"
}, },
"time": "2023-06-16T01:41:34+00:00", "time": "2022-11-25T13:00:18+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@ -3298,7 +3386,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/walkor/phpsocket.io/issues", "issues": "https://github.com/walkor/phpsocket.io/issues",
"source": "https://github.com/walkor/phpsocket.io/tree/v1.1.18" "source": "https://github.com/walkor/phpsocket.io/tree/v1.1.16"
}, },
"funding": [ "funding": [
{ {
@ -3314,18 +3402,24 @@
}, },
{ {
"name": "workerman/workerman", "name": "workerman/workerman",
"version": "v4.1.13", "version": "v4.1.9",
"version_normalized": "4.1.13.0", "version_normalized": "4.1.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/walkor/workerman.git", "url": "https://github.com/walkor/workerman.git",
"reference": "807780ff672775fcd08f89e573a2824e939021ce" "reference": "1f92d02c26106b5fbe6f61ea776198aad6e426f7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/walkor/workerman/zipball/807780ff672775fcd08f89e573a2824e939021ce", "url": "https://api.github.com/repos/walkor/workerman/zipball/1f92d02c26106b5fbe6f61ea776198aad6e426f7",
"reference": "807780ff672775fcd08f89e573a2824e939021ce", "reference": "1f92d02c26106b5fbe6f61ea776198aad6e426f7",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.0" "php": ">=7.0"
@ -3333,7 +3427,7 @@
"suggest": { "suggest": {
"ext-event": "For better performance. " "ext-event": "For better performance. "
}, },
"time": "2023-07-31T05:57:25+00:00", "time": "2023-03-10T13:59:12+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {

View File

@ -1,9 +1,9 @@
<?php return array( <?php return array(
'root' => array( 'root' => array(
'name' => 'taoser/taoler', 'name' => 'taoser/taoler',
'pretty_version' => '2.3.10.x-dev', 'pretty_version' => 'dev-master',
'version' => '2.3.10.9999999-dev', 'version' => 'dev-master',
'reference' => '0c2f0154a81dd0a6268da627982d1bf41c0ef231', 'reference' => '161a45102f046e53da3e5666e5c6cc052b5029b4',
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@ -64,6 +64,15 @@
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'firebase/php-jwt' => array(
'pretty_version' => 'v5.5.1',
'version' => '5.5.1.0',
'reference' => '83b609028194aa042ea33b5af2d41a7427de80e6',
'type' => 'library',
'install_path' => __DIR__ . '/../firebase/php-jwt',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/guzzle' => array( 'guzzlehttp/guzzle' => array(
'pretty_version' => '7.0.0', 'pretty_version' => '7.0.0',
'version' => '7.0.0.0', 'version' => '7.0.0.0',
@ -74,18 +83,18 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'guzzlehttp/promises' => array( 'guzzlehttp/promises' => array(
'pretty_version' => '1.5.3', 'pretty_version' => '1.5.2',
'version' => '1.5.3.0', 'version' => '1.5.2.0',
'reference' => '67ab6e18aaa14d753cc148911d273f6e6cb6721e', 'reference' => 'b94b2807d85443f9719887892882d0329d1e2598',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/promises', 'install_path' => __DIR__ . '/../guzzlehttp/promises',
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'guzzlehttp/psr7' => array( 'guzzlehttp/psr7' => array(
'pretty_version' => '1.9.1', 'pretty_version' => '1.9.0',
'version' => '1.9.1.0', 'version' => '1.9.0.0',
'reference' => 'e4490cabc77465aaee90b20cfc9a770f8c04be6b', 'reference' => 'e98e3e6d4f86621a9b75f623996e6bbdeb4b9318',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(), 'aliases' => array(),
@ -119,9 +128,9 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'laravel/serializable-closure' => array( 'laravel/serializable-closure' => array(
'pretty_version' => 'v1.3.1', 'pretty_version' => 'v1.2.2',
'version' => '1.3.1.0', 'version' => '1.2.2.0',
'reference' => 'e5a3057a5591e1cfe8183034b0203921abe2c902', 'reference' => '47afb7fae28ed29057fdca37e16a84f90cc62fae',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../laravel/serializable-closure', 'install_path' => __DIR__ . '/../laravel/serializable-closure',
'aliases' => array(), 'aliases' => array(),
@ -157,7 +166,7 @@
'lotofbadcode/phpspirit_databackup' => array( 'lotofbadcode/phpspirit_databackup' => array(
'pretty_version' => 'v1.2', 'pretty_version' => 'v1.2',
'version' => '1.2.0.0', 'version' => '1.2.0.0',
'reference' => '77c2421f8461392c044cf8c29918f495c22a5612', 'reference' => '1835cf8230531840ada1ed2b25eba23de5ad32c5',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../lotofbadcode/phpspirit_databackup', 'install_path' => __DIR__ . '/../lotofbadcode/phpspirit_databackup',
'aliases' => array(), 'aliases' => array(),
@ -191,9 +200,9 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'phpmailer/phpmailer' => array( 'phpmailer/phpmailer' => array(
'pretty_version' => 'v6.8.0', 'pretty_version' => 'v6.7.1',
'version' => '6.8.0.0', 'version' => '6.7.1.0',
'reference' => 'df16b615e371d81fb79e506277faea67a1be18f1', 'reference' => '49cd7ea3d2563f028d7811f06864a53b1f15ff55',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'install_path' => __DIR__ . '/../phpmailer/phpmailer',
'aliases' => array(), 'aliases' => array(),
@ -239,9 +248,9 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'psr/http-client' => array( 'psr/http-client' => array(
'pretty_version' => '1.0.2', 'pretty_version' => '1.0.1',
'version' => '1.0.2.0', 'version' => '1.0.1.0',
'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31', 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-client', 'install_path' => __DIR__ . '/../psr/http-client',
'aliases' => array(), 'aliases' => array(),
@ -338,27 +347,27 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'symfony/var-exporter' => array( 'symfony/var-exporter' => array(
'pretty_version' => 'v5.4.26', 'pretty_version' => 'v5.4.21',
'version' => '5.4.26.0', 'version' => '5.4.21.0',
'reference' => '11401fe94f960249b3c63a488c63ba73091c1e4a', 'reference' => 'be74908a6942fdd331554b3cec27ff41b45ccad4',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../symfony/var-exporter', 'install_path' => __DIR__ . '/../symfony/var-exporter',
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'taoser/taoler' => array( 'taoser/taoler' => array(
'pretty_version' => '2.3.10.x-dev', 'pretty_version' => 'dev-master',
'version' => '2.3.10.9999999-dev', 'version' => 'dev-master',
'reference' => '0c2f0154a81dd0a6268da627982d1bf41c0ef231', 'reference' => '161a45102f046e53da3e5666e5c6cc052b5029b4',
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'taoser/think-addons' => array( 'taoser/think-addons' => array(
'pretty_version' => 'v1.0.9', 'pretty_version' => 'v1.0.6',
'version' => '1.0.9.0', 'version' => '1.0.6.0',
'reference' => '00112adf200b897deecbd1bbabc33ad22377b008', 'reference' => 'e6e35bfd8b93dc469ebb5c5530ba350131bd7541',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../taoser/think-addons', 'install_path' => __DIR__ . '/../taoser/think-addons',
'aliases' => array(), 'aliases' => array(),
@ -392,18 +401,18 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'topthink/framework' => array( 'topthink/framework' => array(
'pretty_version' => 'v6.1.4', 'pretty_version' => 'v6.1.2',
'version' => '6.1.4.0', 'version' => '6.1.2.0',
'reference' => '66eb9cf4d627df12911344cd328faf9bb596bf2c', 'reference' => '67235be5b919aaaf1de5aed9839f65d8e766aca3',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../topthink/framework', 'install_path' => __DIR__ . '/../topthink/framework',
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'topthink/think-captcha' => array( 'topthink/think-captcha' => array(
'pretty_version' => 'v3.0.9', 'pretty_version' => 'v3.0.8',
'version' => '3.0.9.0', 'version' => '3.0.8.0',
'reference' => 'b1ef360670578214edeebcf824aaf6ab7ee0528b', 'reference' => '52fba122c953995bec3013c635025172491ae299',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-captcha', 'install_path' => __DIR__ . '/../topthink/think-captcha',
'aliases' => array(), 'aliases' => array(),
@ -428,27 +437,27 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'topthink/think-migration' => array( 'topthink/think-migration' => array(
'pretty_version' => 'v3.0.6', 'pretty_version' => 'v3.0.4',
'version' => '3.0.6.0', 'version' => '3.0.4.0',
'reference' => '82c4226cb14f973b9377c7fc6e89c525cbb8b030', 'reference' => 'c5880669b277762d5ff935e551bc0d5c71de6811',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-migration', 'install_path' => __DIR__ . '/../topthink/think-migration',
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'topthink/think-multi-app' => array( 'topthink/think-multi-app' => array(
'pretty_version' => 'v1.0.17', 'pretty_version' => 'v1.0.16',
'version' => '1.0.17.0', 'version' => '1.0.16.0',
'reference' => '4055a6187296ac16c0bc7bbab4ed5d92f82f791c', 'reference' => '07b9183855150455e1f76f8cbe9d77d6d1bc399f',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-multi-app', 'install_path' => __DIR__ . '/../topthink/think-multi-app',
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'topthink/think-orm' => array( 'topthink/think-orm' => array(
'pretty_version' => 'v2.0.61', 'pretty_version' => 'v2.0.60',
'version' => '2.0.61.0', 'version' => '2.0.60.0',
'reference' => '10528ebf4a5106b19c3bac9c6deae7a67ff49de6', 'reference' => '8bc34a4307fa27186c0e96a9b3de3cb23aa1ed46',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-orm', 'install_path' => __DIR__ . '/../topthink/think-orm',
'aliases' => array(), 'aliases' => array(),
@ -500,18 +509,18 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'workerman/phpsocket.io' => array( 'workerman/phpsocket.io' => array(
'pretty_version' => 'v1.1.18', 'pretty_version' => 'v1.1.16',
'version' => '1.1.18.0', 'version' => '1.1.16.0',
'reference' => 'b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b', 'reference' => 'f4dc14e69e9d0d8ce69c6180f93b76b7743f2304',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../workerman/phpsocket.io', 'install_path' => __DIR__ . '/../workerman/phpsocket.io',
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'workerman/workerman' => array( 'workerman/workerman' => array(
'pretty_version' => 'v4.1.13', 'pretty_version' => 'v4.1.9',
'version' => '4.1.13.0', 'version' => '4.1.9.0',
'reference' => '807780ff672775fcd08f89e573a2824e939021ce', 'reference' => '1f92d02c26106b5fbe6f61ea776198aad6e426f7',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../workerman/workerman', 'install_path' => __DIR__ . '/../workerman/workerman',
'aliases' => array(), 'aliases' => array(),

View File

@ -1,11 +1,5 @@
# CHANGELOG # CHANGELOG
## 1.5.3 - 2023-05-21
### Changed
- Removed remaining usage of deprecated functions
## 1.5.2 - 2022-08-07 ## 1.5.2 - 2022-08-07
### Changed ### Changed

View File

@ -46,6 +46,11 @@
"test": "vendor/bin/simple-phpunit", "test": "vendor/bin/simple-phpunit",
"test-ci": "vendor/bin/simple-phpunit --coverage-text" "test-ci": "vendor/bin/simple-phpunit --coverage-text"
}, },
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
},
"config": { "config": {
"preferred-install": "dist", "preferred-install": "dist",
"sort-packages": true "sort-packages": true

View File

@ -78,7 +78,7 @@ final class Each
$concurrency, $concurrency,
callable $onFulfilled = null callable $onFulfilled = null
) { ) {
return self::ofLimit( return each_limit(
$iterable, $iterable,
$concurrency, $concurrency,
$onFulfilled, $onFulfilled,

View File

@ -107,7 +107,7 @@ final class Utils
{ {
$results = []; $results = [];
foreach ($promises as $key => $promise) { foreach ($promises as $key => $promise) {
$results[$key] = self::inspect($promise); $results[$key] = inspect($promise);
} }
return $results; return $results;

View File

@ -6,7 +6,7 @@ on:
jobs: jobs:
build: build:
name: Build name: Build
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
strategy: strategy:
max-parallel: 10 max-parallel: 10
matrix: matrix:
@ -21,7 +21,11 @@ jobs:
extensions: mbstring extensions: mbstring
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v2
- name: Mimic PHP 8.0
run: composer config platform.php 8.0.999
if: matrix.php > 8
- name: Install dependencies - name: Install dependencies
run: composer update --no-interaction --no-progress run: composer update --no-interaction --no-progress

Some files were not shown because too many files have changed in this diff Show More