Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
78a9655d10 | ||
![]() |
0c2f0154a8 | ||
![]() |
74ab2ac512 | ||
![]() |
868797f0bb | ||
![]() |
ac854d627d |
app
404.htmlBaseController.phpcommon.php
composer.jsoncomposer.lockadmin
controller
view
addon/addons
content
index
system/set
user/user
common
controller
lib
model
taglib
validate
index
config
controller
lang
route
install/data
listener
config
extend/taoler/com
public
static
component
layui
res
view/common/blog
vendor
composer
ClassLoader.phpInstalledVersions.phpautoload_psr4.phpautoload_real.phpautoload_static.phpinstalled.jsoninstalled.php
guzzlehttp/promises
laravel/serializable-closure
README.md
src
phpmailer/phpmailer
psr/http-client
services.phpsymfony/var-exporter/Internal
taoser/think-addons/src
@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta name="keywords" content="fly,layui,前端社区">
|
||||
<meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区,致力于为web开发提供强劲动力">
|
||||
<link rel="stylesheet" href="/static/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="/layui-1/css/layui.css">
|
||||
<link rel="stylesheet" href="/static/res/css/global.css" charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
@ -22,8 +22,8 @@
|
||||
</div>
|
||||
|
||||
<include file="./footer" />
|
||||
<script src="/static/layui/jquery.min.js" charset="utf-8"></script>
|
||||
<script src="/static/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="/layui-1/jquery.min.js" charset="utf-8"></script>
|
||||
<script src="/layui-1/layui.js" charset="utf-8"></script>
|
||||
|
||||
<script>
|
||||
layui.cache.user = {
|
||||
|
@ -168,148 +168,6 @@ abstract class BaseController
|
||||
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']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传接口
|
||||
@ -356,7 +214,6 @@ abstract class BaseController
|
||||
|
||||
}
|
||||
|
||||
|
||||
//下载远程图片
|
||||
private function downloadImage($url)
|
||||
{
|
||||
|
@ -337,13 +337,15 @@ class Addons extends AdminController
|
||||
* @return string|Json
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function config($name)
|
||||
public function config()
|
||||
{
|
||||
$name = input('name');
|
||||
$config = get_addons_config($name);
|
||||
// halt($config);
|
||||
if(empty($config)) return json(['code'=>-1,'msg'=>'无配置项!无需操作']);
|
||||
if(Request::isAjax()){
|
||||
$params = Request::param('params/a',[],'trim');
|
||||
// halt($params);
|
||||
if ($params) {
|
||||
foreach ($config as $k => &$v) {
|
||||
if (isset($params[$k])) {
|
||||
@ -369,7 +371,7 @@ class Addons extends AdminController
|
||||
}
|
||||
return json(['code'=>0,'msg'=>'配置成功!']);
|
||||
}
|
||||
|
||||
//halt($config);
|
||||
//模板引擎初始化
|
||||
$view = ['formData'=>$config,'title'=>'title'];
|
||||
View::assign($view);
|
||||
|
@ -140,14 +140,14 @@ class Comment extends AdminController
|
||||
public function delete($id)
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$arr = explode(",",$id);
|
||||
foreach($arr as $v){
|
||||
$comm = CommentModel::find($v);
|
||||
$result = $comm->delete();
|
||||
}
|
||||
if($result){
|
||||
try {
|
||||
$arr = explode(",",$id);
|
||||
foreach($arr as $v){
|
||||
$comm = CommentModel::find($v);
|
||||
$comm->delete();
|
||||
}
|
||||
return json(['code'=>0,'msg'=>'删除成功']);
|
||||
}else{
|
||||
} catch (\Exception $e) {
|
||||
return json(['code'=>-1,'msg'=>'删除失败']);
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ namespace app\admin\controller\content;
|
||||
|
||||
use app\common\controller\AdminController;
|
||||
use app\common\model\Article;
|
||||
use app\facade\Cate;
|
||||
use think\App;
|
||||
use think\facade\View;
|
||||
use think\facade\Request;
|
||||
@ -43,7 +44,7 @@ class Forum extends AdminController
|
||||
|
||||
public function list()
|
||||
{
|
||||
$data = Request::only(['id','name','title','sec']);
|
||||
$data = Request::only(['id','name','title','sec','cate_id']);
|
||||
$where = [];
|
||||
if (!empty($data['sec'])) {
|
||||
switch ($data['sec']) {
|
||||
@ -73,13 +74,17 @@ class Forum extends AdminController
|
||||
$where[] = ['id', '=', $data['id']];
|
||||
}
|
||||
|
||||
if(!empty($data['cate_id'])){
|
||||
$where[] = ['cate_id', '=', $data['cate_id']];
|
||||
}
|
||||
|
||||
if(!empty($data['name'])){
|
||||
$userId = Db::name('user')->where('name',$data['name'])->value('id');
|
||||
$where[] = ['user_id', '=', $userId];
|
||||
}
|
||||
|
||||
if(!empty($data['title'])){
|
||||
$where[] = ['title', 'like', $data['title'].'%'];
|
||||
$where[] = ['title', 'like', '%'.$data['title'].'%'];
|
||||
}
|
||||
|
||||
$list = $this->model->getList($where, input('limit'), input('page'));
|
||||
@ -91,6 +96,7 @@ class Forum extends AdminController
|
||||
'poster' => $v['user']['name'],
|
||||
'avatar' => $v['user']['user_img'],
|
||||
'title' => htmlspecialchars($v['title']),
|
||||
'cate' => $v['cate']['catename'],
|
||||
'url' => $this->getArticleUrl($v['id'], 'index', $v['cate']['ename']),
|
||||
'content' => strip_tags($v['content']),
|
||||
'posttime' => $v['update_time'],
|
||||
@ -163,11 +169,6 @@ class Forum extends AdminController
|
||||
}
|
||||
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');
|
||||
}
|
||||
@ -236,31 +237,24 @@ class Forum extends AdminController
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
//删除帖子
|
||||
//删除帖子 多选和单独
|
||||
public function delete($id)
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$arr = explode(",",$id);
|
||||
foreach($arr as $v){
|
||||
$article = Article::find($v);
|
||||
$result = $article->together(['comments'])->delete();
|
||||
}
|
||||
|
||||
if($result){
|
||||
return json(['code'=>0,'msg'=>'删除成功']);
|
||||
}else{
|
||||
return json(['code'=>-1,'msg'=>'删除失败']);
|
||||
}
|
||||
try {
|
||||
$arr = explode(",",$id);
|
||||
foreach($arr as $v){
|
||||
$article = Article::find($v);
|
||||
$article->together(['comments'])->delete();
|
||||
}
|
||||
return json(['code'=>0,'msg'=>'删除成功']);
|
||||
} catch (\Exception $e) {
|
||||
return json(['code'=>-1,'msg'=>'删除失败']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -294,29 +288,6 @@ class Forum extends AdminController
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 内容中是否有图片视频音频插入
|
||||
*
|
||||
@ -338,21 +309,9 @@ class Forum extends AdminController
|
||||
|
||||
return $data;
|
||||
}
|
||||
/**
|
||||
* 获取描述,过滤html
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
$data = Request::only(['content']);
|
||||
$description = getArtContent($data['content']);
|
||||
return json(['code'=>0,'data'=>$description]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分类
|
||||
* 分类树
|
||||
* @return Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
@ -374,6 +333,28 @@ class Forum extends AdminController
|
||||
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过滤函数
|
||||
protected function filtr($arr){
|
||||
if($arr === '' || $arr === null){
|
||||
|
@ -16,6 +16,8 @@ use think\facade\Request;
|
||||
use think\facade\Db;
|
||||
use app\common\model\User as UserModel;
|
||||
use app\common\lib\Uploads;
|
||||
use app\common\validate\User as userValidate;
|
||||
use think\exception\ValidateException;
|
||||
|
||||
|
||||
class User extends AdminController
|
||||
@ -79,6 +81,14 @@ class User extends AdminController
|
||||
//
|
||||
if(Request::isAjax()){
|
||||
$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();
|
||||
$salt = substr(md5($data['create_time']),-6);
|
||||
// 密码
|
||||
@ -100,9 +110,13 @@ class User extends AdminController
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$data = Request::only(['id','name','email','user_img','password','phone','sex']);
|
||||
$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)); // 密码
|
||||
if(empty($data['password'])) {
|
||||
unset($data['password']);
|
||||
} else {
|
||||
$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{
|
||||
Db::name('user')->update($data);
|
||||
return json(['code'=>0,'msg'=>'编辑成功']);
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>新增管理员</title>
|
||||
<title>表单配置</title>
|
||||
<link rel="stylesheet" href="/static/component/pear/css/pear.css" />
|
||||
</head>
|
||||
<body>
|
||||
@ -24,10 +24,10 @@
|
||||
{:form_radio($name,$vo.content,['label'=>$vo.title,'tips'=>$vo.tips],$vo.value)}
|
||||
{/case}
|
||||
{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 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 value="select"}
|
||||
{:form_select($name,$vo.content,['label'=>$vo.title,'verify'=>$vo.rule,'tips'=>$vo.tips,'search'=>1] ,[],$vo.value)}
|
||||
@ -66,7 +66,7 @@
|
||||
<script>
|
||||
layui.use(['upload','toast'], function(){
|
||||
var $ = layui.$,upload = layui.upload,form = layui.form,notify=layui.notify;
|
||||
//上传头像
|
||||
//上传
|
||||
upload.render({
|
||||
elem: '.upload-select'
|
||||
,url: "{:url('addon.addons/uploads')}"
|
||||
|
@ -16,14 +16,20 @@
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="catename" lay-verify="required" placeholder="分类名*" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">EN别名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="ename" lay-verify="required" placeholder="英文名*" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">图标</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="icon" placeholder="图标*" id="iconPicker" lay-filter="iconPicker" style="display:none;" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">详情页模板</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="detpl" id="tpl" lay-verify="required">
|
||||
@ -32,10 +38,14 @@
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">描述</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="desc" lay-verify="required" placeholder="描述*" autocomplete="off" class="layui-input">
|
||||
<textarea type="text" name="desc" lay-verify="required" placeholder="描述*" autocomplete="off" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">排序</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="sort" lay-verify="number|required" placeholder="请填数字" autocomplete="off" class="layui-input">
|
||||
|
@ -42,7 +42,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">描述</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="desc" lay-verify="required" value="{$cate.desc}" placeholder="描述*" autocomplete="off" class="layui-input">
|
||||
<textarea type="text" name="desc" lay-verify="required" value="{$cate.desc}" placeholder="描述*" autocomplete="off" class="layui-textarea">{$cate.desc}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
|
@ -146,7 +146,7 @@
|
||||
type: 2,
|
||||
title: '新增',
|
||||
shade: 0.1,
|
||||
area: ['450px', '500px'],
|
||||
area: ['550px', '650px'],
|
||||
content: 'addEdit.html'
|
||||
});
|
||||
}
|
||||
@ -156,7 +156,7 @@
|
||||
type: 2,
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['450px', '500px'],
|
||||
area: ['550px', '650px'],
|
||||
content: 'addEdit.html?id=' + obj.data.id
|
||||
});
|
||||
}
|
||||
|
@ -130,7 +130,10 @@
|
||||
|
||||
form.on('submit(comment-query)', function(data) {
|
||||
table.reload('comment-table', {
|
||||
where: data.field
|
||||
where: data.field,
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
})
|
||||
return false;
|
||||
});
|
||||
@ -148,7 +151,7 @@
|
||||
data:{id:data.id,status:status},
|
||||
dataType:'json',
|
||||
success:function(res){
|
||||
if(res.code == 0){
|
||||
if(res.code === 0){
|
||||
layer.msg(res.msg,{
|
||||
icon:res.icon,
|
||||
time:2000
|
||||
@ -225,7 +228,7 @@
|
||||
data:{"id":checkIds},
|
||||
success: function(result) {
|
||||
layer.close(loading);
|
||||
if (result.success) {
|
||||
if (result.code === 0) {
|
||||
layer.msg(result.msg, {
|
||||
icon: 1,
|
||||
time: 1000
|
||||
@ -244,7 +247,7 @@
|
||||
}
|
||||
|
||||
window.refresh = function(param) {
|
||||
table.reload('user-table');
|
||||
table.reload('comment-table');
|
||||
}
|
||||
|
||||
|
||||
|
@ -4,6 +4,12 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>新增帖子</title>
|
||||
<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>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@ -13,12 +19,7 @@
|
||||
<div class="layui-col-md3">
|
||||
<label class="layui-form-label">{:lang('special column')}</label>
|
||||
<div class="layui-input-block">
|
||||
<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 id="CateId" class="xm-select-demo"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md8">
|
||||
@ -26,10 +27,6 @@
|
||||
<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="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 class="layui-col-md1">
|
||||
@ -39,7 +36,7 @@
|
||||
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<div class="layui-input-block">
|
||||
<textarea id="L_content" name="content" required lay-verify="" placeholder="{:lang('please input the content')}" class="layui-textarea"> </textarea>
|
||||
<textarea id="L_content" name="content" lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea taonyeditor"> </textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-inline">
|
||||
@ -88,38 +85,40 @@
|
||||
|
||||
<script src="/static/component/layui/layui.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>
|
||||
|
||||
layui.extend({
|
||||
editor: '{/}/static/addons/taonyeditor/js/taonyeditor'
|
||||
}).use(["form", "colorpicker", "upload",'editor','xmSelect'], function () {
|
||||
layui.use(["form", "colorpicker", "upload",'xmSelect'], function () {
|
||||
var $ = layui.jquery, form = layui.form, colorpicker = layui.colorpicker, upload = layui.upload;
|
||||
var editor = layui.editor;
|
||||
var xmSelect = layui.xmSelect;
|
||||
|
||||
editor.render({
|
||||
selector: 'textarea#L_content',
|
||||
uploadUrl: "{:url('content.forum/uploads')}",
|
||||
imagePrependUrl: "{$domain}"
|
||||
// 分类选择
|
||||
$.get("{:url('content.forum/getCateList')}",function(res){
|
||||
// 渲染下拉树
|
||||
xmSelect.render({
|
||||
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标签
|
||||
$(function(){
|
||||
//1.渲染标签
|
||||
@ -143,70 +142,17 @@
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
// 通过接口自动获取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({
|
||||
elem: "#zip-button",
|
||||
url: "{:url('content.forum/uploads')}", //改成您自己的上传接口
|
||||
data: { type: "zip" },
|
||||
accept: "file", //普通文件
|
||||
accept: "file",
|
||||
before: function(obj){
|
||||
layer.load();
|
||||
},
|
||||
done: function (res) {
|
||||
layer.closeAll('loading');
|
||||
if (res.status === 0) {
|
||||
$('input[name="upzip"]').val(res.url);
|
||||
layer.msg("上传成功");
|
||||
@ -257,5 +203,10 @@
|
||||
|
||||
});
|
||||
</script>
|
||||
{:hook('taonyeditor')}
|
||||
{// 百度标题词条}
|
||||
{:hook('seoBaiduTitle')}
|
||||
{// 百度关键词}
|
||||
{:hook('seoBaiduKeywords')}
|
||||
</body>
|
||||
</html>
|
||||
|
@ -4,6 +4,12 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>修改页面</title>
|
||||
<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>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@ -14,12 +20,7 @@
|
||||
<div class="layui-col-md3">
|
||||
<label class="layui-form-label">{:lang('special column')}</label>
|
||||
<div class="layui-input-block">
|
||||
<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 id="CateId" class="xm-select-demo"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md8">
|
||||
@ -37,7 +38,7 @@
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<div class="layui-input-block">
|
||||
<textarea id="L_content" name="content" required lay-verify="required" placeholder="详细内容" class="layui-textarea">{$article.content}</textarea>
|
||||
<textarea id="L_content" name="content" required lay-verify="required" placeholder="详细内容" class="layui-textarea taonyeditor">{$article.content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
@ -89,27 +90,15 @@
|
||||
</form>
|
||||
<script src="/static/component/layui/layui.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>
|
||||
|
||||
layui.extend({
|
||||
editor: '{/}/static/addons/taonyeditor/js/taonyeditor'
|
||||
}).use(['colorpicker','form','upload', 'editor'], function(){
|
||||
layui.use(['colorpicker','form','upload','xmSelect'], function(){
|
||||
var $ = layui.jquery
|
||||
,colorpicker = layui.colorpicker
|
||||
,form = layui.form
|
||||
,upload = layui.upload;
|
||||
var artId = "{$article.id}";
|
||||
var editor = layui.editor;
|
||||
|
||||
// 初始化编辑器
|
||||
editor.render({
|
||||
selector: 'textarea#L_content',
|
||||
uploadUrl: "{:url('content.forum/uploads')}",
|
||||
imagePrependUrl: "{$domain}"
|
||||
});
|
||||
var xmSelect = layui.xmSelect;
|
||||
|
||||
$(function(){
|
||||
//1.渲染标签
|
||||
@ -141,54 +130,35 @@
|
||||
});
|
||||
})
|
||||
|
||||
// 从详情页自动调用端口过滤,获取描述信息
|
||||
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);
|
||||
});
|
||||
|
||||
// 获取描述的内容
|
||||
$("#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);
|
||||
}
|
||||
}
|
||||
// 分类选择
|
||||
$.get("{:url('content.forum/getCateList')}",function(res){
|
||||
var INITCID = "{$article.cate_id}";
|
||||
// 渲染下拉树
|
||||
xmSelect.render({
|
||||
el: '#CateId',
|
||||
name: 'cate_id',
|
||||
height: '250px',
|
||||
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: '请选择'
|
||||
});
|
||||
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({
|
||||
@ -208,8 +178,12 @@
|
||||
elem: '#zip-button'
|
||||
,url: "{:url('content.forum/uploads')}" //改成您自己的上传接口
|
||||
,data: {type:'zip'}
|
||||
,accept: 'file' //普通文件
|
||||
,done: function(res){
|
||||
,accept: 'file',
|
||||
before: function(obj){
|
||||
layer.load();
|
||||
},
|
||||
done: function(res){
|
||||
layer.closeAll('loading');
|
||||
if(res.status === 0){
|
||||
$('input[name="upzip"]').val(res.url);
|
||||
layer.msg('上传成功');
|
||||
@ -248,5 +222,10 @@
|
||||
|
||||
});
|
||||
</script>
|
||||
{:hook('taonyeditor')}
|
||||
{// 百度标题词条}
|
||||
{:hook('seoBaiduTitle')}
|
||||
{// 百度关键词}
|
||||
{:hook('seoBaiduKeywords')}
|
||||
</body>
|
||||
</html>
|
@ -9,26 +9,32 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" action="">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-item layui-inline">
|
||||
<div class="layui-row layui-col-space15 ">
|
||||
<div class="layui-col-md3">
|
||||
<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>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="id" placeholder="请输入" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-inline">
|
||||
<div class="layui-col-md3">
|
||||
<label class="layui-form-label">发帖人</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="name" placeholder="请输入" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-inline">
|
||||
<div class="layui-col-md3">
|
||||
<label class="layui-form-label">标题</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" placeholder="请输入" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-inline">
|
||||
<div class="layui-col-md3">
|
||||
<label class="layui-form-label">状态</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="sec">
|
||||
@ -42,7 +48,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-inline">
|
||||
<div class="layui-col-md3">
|
||||
<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="forum-query">
|
||||
<i class="layui-icon layui-icon-search"></i>
|
||||
查询
|
||||
@ -100,12 +106,13 @@
|
||||
<script>
|
||||
const FORUM_List = "{:url('content.forum/list')}";
|
||||
|
||||
layui.use(['toast','jquery','form', 'table','common'], function(){
|
||||
layui.use(['toast','jquery','form', 'table','common','xmSelect'], function(){
|
||||
var $ = layui.jquery
|
||||
,form = layui.form
|
||||
,table = layui.table;
|
||||
let common = layui.common;
|
||||
var toast = layui.toast;
|
||||
var xmSelect = layui.xmSelect;
|
||||
|
||||
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
|
||||
var taonystatus = "{:hook('taonystatus')}";
|
||||
@ -120,6 +127,7 @@
|
||||
,{field: 'avatar', title: '头像', width: 60, templet: '#avatarTpl'}
|
||||
,{field: 'poster', title: '账号',width: 80}
|
||||
,{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: 'posttime', title: '时间',width: 120, sort: true}
|
||||
,{field: 'top', title: '置顶', templet: '#forum-istop', width: 80, align: 'center'}
|
||||
@ -144,6 +152,38 @@
|
||||
}, '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) {
|
||||
if (obj.event === 'remove') {
|
||||
window.remove(obj);
|
||||
@ -164,7 +204,10 @@
|
||||
|
||||
form.on('submit(forum-query)', function(data) {
|
||||
table.reload('forum-table', {
|
||||
where: data.field
|
||||
where: data.field,
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
})
|
||||
return false;
|
||||
});
|
||||
@ -269,9 +312,7 @@
|
||||
}
|
||||
|
||||
window.batchRemove = function(obj) {
|
||||
|
||||
var checkIds = common.checkField(obj,'id');
|
||||
|
||||
if (checkIds === "") {
|
||||
layer.msg("未选中数据", {
|
||||
icon: 3,
|
||||
@ -280,25 +321,25 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
layer.confirm('确定要删除这些用户', {
|
||||
layer.confirm('确定要删除?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
layer.close(index);
|
||||
let loading = layer.load();
|
||||
$.ajax({
|
||||
url: "{:url('system.admin/delete')}",
|
||||
url: "{:url('content.forum/delete')}?id=" + checkIds,
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
data:{"id":checkIds},
|
||||
success: function(result) {
|
||||
layer.close(loading);
|
||||
if (result.success) {
|
||||
if (result.code === 0) {
|
||||
layer.msg(result.msg, {
|
||||
icon: 1,
|
||||
time: 1000
|
||||
}, function() {
|
||||
table.reload('user-table');
|
||||
table.reload('forum-table');
|
||||
});
|
||||
} else {
|
||||
layer.msg(result.msg, {
|
||||
@ -312,7 +353,7 @@
|
||||
}
|
||||
|
||||
window.refresh = function(param) {
|
||||
table.reload('user-table');
|
||||
table.reload('forum-table');
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -82,8 +82,8 @@
|
||||
table.reload('tag-link', {
|
||||
where: {tag: data.value}
|
||||
,page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -108,7 +108,7 @@
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
|
||||
<div class="pear-card2">
|
||||
<div class="title">待审文章</div>
|
||||
<div class="count pear-text">14</div>
|
||||
<div class="count pear-text">0</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
|
||||
|
@ -98,13 +98,13 @@
|
||||
<li class="layui-col-xs6">
|
||||
<a lay-href="javascript:;" class="layadmin-backlog-body">
|
||||
<h3>待审商品</h3>
|
||||
<p><cite>99</cite></p>
|
||||
<p><cite>0</cite></p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-col-xs6">
|
||||
<a href="javascript:;" onclick="layer.tips('不跳转', this, {tips: 3});" class="layadmin-backlog-body">
|
||||
<h3>待发货</h3>
|
||||
<p><cite>20</cite></p>
|
||||
<p><cite>0</cite></p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -243,11 +243,18 @@
|
||||
</div>
|
||||
<hr>
|
||||
<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;">
|
||||
<input type="checkbox" name="baidu_title_switch" lay-skin="switch" lay-text="开启|关闭" value=1 {if config('taoler.config.baidu_title_switch') == 1} checked {/if}>
|
||||
<input type="checkbox" name="nav_top" lay-skin="switch" lay-text="顶部|子栏" value=1 {if config('taoler.config.nav_top') == 1} checked {/if}>
|
||||
</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>
|
||||
<hr>
|
||||
{if hook('mailserveractivehook')}
|
||||
@ -412,8 +419,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 获取描述的内容
|
||||
$("input[name='article_as']").bind('input propertychange', function(){
|
||||
var content = $(this).val()
|
||||
|
@ -76,6 +76,7 @@
|
||||
layui.use(['form', 'jquery'], function() {
|
||||
let form = layui.form;
|
||||
let $ = layui.jquery;
|
||||
let upload = layui.upload;
|
||||
|
||||
form.on('submit(user-save)', function(data) {
|
||||
$.ajax({
|
||||
@ -103,6 +104,33 @@
|
||||
})
|
||||
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>
|
||||
|
@ -212,8 +212,7 @@
|
||||
{
|
||||
title: '注册',
|
||||
field: 'jointime',
|
||||
align: 'center',
|
||||
templet: '#user-createTime'
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
@ -79,12 +79,14 @@ if(!function_exists('getUserImg'))
|
||||
function getArtContent($content)
|
||||
{
|
||||
//过滤html标签
|
||||
$content = strip_tags($content);
|
||||
// $content = strip_tags($content);
|
||||
// 去除所有& nbsp和html标签
|
||||
$content = preg_replace("/(\s|\ \;|\&ldquo\;|\&rdquo\;| |\xc2\xa0)/", "", strip_tags($content));
|
||||
// 过滤音视频图片
|
||||
$content = preg_replace('/(?:img|audio|video)(\(\S+\))?\[\S+\]/','',$content);
|
||||
$content = preg_replace('/\s*/','',$content);
|
||||
$content = preg_replace('/\[[^\]]+\]/','',$content);
|
||||
return mb_substr(strip_tags($content),0,150).'...';
|
||||
return mb_substr($content,0,150).'...';
|
||||
}
|
||||
|
||||
//根据帖子收藏主键ID,查询帖子名称
|
||||
|
@ -18,7 +18,6 @@ use think\facade\Db;
|
||||
use think\facade\Session;
|
||||
use think\facade\Cache;
|
||||
use app\BaseController as BaseCtrl;
|
||||
use app\common\model\Cate;
|
||||
|
||||
/**
|
||||
* 控制器基础类
|
||||
@ -39,8 +38,6 @@ class BaseController extends BaseCtrl
|
||||
|
||||
//变量赋给模板
|
||||
View::assign([
|
||||
//显示分类导航
|
||||
'cateList' => $this->showNav(),
|
||||
//显示子分类导航
|
||||
'subcatelist' => $this->showSubnav(),
|
||||
//当前登录用户
|
||||
@ -65,23 +62,9 @@ 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
|
||||
protected function showSubnav()
|
||||
{
|
||||
// dump($this->showNav());
|
||||
//1.查询父分类id
|
||||
$pCate = Db::name('cate')->field('id,pid,ename,catename,is_hot')->where(['ename'=>input('ename'),'status'=>1,'delete_time'=>0])->find();
|
||||
|
||||
|
@ -68,9 +68,18 @@ class Arts
|
||||
*/
|
||||
public function setKeywords(string $flag,string $title,string $content) :array
|
||||
{
|
||||
// 获取seo插件配置
|
||||
$conf = get_addons_config('seo');
|
||||
|
||||
$keywords = [];
|
||||
|
||||
// seo插件配置
|
||||
$addon = get_addons_instance('seo');
|
||||
$config = $addon->getConfig();
|
||||
$seo_token = $config['baidufenci']['access_token'];
|
||||
|
||||
// 百度分词自动生成关键词
|
||||
if(!empty(config('taoler.baidu.client_id'))) {
|
||||
if(!empty($seo_token)) {
|
||||
//headers数组内的格式
|
||||
$headers = [];
|
||||
$headers[] = "Content-Type:application/json";
|
||||
@ -78,16 +87,16 @@ class Arts
|
||||
switch($flag) {
|
||||
//分词
|
||||
case 'word':
|
||||
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/lexer?charset=UTF-8&access_token='.config('taoler.baidu.access_token');
|
||||
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/lexer?charset=UTF-8&access_token='.$seo_token;
|
||||
$body = ["text" => $title];
|
||||
break;
|
||||
//标签
|
||||
case 'tag':
|
||||
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/keyword?charset=UTF-8&access_token='.config('taoler.baidu.access_token');
|
||||
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/keyword?charset=UTF-8&access_token='.$seo_token;
|
||||
$body = ['title' => $title, 'content' => $content];
|
||||
break;
|
||||
default:
|
||||
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/lexer?charset=UTF-8&access_token='.config('taoler.baidu.access_token');
|
||||
$url = 'https://aip.baidubce.com/rpc/2.0/nlp/v1/lexer?charset=UTF-8&access_token='.$seo_token;
|
||||
$body = ["text" => $title];
|
||||
}
|
||||
|
||||
@ -131,9 +140,9 @@ class Arts
|
||||
} 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');
|
||||
$post_data['grant_type'] = $config['baidufenci']['grant_type'];;
|
||||
$post_data['client_id'] = $config['baidufenci']['client_id'];
|
||||
$post_data['client_secret'] = $config['baidufenci']['client_secret'];
|
||||
|
||||
$o = "";
|
||||
foreach ( $post_data as $k => $v )
|
||||
@ -142,12 +151,11 @@ class Arts
|
||||
}
|
||||
$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,
|
||||
]
|
||||
]);
|
||||
|
||||
// 保存token
|
||||
$conf['baidufenci']['value']['access_token'] = json_decode($res)->access_token;
|
||||
set_addons_config('seo', $conf);
|
||||
|
||||
echo 'api接口数据错误 - ';
|
||||
echo $dataItem->error_msg;
|
||||
}
|
||||
@ -210,8 +218,11 @@ class Arts
|
||||
*/
|
||||
public function baiduPushUrl(string $link)
|
||||
{
|
||||
// seo插件配置
|
||||
$addon = get_addons_instance('seo');
|
||||
$config = $addon->getConfig();
|
||||
// baidu 接口
|
||||
$api = config('taoler.baidu.push_api');
|
||||
$api = $config['baidupush']['push_api'];
|
||||
if(!empty($api)) {
|
||||
$url[] = $link;
|
||||
$ch = curl_init();
|
||||
|
@ -4,6 +4,7 @@ declare (strict_types = 1);
|
||||
namespace app\common\lib;
|
||||
|
||||
use think\facade\Lang;
|
||||
use think\Response;
|
||||
|
||||
class Msgres
|
||||
{
|
||||
@ -66,13 +67,13 @@ class Msgres
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功提示
|
||||
* @param string $strMsg
|
||||
* @param string|null $url
|
||||
* @param string $data
|
||||
* @return string|\think\response\Json
|
||||
* @param array|$data
|
||||
* @return Response
|
||||
*/
|
||||
public static function success(string $strMsg = '',string $url = null, $data = '') {
|
||||
public static function success(string $strMsg = '',string $url = null, array $data = []): Response
|
||||
{
|
||||
$result = [
|
||||
'code' => self::getCode('success'),
|
||||
'msg' => self::getMsg($strMsg),
|
||||
|
@ -93,7 +93,7 @@ class Uploads
|
||||
}
|
||||
// 解析存储位置 SYS_开头为系统位置
|
||||
$isSys = stripos($dirName, 'SYS_');
|
||||
if($isSys !== false) {
|
||||
if($isSys) {
|
||||
$disk = 'sys';
|
||||
$dirName = substr($dirName,4);
|
||||
$uploadDir = Config::get('filesystem.disks.sys.url');
|
||||
@ -105,7 +105,7 @@ class Uploads
|
||||
$rules = ['md5','date','sha1','uniqid'];
|
||||
// 解析是否自定义文件名
|
||||
if(!in_array($rule, $rules) && !is_null($rule)) {
|
||||
if(stripos($rule, '.') == false) {
|
||||
if(!stripos($rule, '.')) {
|
||||
$rule = $file->getOriginalName();
|
||||
}
|
||||
$savename = Filesystem::disk($disk)->putFileAs($dirName, $file, $rule);
|
||||
@ -160,7 +160,7 @@ class Uploads
|
||||
|
||||
// 解析存储位置 SYS_开头为系统位置
|
||||
$isSys = stripos($dirName, 'SYS_');
|
||||
if($isSys !== false) {
|
||||
if($isSys) {
|
||||
$disk = 'sys';
|
||||
$dirName = substr($dirName,4);
|
||||
$uploadDir = Config::get('filesystem.disks.sys.url');
|
||||
|
@ -111,7 +111,7 @@ class Article extends Model
|
||||
{
|
||||
|
||||
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')
|
||||
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')
|
||||
->where([['is_top', '=', 1], ['status', '=', 1]])
|
||||
->with([
|
||||
'cate' => function ($query) {
|
||||
@ -140,7 +140,7 @@ class Article extends Model
|
||||
public function getArtList(int $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')
|
||||
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')
|
||||
->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename,ename,detpl');
|
||||
@ -247,7 +247,7 @@ class Article extends Model
|
||||
$where[] = ['status', '=', 1];
|
||||
|
||||
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')
|
||||
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')
|
||||
->with([
|
||||
'cate' => function($query) {
|
||||
$query->field('id,catename,ename');
|
||||
@ -383,15 +383,16 @@ class Article extends Model
|
||||
// 获取所有帖子内容
|
||||
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')
|
||||
return $this::field('id,user_id,cate_id,title,content,is_top,is_hot,is_reply,status,update_time,read_type,art_pass')
|
||||
->with([
|
||||
'user' => function($query){
|
||||
$query->field('id,name,user_img');
|
||||
},
|
||||
'cate' => function($query){
|
||||
$query->field('id,ename');
|
||||
$query->field('id,ename,catename');
|
||||
}
|
||||
])
|
||||
->where(['status' => 1])
|
||||
->where($where)
|
||||
->order('create_time', 'desc')
|
||||
->paginate([
|
||||
@ -410,5 +411,15 @@ class Article extends Model
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -46,6 +46,12 @@ class Cate extends Model
|
||||
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
|
||||
@ -93,6 +99,24 @@ 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
|
||||
public function getUrlAttr($value,$data)
|
||||
{
|
||||
|
@ -35,11 +35,36 @@ class Comment extends Model
|
||||
//获取评论
|
||||
public function getComment($id, $page)
|
||||
{
|
||||
return $this::with(['user'])
|
||||
$comment = $this::withTrashed()->with(['user'=>function($query){
|
||||
$query->field('id,name,user_img,sign,city,vip');
|
||||
}])
|
||||
->where(['article_id'=>(int)$id,'status'=>1])
|
||||
->order(['cai'=>'asc','create_time'=>'asc'])
|
||||
->paginate(['list_rows'=>10, 'page'=>$page])
|
||||
// ->paginate(['list_rows'=>10, 'page'=>$page])
|
||||
->append(['touser'])
|
||||
->select()
|
||||
->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' => ''];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//回帖榜
|
||||
@ -154,5 +179,36 @@ class Comment extends Model
|
||||
return (string) url('detail',['id' => $data['id']]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 获取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 '';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -51,9 +51,9 @@ class User extends Model
|
||||
public function login($data)
|
||||
{
|
||||
//查询使用邮箱或者用户名登陆
|
||||
$user = $this::whereOr('email',$data['name'])->whereOr('name',$data['name'])->findOrEmpty();
|
||||
$user = $this::whereOr('phone',$data['name'])->whereOr('email',$data['name'])->whereOr('name',$data['name'])->findOrEmpty();
|
||||
|
||||
if(!($user->isEmpty())){
|
||||
if(!$user->isEmpty()){
|
||||
//被禁用和待审核
|
||||
if($user['status'] == -1){
|
||||
return Lang::get('Account disabled');
|
||||
|
@ -11,34 +11,27 @@
|
||||
namespace app\common\model;
|
||||
|
||||
use think\Model;
|
||||
//use think\model\concern\SoftDelete;
|
||||
|
||||
class UserZan extends Model
|
||||
{
|
||||
protected $autoWriteTimestamp = true; //开启自动时间戳
|
||||
protected $createTime = 'create_time';
|
||||
|
||||
|
||||
//软删除
|
||||
//use SoftDelete;
|
||||
//protected $deleteTime = 'delete_time';
|
||||
//protected $defaultSoftDelete = 0;
|
||||
|
||||
public function comment()
|
||||
{
|
||||
//评论关联文章
|
||||
//关联评论
|
||||
return $this->belongsTo('Comment','comment_id','id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
//评论关联用户
|
||||
//关联用户
|
||||
return $this->belongsTo('User','user_id','id');
|
||||
}
|
||||
|
||||
public function article()
|
||||
{
|
||||
//评论关联用户
|
||||
//关联文章
|
||||
return $this->belongsTo(Article::class);
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
* @FilePath: \TaoLer\app\common\taglib\Article.php
|
||||
* Copyright (c) 2020~2022 https://www.aieok.com All rights reserved.
|
||||
*/
|
||||
//declare (strict_types = 1);
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\common\taglib;
|
||||
|
||||
@ -42,6 +42,7 @@ class Article extends TagLib
|
||||
'istop' => ['attr' => '', 'close' => 0],
|
||||
|
||||
'detail' => ['attr' => 'name', 'close' => 0],
|
||||
// 'detail' => ['attr' => '', 'close' => 0],
|
||||
|
||||
];
|
||||
|
||||
@ -145,12 +146,24 @@ class Article extends TagLib
|
||||
return '{$article.cate.id}';
|
||||
}
|
||||
|
||||
// 详情
|
||||
// public function tagDetail($tag)
|
||||
// {
|
||||
// return '{$article.' . $tag['name'] . '}';
|
||||
// }
|
||||
|
||||
// 详情
|
||||
public function tagDetail($tag)
|
||||
{
|
||||
return '{$article.' . $tag['name'] . '}';
|
||||
$parseStr = '{assign name="id" value="$Request.param.id" /}';
|
||||
$parseStr .= '<?php ';
|
||||
$parseStr .= '$__article__ = \app\facade\Article::find($id);';
|
||||
$parseStr .= ' ?>';
|
||||
$parseStr .= '{$__article__.'. $tag['name'] .'}';
|
||||
return $parseStr;
|
||||
}
|
||||
|
||||
|
||||
public function tagIstop($tag): string
|
||||
{
|
||||
//dump($this->article);
|
||||
@ -163,16 +176,27 @@ class Article extends TagLib
|
||||
}
|
||||
|
||||
// 评论
|
||||
public function tagComment($tag, $content): string
|
||||
public function tagComment2($tag, $content): string
|
||||
{
|
||||
$parse = '<?php ';
|
||||
$parse .= ' ?>';
|
||||
$parse .= '{volist name="comments['.'\'data\''.']" id="comment" empty= "还没有内容"}';
|
||||
$parse .= '{volist name="comments" id="comment" empty= "还没有内容"}';
|
||||
$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
|
||||
{
|
||||
|
@ -14,8 +14,45 @@ use think\template\TagLib;
|
||||
|
||||
class Cate extends TagLib
|
||||
{
|
||||
protected $tag = [
|
||||
|
||||
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 = ;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -35,7 +35,7 @@ class System extends TagLib
|
||||
'icp' => ['attr' => '', 'close' => 0],
|
||||
'showlist' => ['attr' => '', 'close' => 0],
|
||||
'blackname' => ['attr' => '', 'close' => 0],
|
||||
'sys_version_num' => ['attr' => '', 'close' => 0],
|
||||
'sys_version_num'=> ['attr' => '', 'close' => 0],
|
||||
'key' => ['attr' => '', 'close' => 0],
|
||||
'clevel' => ['attr' => '', 'close' => 0],
|
||||
'api_url' => ['attr' => '', 'close' => 0],
|
||||
|
@ -16,7 +16,7 @@ class Taoler extends TagLib
|
||||
{
|
||||
protected $tags = [
|
||||
// 标签定义: attr 属性列表 close 是否闭合(0 或者1 默认1) alias 标签别名 level 嵌套层次
|
||||
'nav' => ['attr' => '', 'close' => 1],
|
||||
'nav' => ['attr' => '', 'close' => 1],
|
||||
'snav' => ['attr' => '', 'close' => 1],
|
||||
'gnav' => ['attr' => '', 'close' => 1],
|
||||
'if' => ['condition', 'expression' => true, 'close' => 1],
|
||||
@ -26,7 +26,8 @@ class Taoler extends TagLib
|
||||
public function tagNav($tag, $content): string
|
||||
{
|
||||
$id = $tag['id'] ?? 'nav';
|
||||
$parse = '{volist name="cateList" id="'.$id.'"}';
|
||||
$parse = '{php}$__cate__ = \app\facade\Cate::getNav();{/php}';
|
||||
$parse .= '{volist name="__cate__" id="'.$id.'"}';
|
||||
$parse .= $content;
|
||||
$parse .= '{/volist}';
|
||||
return $parse;
|
||||
@ -35,18 +36,22 @@ class Taoler extends TagLib
|
||||
public function tagSnav($tag, $content): string
|
||||
{
|
||||
$id = $tag['id'] ?? 'snav';
|
||||
$parse = '{volist name="nav.children" id="'.$id.'"}';
|
||||
$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 = '{volist name="snav.children" id="'.$id.'"}';
|
||||
$parse = '{notempty name="snav.children"}';
|
||||
$parse .= '{volist name="snav.children" id="'.$id.'"}';
|
||||
$parse .= $content;
|
||||
$parse .= '{/volist}';
|
||||
$parse .= '{/notempty}';
|
||||
return $parse;
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@ class User extends Validate
|
||||
protected $rule = [
|
||||
'name|用户名' => 'require|min:2|max:18|chsDash|unique:user',
|
||||
'email|邮箱' => 'require|email|unique:user',
|
||||
'phone|手机号' => 'require|mobile|unique:user',
|
||||
'password|密码' => 'require|min:6|max:20',
|
||||
'repassword|确认密码'=>'require|confirm:password',
|
||||
'nickname|昵称' => 'require|min:2|max:20',
|
||||
@ -48,11 +49,23 @@ class User extends Validate
|
||||
->remove('email', 'unique');
|
||||
}
|
||||
|
||||
//注册验证场景
|
||||
//phone登陆验证场景
|
||||
public function sceneLoginPhone()
|
||||
{
|
||||
return $this->only(['phone','password'])
|
||||
->remove('phone', 'unique');
|
||||
}
|
||||
|
||||
//注册验证场景
|
||||
public function sceneReg()
|
||||
{
|
||||
return $this->only(['name','email','password','repassword']);
|
||||
|
||||
}
|
||||
|
||||
//后台注册验证场景
|
||||
public function sceneUserReg()
|
||||
{
|
||||
return $this->only(['name','email','phone','password']);
|
||||
}
|
||||
|
||||
//密码找回
|
||||
|
@ -43,6 +43,8 @@ return [
|
||||
'view_dir_name' => 'view' . DIRECTORY_SEPARATOR . $template,
|
||||
// 模板后缀
|
||||
'view_suffix' => 'html',
|
||||
// 定义内置标签
|
||||
//'taglib_build_in' => 'app\common\taglib\Article',
|
||||
// 预先加载的标签库
|
||||
'taglib_pre_load' => $taglib_pre_load,
|
||||
// 模板文件名分隔符
|
||||
|
3
app/index/controller/.gitignore
vendored
3
app/index/controller/.gitignore
vendored
@ -1 +1,2 @@
|
||||
Api.php
|
||||
Api.php
|
||||
Works.php
|
@ -76,21 +76,11 @@ class Article extends BaseController
|
||||
$page = input('page',1);
|
||||
//输出内容
|
||||
$artDetail = $this->model->getArtDetail($id);
|
||||
if($artDetail->read_type == 1 && session('art_pass_'.$id) != $artDetail->art_pass) {
|
||||
$artDetail->content = '本文已加密!请输入正确密码查看!';
|
||||
if(is_null($artDetail)){
|
||||
throw new \think\exception\HttpException(404, '无内容');
|
||||
}
|
||||
|
||||
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);
|
||||
//被赞
|
||||
$zanCount = Db::name('user_zan')->where('user_id', $artDetail['user_id'])->count('id');
|
||||
|
||||
//赞列表
|
||||
$userZanList = [];
|
||||
@ -162,9 +152,9 @@ class Article extends BaseController
|
||||
'cid' => $id,
|
||||
'lrDate_time' => $lrDate_time,
|
||||
'userZanList' => $userZanList,
|
||||
'userTagCount'=> $userTagCount,
|
||||
'jspage' => 'jie',
|
||||
'passJieMi' => session('art_pass_'.$id),
|
||||
'zanCount' => $zanCount,
|
||||
'jspage' => 'jie',
|
||||
'passJieMi' => session('art_pass_'.$id),
|
||||
$download,
|
||||
]);
|
||||
|
||||
@ -186,8 +176,10 @@ class Article extends BaseController
|
||||
|
||||
if (Request::isAjax()){
|
||||
//获取评论
|
||||
$data = Request::only(['content','article_id','user_id']);
|
||||
$data = Request::only(['content','article_id','pid','to_user_id']);
|
||||
$data['user_id'] = $this->uid;
|
||||
$sendId = $data['user_id'];
|
||||
// halt($data);
|
||||
$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){
|
||||
@ -451,40 +443,6 @@ class Article extends BaseController
|
||||
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()
|
||||
{
|
||||
@ -616,15 +574,22 @@ class Article extends BaseController
|
||||
/**
|
||||
* 分类树
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getCateTree()
|
||||
{
|
||||
$data = $this->showNav();
|
||||
$count = count($data);
|
||||
$cateList = Cate::field('id,pid,catename,sort')->where(['status' => 1])->select()->toArray();
|
||||
$list = getTree($cateList);
|
||||
// 排序
|
||||
$cmf_arr = array_column($list, 'sort');
|
||||
array_multisort($cmf_arr, SORT_ASC, $list);
|
||||
$count = count($list);
|
||||
$tree = [];
|
||||
if($count){
|
||||
$tree = ['code'=>0, 'msg'=>'ok','count'=>$count];
|
||||
$tree['data'] = $data;
|
||||
$tree['data'] = $list;
|
||||
}
|
||||
|
||||
return json($tree);
|
||||
|
@ -35,9 +35,8 @@ class Comment extends BaseController
|
||||
//删除评论
|
||||
public function jiedaDelete()
|
||||
{
|
||||
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
|
||||
$id = input('id');
|
||||
//$arid = intval($id);
|
||||
|
||||
$comms = CommentModel::find($id);
|
||||
$result = $comms->delete();
|
||||
if($result){
|
||||
@ -52,7 +51,7 @@ class Comment extends BaseController
|
||||
public function getDa()
|
||||
{
|
||||
//获取原评论
|
||||
$this->isLogin();
|
||||
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
|
||||
$id = input('id');
|
||||
$comms = CommentModel::find($id);
|
||||
$res['rows'] = [];
|
||||
@ -66,7 +65,7 @@ class Comment extends BaseController
|
||||
//更新评论
|
||||
public function updateDa()
|
||||
{
|
||||
$this->isLogin();
|
||||
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
|
||||
$id = input('id');
|
||||
$content = input('content');
|
||||
$comms = CommentModel::find($id);
|
||||
@ -83,6 +82,7 @@ class Comment extends BaseController
|
||||
//更新评论
|
||||
public function edit()
|
||||
{
|
||||
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
|
||||
if(Request::isAjax()) {
|
||||
$param = Request::param();
|
||||
// halt($param);
|
||||
@ -101,7 +101,7 @@ class Comment extends BaseController
|
||||
//评论点赞
|
||||
public function jiedaZan()
|
||||
{
|
||||
$this->isLogin();
|
||||
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
|
||||
$data['comment_id'] = input('post.id');
|
||||
$data['user_id'] = session('user_id');
|
||||
//查询是否已存在点赞
|
||||
|
@ -11,6 +11,7 @@
|
||||
namespace app\index\controller;
|
||||
|
||||
use app\common\controller\BaseController;
|
||||
use app\common\lib\facade\HttpHelper;
|
||||
use think\facade\View;
|
||||
use think\facade\Request;
|
||||
use think\facade\Db;
|
||||
@ -31,12 +32,11 @@ class Index extends BaseController
|
||||
$types = input('type');
|
||||
//置顶文章
|
||||
$artTop = Article::getArtTop(5);
|
||||
//首页文章列表,显示20个
|
||||
//首页文章列表,显示10个
|
||||
$artList = Article::getArtList(15);
|
||||
//热议文章
|
||||
$artHot = Article::getArtHot(10);
|
||||
|
||||
|
||||
$vs = [
|
||||
'artTop' => $artTop,
|
||||
'artList' => $artList,
|
||||
|
@ -54,8 +54,24 @@ class Login extends BaseController
|
||||
|
||||
//邮箱正则表达式
|
||||
$pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
|
||||
//判断输入的是邮箱还是用户名
|
||||
if (preg_match($pattern, $data['name'])){
|
||||
|
||||
if(preg_match("/^1[34578]\d{9}$/",$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登陆验证
|
||||
$data['email'] = $data['name'];
|
||||
unset($data['name']);
|
||||
@ -89,7 +105,7 @@ class Login extends BaseController
|
||||
return Msgres::error($res);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return View::fetch('login');
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ class User extends BaseController
|
||||
$validate = new userValidate;
|
||||
$result = $validate->scene('Set')->check($data);
|
||||
if(!$result){
|
||||
$this->error($validate->getError());
|
||||
return json(['code'=>-1,'msg' =>$validate->getError()]);
|
||||
} else {
|
||||
//防止重复的email
|
||||
$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();
|
||||
return json(['code'=>0,'msg'=>'资料更新成功']);
|
||||
} else {
|
||||
$this->error($result);
|
||||
return json(['code'=>-1,'msg' =>$result]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -275,7 +275,8 @@ class User extends BaseController
|
||||
$validate = new userValidate;
|
||||
$res = $validate->scene('setPass')->check($data);
|
||||
if(!$res){
|
||||
return $this->error($validate->getError());
|
||||
return json(['code'=>-1,'msg' =>$validate->getError()]);
|
||||
|
||||
}
|
||||
$user = new userModel;
|
||||
$result = $user->setpass($data);
|
||||
@ -284,7 +285,7 @@ class User extends BaseController
|
||||
Cookie::delete('auth');
|
||||
return $this->success('密码修改成功 请登录', (string) url('login/index'));
|
||||
} else {
|
||||
return $this->error($result);
|
||||
return json(['code'=>-1,'msg' =>$result]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -298,9 +299,8 @@ class User extends BaseController
|
||||
//Cookie::delete('user_id');
|
||||
if(Session::has('user_id')){
|
||||
return json(['code' => -1, 'msg' => '退出失败']);
|
||||
} else {
|
||||
return json(['code' => 200, 'msg' => '退出成功', 'url' => '/']);
|
||||
}
|
||||
return json(['code' => 200, 'msg' => '退出成功', 'url' => '/']);
|
||||
}
|
||||
|
||||
}
|
@ -30,7 +30,7 @@ return [
|
||||
'index' => 'index',
|
||||
'home page' => '首页',
|
||||
'user center' => '用户中心',
|
||||
'set info' => '设置',
|
||||
'set info' => '个人设置',
|
||||
'my message' => '我的消息',
|
||||
'my page' => '我的主页',
|
||||
|
||||
|
3
app/index/route/.gitignore
vendored
3
app/index/route/.gitignore
vendored
@ -1 +1,2 @@
|
||||
myroute.php
|
||||
myroute.php
|
||||
a.php
|
@ -9,6 +9,7 @@
|
||||
* Copyright (c) 2020~2022 https://www.aieok.com All rights reserved.
|
||||
*/
|
||||
use think\facade\Route;
|
||||
use think\facade\Request;
|
||||
|
||||
//详情页URL别称
|
||||
$detail_as = config('taoler.url_rewrite.article_as');
|
||||
@ -68,19 +69,24 @@ Route::group('art',function () use($detail_as,$cate_as){
|
||||
Route::get('tag','tag/getAllTag')->name('get_all_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::get($detail_as . ':id$', 'article/detail')->name('article_detail');
|
||||
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>/<type>$', 'article/cate')->name('cate_type');
|
||||
Route::get($cate_as . '<ename>/<type>/<page>$', 'article/cate')->name('cate_page');
|
||||
})->pattern([
|
||||
'ename' => '\w+',
|
||||
'ename' => '[\w|\-]+',
|
||||
'type' => '\w+',
|
||||
'page' => '\d+',
|
||||
'id' => '\d+',
|
||||
]);
|
||||
|
||||
Route::rule('search/[:keywords]', 'index/search'); // 搜索
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
Target Server Version : 80020 (8.0.20)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 14/03/2023 19:57:43
|
||||
Date: 8/06/2023 19:57:43
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
@ -266,6 +266,11 @@ 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 (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 (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
|
||||
@ -313,36 +318,29 @@ CREATE TABLE `tao_collection` (
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) 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
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `tao_comment`;
|
||||
|
||||
CREATE TABLE `tao_comment` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '评论id',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评论',
|
||||
`article_id` int NOT NULL COMMENT '文章id',
|
||||
`user_id` int NOT NULL COMMENT '评论用户',
|
||||
`zan` tinyint NOT NULL DEFAULT 0 COMMENT '赞',
|
||||
`cai` enum('1','0') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '0求解1采纳',
|
||||
`status` enum('0','-1','1') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '1通过0待审-1禁止',
|
||||
`create_time` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
`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 '评论',
|
||||
`article_id` int NOT NULL COMMENT '文章id',
|
||||
`user_id` int NOT NULL COMMENT '评论用户',
|
||||
`to_user_id` int NULL DEFAULT NULL COMMENT '给用户留言',
|
||||
`zan` tinyint NOT NULL DEFAULT 0 COMMENT '赞',
|
||||
`cai` enum('1','0') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '0求解1采纳',
|
||||
`status` enum('0','-1','1') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '1通过0待审-1禁止',
|
||||
`type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '评论类型1帖子2其它',
|
||||
`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,
|
||||
INDEX `aiticle_id`(`article_id` ASC) USING BTREE COMMENT '文章评论索引',
|
||||
INDEX `user_id`(`user_id` ASC) USING BTREE COMMENT '评论用户索引'
|
||||
) 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);
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '评论表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tao_cunsult
|
||||
@ -359,10 +357,6 @@ CREATE TABLE `tao_cunsult` (
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) 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
|
||||
-- ----------------------------
|
||||
@ -376,14 +370,12 @@ CREATE TABLE `tao_friend_link` (
|
||||
`update_time` int NOT NULL COMMENT '更新时间',
|
||||
`delete_time` int NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = MyISAM AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '友情链接' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = MyISAM AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '友情链接' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tao_friend_link
|
||||
-- ----------------------------
|
||||
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);
|
||||
INSERT INTO `tao_friend_link` VALUES (1, 'taoler', 'https://www.aieok.com', '', 0, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tao_mail_server
|
||||
@ -421,13 +413,7 @@ CREATE TABLE `tao_message` (
|
||||
`update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) 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);
|
||||
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tao_message_to
|
||||
@ -444,13 +430,7 @@ CREATE TABLE `tao_message_to` (
|
||||
`update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) 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);
|
||||
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息详细表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tao_push_jscode
|
||||
@ -467,10 +447,6 @@ CREATE TABLE `tao_push_jscode` (
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '站长平台自动推送js代码' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tao_push_jscode
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tao_slider
|
||||
-- ----------------------------
|
||||
@ -489,13 +465,7 @@ CREATE TABLE `tao_slider` (
|
||||
`update_time` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) 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);
|
||||
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tao_system
|
||||
@ -556,10 +526,6 @@ CREATE TABLE `tao_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;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tao_tag
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tao_taglist
|
||||
-- ----------------------------
|
||||
@ -655,10 +621,6 @@ CREATE TABLE `tao_user_sign` (
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) 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
|
||||
-- ----------------------------
|
||||
@ -721,8 +683,4 @@ CREATE TABLE `tao_user_zan` (
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) 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;
|
||||
|
@ -25,16 +25,18 @@ class UserLogin
|
||||
*/
|
||||
public function handle($user)
|
||||
{
|
||||
$type = $user->user['type'];
|
||||
$id = $user->user['id'];
|
||||
|
||||
$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';
|
||||
$type = $user->user['type'];
|
||||
$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'];
|
||||
|
||||
try{
|
||||
$ipInfo = HttpHelper::get($url)->toJson();
|
||||
if($ipInfo->status == 'success')
|
||||
@ -61,21 +63,22 @@ class UserLogin
|
||||
// $city = $arr[2];
|
||||
// }
|
||||
// }
|
||||
|
||||
$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'){
|
||||
$res = $u->allowField(['login_error_num','login_error_time'])->save(['login_error_num'=>$u->login_error_num + 1,'login_error_time'=>time()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($type == 'logError'){
|
||||
$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]);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "taoser/taoler",
|
||||
"description": "the new thinkphp taoler bbs system",
|
||||
"description": "the new thinkphp taolerCMS system",
|
||||
"type": "project",
|
||||
"keywords": [
|
||||
"taoler",
|
||||
|
583
composer.lock
generated
583
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@ return [
|
||||
// 应用名,此项不可更改
|
||||
'appname' => 'TaoLer',
|
||||
// 版本配置
|
||||
'version' => '2.3.5',
|
||||
'version' => '2.3.9',
|
||||
// 加盐
|
||||
'salt' => 'taoler',
|
||||
// 数据库备份目录
|
||||
|
@ -14,6 +14,7 @@ use think\Response;
|
||||
|
||||
class Api
|
||||
{
|
||||
public $code;
|
||||
/**
|
||||
* @param $url
|
||||
* @param $data
|
||||
|
@ -282,7 +282,7 @@ class FormHlp
|
||||
$switchStr = $switchArr ? lang($switchArr[1]) . '|' . lang($switchArr[0]) : lang('open') . '|' . 'close';
|
||||
$str = '<div class="layui-form-item">' .$this->label($label,$options) . '
|
||||
<div class="layui-input-block">
|
||||
<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) . '"/>
|
||||
<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) . '"/>
|
||||
' . $this->tips($options) . '
|
||||
</div>
|
||||
</div>';
|
||||
|
@ -32,9 +32,9 @@ if (!function_exists('form_switch')) {
|
||||
* @param $value
|
||||
* @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')) {
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -80,7 +80,7 @@ layui.define(['form', 'upload'], function(exports){
|
||||
var field = data.field;
|
||||
var URL = $(this).data('url');
|
||||
$.post(URL, field,function(res){
|
||||
if(res.code == 0){
|
||||
if(res.code === 0){
|
||||
layer.msg(res.msg,{icon:6,tiye:2000},function(){
|
||||
location.reload();
|
||||
});
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Before (image error) Size: 299 KiB After (image error) Size: 322 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -4,6 +4,7 @@ html,body{overflow-x: hidden;}
|
||||
html body{margin-top: 61px;}
|
||||
html{background-color: #F2F2F2;}
|
||||
i{font-style: normal;}
|
||||
h1,h2,h3 {font-weight: 400;}
|
||||
|
||||
/* 布局 */
|
||||
.layui-mm{position: fixed; top: 100px; bottom: 0;}
|
||||
@ -25,7 +26,7 @@ i{font-style: normal;}
|
||||
.site-mobile .site-menu{left: 0;}
|
||||
.site-mobile .site-mobile-shade-top{content: ''; position: fixed; top: 0; bottom: 0; left: 0; right: 0; background-color: rgba(0,0,0,.8); z-index: 999;}
|
||||
.site-tree-mobile-top i{font-size: 30px;}
|
||||
|
||||
|
||||
/* 底部伸缩菜单栏 */
|
||||
.site-tree-mobile{display: block!important; position: fixed; z-index: 16666669; bottom: 15px; left: 15px; width: 30px; height: 30px; line-height: 30px; border-radius: 2px; text-align: center; background-color: #009688; color: #fff;}
|
||||
.site-home .site-tree-mobile{display: none!important;}
|
||||
@ -34,7 +35,7 @@ i{font-style: normal;}
|
||||
.site-tree-mobile i{font-size: 20px;}
|
||||
.site-mobile .layui-side{left: 0;}
|
||||
.site-mobile .layui-side-child{top: 50%; left: 200px; height: 300px; margin-top: -100px;}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* 图标 */
|
||||
@ -182,6 +183,7 @@ 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 .layui-container{position: relative; height: 100%; line-height: 60px; text-align: center;}
|
||||
.fly-logo{position: absolute; left: 15px;}
|
||||
.fly-logo img {width:135px; height: 37px;}
|
||||
.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;}
|
||||
@ -230,7 +232,7 @@ pre{overflow-y: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 搜索 */
|
||||
/* 搜索 */
|
||||
.fly-search{display: inline-block; width: 50px; margin-right: 10px; cursor: pointer; font-size: 20px;}
|
||||
.fly-search .layui-icon{font-size: 20px;}
|
||||
.fly-search:hover{color: #5FB878;}
|
||||
@ -390,7 +392,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 span{display: inline-block; font-size: 12px; padding-left: 5px;}
|
||||
|
||||
/* 签到 */
|
||||
/* 签到 */
|
||||
.fly-signin cite{padding: 0 5px; color: #FF5722; font-style: normal;}
|
||||
.fly-signin .layui-badge-dot{top: -7px; margin-left: 0px;}
|
||||
.fly-signin-list{padding: 0; line-height: 30px;}
|
||||
@ -469,7 +471,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
/*详情页管理工具条*/
|
||||
.detail-assist{
|
||||
position: fixed;
|
||||
width: 35px;
|
||||
width: 35px;
|
||||
right: calc(50% - 625px);
|
||||
top: 200px;
|
||||
margin: 0 auto;
|
||||
@ -523,7 +525,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
*/
|
||||
|
||||
.layui-form-pane{position:relative; width:100%;}
|
||||
.que-comments{position:absolute;right:20px;bottom:5px;}
|
||||
.que-comments{position:absolute; right:15px; bottom:15px;}
|
||||
|
||||
.wenda-user{height:200px; margin: 0,auto; text-align: center; pardding-top:20px;}
|
||||
.wenda-user .user-img{posation:relative; width:100%;}
|
||||
@ -536,7 +538,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:hover{color:#666;}
|
||||
.detail-zan span .icon-zan{font-size: 22px;}
|
||||
.detail-zan span img{height: 25px; border-radius: 100%;}
|
||||
.detail-zan span img{height: 25px; width:25px; border-radius: 100%; object-fit: cover;}
|
||||
|
||||
|
||||
/* 详情页的底部操作条 */
|
||||
@ -576,7 +578,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 .fly-avatar{left: 0; top: 0;}
|
||||
|
||||
.jieda-body{margin: 25px 0 20px; min-height: 0; line-height: 24px; font-size:14px;}
|
||||
.jieda-body{margin: 10px 0; min-height: 0; line-height: 24px; font-size:14px;}
|
||||
.jieda-body p{margin-bottom: 10px;}
|
||||
.jieda-body a{color:#4f99cf}
|
||||
.jieda-reply{position:relative; font-size: 14px}
|
||||
@ -598,6 +600,10 @@ body .fly-user-main{position: relative; min-height: 600px;}
|
||||
.fly-user-main .fly-none{min-height: 0;}
|
||||
.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 .iconfont{font-size:26px; padding: 0 5px;}
|
||||
.fly-form-app .icon-qq{color:#7CA9C9}
|
||||
@ -680,7 +686,7 @@ body .fly-user-main{position: relative; min-height: 600px;}
|
||||
.fly-case-tab .tab-this{background-color: #009688; color: #fff;}
|
||||
|
||||
.fly-case-list{margin-top: 15px; font-size: 0;}
|
||||
.fly-case-list li,
|
||||
.fly-case-list li,
|
||||
.layer-ext-ul li{display: inline-block; vertical-align: middle; *display: inline; *zoom:1; font-size: 14px; background-color: #fff;}
|
||||
.fly-case-list{width: 110%;}
|
||||
.fly-case-list li{width: 239px; margin: 0 15px 15px 0; padding: 10px;}
|
||||
@ -719,7 +725,7 @@ body .fly-user-main{position: relative; min-height: 600px;}
|
||||
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.fly-main{width: 100%;}
|
||||
.fly-main{width: 100%;}
|
||||
|
||||
/* 顶边距 */
|
||||
.fly-marginTop{margin-top: 0;}
|
||||
@ -833,7 +839,7 @@ blockquote {
|
||||
@media (max-width:767px) {.footer-col {margin-right:0}
|
||||
}
|
||||
@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-sns {float:right;margin-right:0}
|
||||
@ -863,19 +869,19 @@ blockquote {
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.container {
|
||||
width:750px;
|
||||
width:750px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.container {
|
||||
width:970px;
|
||||
width:970px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.container {
|
||||
width:1170px;
|
||||
width:1170px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1018,9 +1024,9 @@ blockquote {
|
||||
}
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 0;
|
||||
}
|
||||
figure {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@media (min-width: 768px){
|
||||
.ml-md-2, .mx-md-2 {
|
||||
@ -1028,11 +1034,11 @@ blockquote {
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px){
|
||||
.mr-md-2, .mx-md-2 {
|
||||
margin-right: .5rem !important;
|
||||
}
|
||||
@media (min-width: 768px){
|
||||
.mr-md-2, .mx-md-2 {
|
||||
margin-right: .5rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.ml-1, .mx-1 {
|
||||
@ -1045,34 +1051,34 @@ blockquote {
|
||||
.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;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.d-flex {
|
||||
display: -ms-flexbox !important;
|
||||
display: flex !important;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 991.98px) {
|
||||
.card, .block {margin-bottom: 1rem;}
|
||||
}
|
||||
@media (min-width: 768px) and (max-width: 991.98px) {
|
||||
.card, .block {margin-bottom: 1rem;}
|
||||
}
|
||||
|
||||
|
||||
|
105
public/static/res/mods/imagecut.js
Normal file
105
public/static/res/mods/imagecut.js
Normal file
@ -0,0 +1,105 @@
|
||||
/**
|
||||
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);
|
||||
|
||||
});
|
@ -696,42 +696,6 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'],
|
||||
//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: '250px'
|
||||
,anim: 'fade'
|
||||
});
|
||||
|
||||
var resizeTopline = function(){
|
||||
var width = $(this).prop('innerWidth');
|
||||
if(width >= 1200){
|
||||
ins.reload({
|
||||
height: '250px'
|
||||
});
|
||||
} else if(width >= 992){
|
||||
ins.reload({
|
||||
height: '250px'
|
||||
});
|
||||
} else if(width >= 768){
|
||||
ins.reload({
|
||||
height: '166px'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
resizeTopline()
|
||||
|
||||
$(window).on('resize', resizeTopline);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//签到
|
||||
|
||||
//活跃榜
|
||||
|
@ -234,27 +234,29 @@ layui.define('fly', function(exports){
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
,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('求解中');
|
||||
,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);
|
||||
}
|
||||
} else {
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
1225
public/static/res/mods/toast.js
Normal file
1225
public/static/res/mods/toast.js
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
7
public/view/common/blog/js/view-image.min.js
vendored
7
public/view/common/blog/js/view-image.min.js
vendored
File diff suppressed because one or more lines are too long
137
vendor/composer/ClassLoader.php
vendored
137
vendor/composer/ClassLoader.php
vendored
@ -42,35 +42,37 @@ namespace Composer\Autoload;
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var ?string */
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var string|null */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, int>>
|
||||
* @var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<int, string>>
|
||||
* @var array<string, list<string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, string[]>>
|
||||
* List of PSR-0 prefixes
|
||||
*
|
||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||
*
|
||||
* @var array<string, array<string, list<string>>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
@ -78,8 +80,7 @@ class ClassLoader
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @psalm-var array<string, string>
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
@ -87,29 +88,29 @@ class ClassLoader
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var bool[]
|
||||
* @psalm-var array<string, bool>
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var ?string */
|
||||
/** @var string|null */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var self[]
|
||||
* @var array<string, self>
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param ?string $vendorDir
|
||||
* @param string|null $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
@ -121,8 +122,7 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, array<int, string>>
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
@ -130,8 +130,7 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
@ -139,8 +138,7 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
@ -148,8 +146,7 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[] Array of classname => path
|
||||
* @psalm-return array<string, string>
|
||||
* @return array<string, string> Array of classname => path
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
@ -157,8 +154,7 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $classMap Class to filename map
|
||||
* @psalm-param array<string, string> $classMap
|
||||
* @param array<string, string> $classMap Class to filename map
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -175,24 +171,25 @@ class ClassLoader
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param string[]|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
|
||||
@ -201,19 +198,19 @@ class ClassLoader
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -222,9 +219,9 @@ class ClassLoader
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param string[]|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
@ -232,17 +229,18 @@ class ClassLoader
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
@ -252,18 +250,18 @@ class ClassLoader
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -272,8 +270,8 @@ class ClassLoader
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param string[]|string $paths The PSR-0 base directories
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -290,8 +288,8 @@ class ClassLoader
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param string[]|string $paths The PSR-4 base directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
@ -425,7 +423,8 @@ class ClassLoader
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -476,9 +475,9 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||
*
|
||||
* @return self[]
|
||||
* @return array<string, self>
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
@ -555,18 +554,26 @@ class ClassLoader
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
* @private
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
}
|
||||
}
|
||||
|
17
vendor/composer/InstalledVersions.php
vendored
17
vendor/composer/InstalledVersions.php
vendored
@ -98,7 +98,7 @@ class InstalledVersions
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ class InstalledVersions
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
@ -328,7 +328,9 @@ class InstalledVersions
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $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 */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
@ -340,12 +342,17 @@ class InstalledVersions
|
||||
// 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
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = require __DIR__ . '/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 */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
$installed[] = self::$installed;
|
||||
|
||||
if (self::$installed !== array()) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
|
||||
return $installed;
|
||||
}
|
||||
|
2
vendor/composer/autoload_psr4.php
vendored
2
vendor/composer/autoload_psr4.php
vendored
@ -14,7 +14,7 @@ return array(
|
||||
'think\\composer\\' => array($vendorDir . '/topthink/think-installer/src'),
|
||||
'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'),
|
||||
'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'),
|
||||
'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src'),
|
||||
'think\\' => array($vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src', $vendorDir . '/topthink/framework/src/think'),
|
||||
'taoser\\think\\' => array($vendorDir . '/taoser/think-auth/src'),
|
||||
'taoser\\' => array($vendorDir . '/taoser/think-addons/src', $vendorDir . '/taoser/think-setarr/src'),
|
||||
'phpspirit\\databackup\\' => array($vendorDir . '/lotofbadcode/phpspirit_databackup/src'),
|
||||
|
27
vendor/composer/autoload_real.php
vendored
27
vendor/composer/autoload_real.php
vendored
@ -33,25 +33,18 @@ class ComposerAutoloaderInit1b32198725235c8d6500c87262ef30c2
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire1b32198725235c8d6500c87262ef30c2($fileIdentifier, $file);
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
||||
require $file;
|
||||
}
|
||||
}, null, null);
|
||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||
$requireFile($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -176,10 +176,10 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
|
||||
),
|
||||
'think\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/topthink/framework/src/think',
|
||||
1 => __DIR__ . '/..' . '/topthink/think-helper/src',
|
||||
2 => __DIR__ . '/..' . '/topthink/think-orm/src',
|
||||
3 => __DIR__ . '/..' . '/topthink/think-template/src',
|
||||
0 => __DIR__ . '/..' . '/topthink/think-helper/src',
|
||||
1 => __DIR__ . '/..' . '/topthink/think-orm/src',
|
||||
2 => __DIR__ . '/..' . '/topthink/think-template/src',
|
||||
3 => __DIR__ . '/..' . '/topthink/framework/src/think',
|
||||
),
|
||||
'taoser\\think\\' =>
|
||||
array (
|
||||
|
229
vendor/composer/installed.json
vendored
229
vendor/composer/installed.json
vendored
@ -491,18 +491,24 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
"version": "1.5.2",
|
||||
"version_normalized": "1.5.2.0",
|
||||
"version": "1.5.3",
|
||||
"version_normalized": "1.5.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/promises.git",
|
||||
"reference": "b94b2807d85443f9719887892882d0329d1e2598"
|
||||
"reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598",
|
||||
"reference": "b94b2807d85443f9719887892882d0329d1e2598",
|
||||
"shasum": ""
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e",
|
||||
"reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5"
|
||||
@ -510,13 +516,8 @@
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "^4.4 || ^5.1"
|
||||
},
|
||||
"time": "2022-08-28T14:55:35+00:00",
|
||||
"time": "2023-05-21T12:31:43+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.5-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"files": [
|
||||
@ -558,7 +559,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/promises/issues",
|
||||
"source": "https://github.com/guzzle/promises/tree/1.5.2"
|
||||
"source": "https://github.com/guzzle/promises/tree/1.5.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -849,17 +850,17 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/serializable-closure",
|
||||
"version": "v1.2.2",
|
||||
"version_normalized": "1.2.2.0",
|
||||
"version": "v1.3.1",
|
||||
"version_normalized": "1.3.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/serializable-closure.git",
|
||||
"reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae"
|
||||
"reference": "e5a3057a5591e1cfe8183034b0203921abe2c902"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae",
|
||||
"reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/e5a3057a5591e1cfe8183034b0203921abe2c902",
|
||||
"reference": "e5a3057a5591e1cfe8183034b0203921abe2c902",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -871,7 +872,7 @@
|
||||
"phpstan/phpstan": "^1.8.2",
|
||||
"symfony/var-dumper": "^5.4.11"
|
||||
},
|
||||
"time": "2022-09-08T13:45:54+00:00",
|
||||
"time": "2023-07-14T13:56:28+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -1393,24 +1394,18 @@
|
||||
},
|
||||
{
|
||||
"name": "phpmailer/phpmailer",
|
||||
"version": "v6.7.1",
|
||||
"version_normalized": "6.7.1.0",
|
||||
"version": "v6.8.0",
|
||||
"version_normalized": "6.8.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||
"reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55"
|
||||
"reference": "df16b615e371d81fb79e506277faea67a1be18f1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55",
|
||||
"reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1",
|
||||
"reference": "df16b615e371d81fb79e506277faea67a1be18f1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-ctype": "*",
|
||||
@ -1438,7 +1433,7 @@
|
||||
"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"
|
||||
},
|
||||
"time": "2022-12-08T13:30:06+00:00",
|
||||
"time": "2023-03-06T14:43:22+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -1470,7 +1465,7 @@
|
||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.7.1"
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1647,24 +1642,24 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/http-client",
|
||||
"version": "1.0.1",
|
||||
"version_normalized": "1.0.1.0",
|
||||
"version": "1.0.2",
|
||||
"version_normalized": "1.0.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-client.git",
|
||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
|
||||
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
||||
"url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31",
|
||||
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.0 || ^8.0",
|
||||
"psr/http-message": "^1.0"
|
||||
"psr/http-message": "^1.0 || ^2.0"
|
||||
},
|
||||
"time": "2020-06-29T06:28:15+00:00",
|
||||
"time": "2023-04-10T20:12:12+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -1684,7 +1679,7 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for HTTP clients",
|
||||
@ -1696,7 +1691,7 @@
|
||||
"psr-18"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-client/tree/master"
|
||||
"source": "https://github.com/php-fig/http-client/tree/1.0.2"
|
||||
},
|
||||
"install-path": "../psr/http-client"
|
||||
},
|
||||
@ -2294,24 +2289,18 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-exporter",
|
||||
"version": "v5.4.21",
|
||||
"version_normalized": "5.4.21.0",
|
||||
"version": "v5.4.26",
|
||||
"version_normalized": "5.4.26.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-exporter.git",
|
||||
"reference": "be74908a6942fdd331554b3cec27ff41b45ccad4"
|
||||
"reference": "11401fe94f960249b3c63a488c63ba73091c1e4a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/be74908a6942fdd331554b3cec27ff41b45ccad4",
|
||||
"reference": "be74908a6942fdd331554b3cec27ff41b45ccad4",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/11401fe94f960249b3c63a488c63ba73091c1e4a",
|
||||
"reference": "11401fe94f960249b3c63a488c63ba73091c1e4a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
@ -2320,7 +2309,7 @@
|
||||
"require-dev": {
|
||||
"symfony/var-dumper": "^4.4.9|^5.0.9|^6.0"
|
||||
},
|
||||
"time": "2023-02-21T19:46:44+00:00",
|
||||
"time": "2023-07-20T07:21:16+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -2356,7 +2345,7 @@
|
||||
"serialize"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-exporter/tree/v5.4.21"
|
||||
"source": "https://github.com/symfony/var-exporter/tree/v5.4.26"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -2376,24 +2365,18 @@
|
||||
},
|
||||
{
|
||||
"name": "taoser/think-addons",
|
||||
"version": "v1.0.6",
|
||||
"version_normalized": "1.0.6.0",
|
||||
"version": "v1.0.9",
|
||||
"version_normalized": "1.0.9.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/taoser/think-addons.git",
|
||||
"reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541"
|
||||
"reference": "00112adf200b897deecbd1bbabc33ad22377b008"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/taoser/think-addons/zipball/e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
|
||||
"reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"url": "https://api.github.com/repos/taoser/think-addons/zipball/00112adf200b897deecbd1bbabc33ad22377b008",
|
||||
"reference": "00112adf200b897deecbd1bbabc33ad22377b008",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
@ -2402,7 +2385,7 @@
|
||||
"topthink/think-helper": "^3.0.0",
|
||||
"topthink/think-view": "^1.0"
|
||||
},
|
||||
"time": "2022-10-06T13:11:38+00:00",
|
||||
"time": "2023-06-10T05:08:45+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"think": {
|
||||
@ -2436,7 +2419,7 @@
|
||||
"description": "The ThinkPHP6 Addons Package",
|
||||
"support": {
|
||||
"issues": "https://github.com/taoser/think-addons/issues",
|
||||
"source": "https://github.com/taoser/think-addons/tree/v1.0.6"
|
||||
"source": "https://github.com/taoser/think-addons/tree/v1.0.9"
|
||||
},
|
||||
"install-path": "../taoser/think-addons"
|
||||
},
|
||||
@ -2610,24 +2593,18 @@
|
||||
},
|
||||
{
|
||||
"name": "topthink/framework",
|
||||
"version": "v6.1.2",
|
||||
"version_normalized": "6.1.2.0",
|
||||
"version": "v6.1.4",
|
||||
"version_normalized": "6.1.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/framework.git",
|
||||
"reference": "67235be5b919aaaf1de5aed9839f65d8e766aca3"
|
||||
"reference": "66eb9cf4d627df12911344cd328faf9bb596bf2c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/framework/zipball/67235be5b919aaaf1de5aed9839f65d8e766aca3",
|
||||
"reference": "67235be5b919aaaf1de5aed9839f65d8e766aca3",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"url": "https://api.github.com/repos/top-think/framework/zipball/66eb9cf4d627df12911344cd328faf9bb596bf2c",
|
||||
"reference": "66eb9cf4d627df12911344cd328faf9bb596bf2c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
@ -2646,7 +2623,7 @@
|
||||
"mockery/mockery": "^1.2",
|
||||
"phpunit/phpunit": "^7.0"
|
||||
},
|
||||
"time": "2023-02-08T02:24:01+00:00",
|
||||
"time": "2023-07-11T15:16:03+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -2678,7 +2655,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/top-think/framework/issues",
|
||||
"source": "https://github.com/top-think/framework/tree/v6.1.2"
|
||||
"source": "https://github.com/top-think/framework/tree/v6.1.4"
|
||||
},
|
||||
"install-path": "../topthink/framework"
|
||||
},
|
||||
@ -2855,27 +2832,21 @@
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-migration",
|
||||
"version": "v3.0.4",
|
||||
"version_normalized": "3.0.4.0",
|
||||
"version": "v3.0.6",
|
||||
"version_normalized": "3.0.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/think-migration.git",
|
||||
"reference": "c5880669b277762d5ff935e551bc0d5c71de6811"
|
||||
"reference": "82c4226cb14f973b9377c7fc6e89c525cbb8b030"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-migration/zipball/c5880669b277762d5ff935e551bc0d5c71de6811",
|
||||
"reference": "c5880669b277762d5ff935e551bc0d5c71de6811",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"url": "https://api.github.com/repos/top-think/think-migration/zipball/82c4226cb14f973b9377c7fc6e89c525cbb8b030",
|
||||
"reference": "82c4226cb14f973b9377c7fc6e89c525cbb8b030",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"topthink/framework": "^6.0",
|
||||
"topthink/framework": "^6.0 || ^8.0",
|
||||
"topthink/think-helper": "^3.0.3"
|
||||
},
|
||||
"require-dev": {
|
||||
@ -2884,7 +2855,7 @@
|
||||
"suggest": {
|
||||
"fzaninotto/faker": "Required to use the factory builder (^1.8)."
|
||||
},
|
||||
"time": "2022-10-26T07:57:54+00:00",
|
||||
"time": "2023-07-01T11:01:52+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"think": {
|
||||
@ -2912,23 +2883,23 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/top-think/think-migration/issues",
|
||||
"source": "https://github.com/top-think/think-migration/tree/v3.0.4"
|
||||
"source": "https://github.com/top-think/think-migration/tree/v3.0.6"
|
||||
},
|
||||
"install-path": "../topthink/think-migration"
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-multi-app",
|
||||
"version": "v1.0.16",
|
||||
"version_normalized": "1.0.16.0",
|
||||
"version": "v1.0.17",
|
||||
"version_normalized": "1.0.17.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/think-multi-app.git",
|
||||
"reference": "07b9183855150455e1f76f8cbe9d77d6d1bc399f"
|
||||
"reference": "4055a6187296ac16c0bc7bbab4ed5d92f82f791c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-multi-app/zipball/07b9183855150455e1f76f8cbe9d77d6d1bc399f",
|
||||
"reference": "07b9183855150455e1f76f8cbe9d77d6d1bc399f",
|
||||
"url": "https://api.github.com/repos/top-think/think-multi-app/zipball/4055a6187296ac16c0bc7bbab4ed5d92f82f791c",
|
||||
"reference": "4055a6187296ac16c0bc7bbab4ed5d92f82f791c",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -2941,7 +2912,7 @@
|
||||
"php": ">=7.1.0",
|
||||
"topthink/framework": "^6.0|^8.0"
|
||||
},
|
||||
"time": "2023-02-07T08:40:09+00:00",
|
||||
"time": "2023-03-29T02:04:29+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"think": {
|
||||
@ -2966,10 +2937,10 @@
|
||||
"email": "liu21st@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "thinkphp6 multi app support",
|
||||
"description": "thinkphp multi app support",
|
||||
"support": {
|
||||
"issues": "https://github.com/top-think/think-multi-app/issues",
|
||||
"source": "https://github.com/top-think/think-multi-app/tree/v1.0.16"
|
||||
"source": "https://github.com/top-think/think-multi-app/tree/v1.0.17"
|
||||
},
|
||||
"install-path": "../topthink/think-multi-app"
|
||||
},
|
||||
@ -3292,30 +3263,24 @@
|
||||
},
|
||||
{
|
||||
"name": "workerman/phpsocket.io",
|
||||
"version": "v1.1.16",
|
||||
"version_normalized": "1.1.16.0",
|
||||
"version": "v1.1.18",
|
||||
"version_normalized": "1.1.18.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/walkor/phpsocket.io.git",
|
||||
"reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304"
|
||||
"reference": "b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/f4dc14e69e9d0d8ce69c6180f93b76b7743f2304",
|
||||
"reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b",
|
||||
"reference": "b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"workerman/channel": ">=1.0.0",
|
||||
"workerman/workerman": ">=4.0.0"
|
||||
"workerman/workerman": "^4.0.0"
|
||||
},
|
||||
"time": "2022-11-25T13:00:18+00:00",
|
||||
"time": "2023-06-16T01:41:34+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -3333,7 +3298,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/walkor/phpsocket.io/issues",
|
||||
"source": "https://github.com/walkor/phpsocket.io/tree/v1.1.16"
|
||||
"source": "https://github.com/walkor/phpsocket.io/tree/v1.1.18"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -3349,24 +3314,18 @@
|
||||
},
|
||||
{
|
||||
"name": "workerman/workerman",
|
||||
"version": "v4.1.10",
|
||||
"version_normalized": "4.1.10.0",
|
||||
"version": "v4.1.13",
|
||||
"version_normalized": "4.1.13.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/walkor/workerman.git",
|
||||
"reference": "e967b79f95b9251a72acb971be05623ec1a51e83"
|
||||
"reference": "807780ff672775fcd08f89e573a2824e939021ce"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/walkor/workerman/zipball/e967b79f95b9251a72acb971be05623ec1a51e83",
|
||||
"reference": "e967b79f95b9251a72acb971be05623ec1a51e83",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"url": "https://api.github.com/repos/walkor/workerman/zipball/807780ff672775fcd08f89e573a2824e939021ce",
|
||||
"reference": "807780ff672775fcd08f89e573a2824e939021ce",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0"
|
||||
@ -3374,7 +3333,7 @@
|
||||
"suggest": {
|
||||
"ext-event": "For better performance. "
|
||||
},
|
||||
"time": "2023-05-01T02:12:20+00:00",
|
||||
"time": "2023-07-31T05:57:25+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
78
vendor/composer/installed.php
vendored
78
vendor/composer/installed.php
vendored
@ -1,9 +1,9 @@
|
||||
<?php return array(
|
||||
'root' => array(
|
||||
'name' => 'taoser/taoler',
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '3f1e60a9976d29a84fa29d28bdfe68dea0c89c26',
|
||||
'pretty_version' => '2.3.10.x-dev',
|
||||
'version' => '2.3.10.9999999-dev',
|
||||
'reference' => '0c2f0154a81dd0a6268da627982d1bf41c0ef231',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
@ -74,9 +74,9 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'guzzlehttp/promises' => array(
|
||||
'pretty_version' => '1.5.2',
|
||||
'version' => '1.5.2.0',
|
||||
'reference' => 'b94b2807d85443f9719887892882d0329d1e2598',
|
||||
'pretty_version' => '1.5.3',
|
||||
'version' => '1.5.3.0',
|
||||
'reference' => '67ab6e18aaa14d753cc148911d273f6e6cb6721e',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../guzzlehttp/promises',
|
||||
'aliases' => array(),
|
||||
@ -119,9 +119,9 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'laravel/serializable-closure' => array(
|
||||
'pretty_version' => 'v1.2.2',
|
||||
'version' => '1.2.2.0',
|
||||
'reference' => '47afb7fae28ed29057fdca37e16a84f90cc62fae',
|
||||
'pretty_version' => 'v1.3.1',
|
||||
'version' => '1.3.1.0',
|
||||
'reference' => 'e5a3057a5591e1cfe8183034b0203921abe2c902',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../laravel/serializable-closure',
|
||||
'aliases' => array(),
|
||||
@ -191,9 +191,9 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'phpmailer/phpmailer' => array(
|
||||
'pretty_version' => 'v6.7.1',
|
||||
'version' => '6.7.1.0',
|
||||
'reference' => '49cd7ea3d2563f028d7811f06864a53b1f15ff55',
|
||||
'pretty_version' => 'v6.8.0',
|
||||
'version' => '6.8.0.0',
|
||||
'reference' => 'df16b615e371d81fb79e506277faea67a1be18f1',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
|
||||
'aliases' => array(),
|
||||
@ -239,9 +239,9 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/http-client' => array(
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
|
||||
'pretty_version' => '1.0.2',
|
||||
'version' => '1.0.2.0',
|
||||
'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/http-client',
|
||||
'aliases' => array(),
|
||||
@ -338,27 +338,27 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/var-exporter' => array(
|
||||
'pretty_version' => 'v5.4.21',
|
||||
'version' => '5.4.21.0',
|
||||
'reference' => 'be74908a6942fdd331554b3cec27ff41b45ccad4',
|
||||
'pretty_version' => 'v5.4.26',
|
||||
'version' => '5.4.26.0',
|
||||
'reference' => '11401fe94f960249b3c63a488c63ba73091c1e4a',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/var-exporter',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'taoser/taoler' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '3f1e60a9976d29a84fa29d28bdfe68dea0c89c26',
|
||||
'pretty_version' => '2.3.10.x-dev',
|
||||
'version' => '2.3.10.9999999-dev',
|
||||
'reference' => '0c2f0154a81dd0a6268da627982d1bf41c0ef231',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'taoser/think-addons' => array(
|
||||
'pretty_version' => 'v1.0.6',
|
||||
'version' => '1.0.6.0',
|
||||
'reference' => 'e6e35bfd8b93dc469ebb5c5530ba350131bd7541',
|
||||
'pretty_version' => 'v1.0.9',
|
||||
'version' => '1.0.9.0',
|
||||
'reference' => '00112adf200b897deecbd1bbabc33ad22377b008',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../taoser/think-addons',
|
||||
'aliases' => array(),
|
||||
@ -392,9 +392,9 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'topthink/framework' => array(
|
||||
'pretty_version' => 'v6.1.2',
|
||||
'version' => '6.1.2.0',
|
||||
'reference' => '67235be5b919aaaf1de5aed9839f65d8e766aca3',
|
||||
'pretty_version' => 'v6.1.4',
|
||||
'version' => '6.1.4.0',
|
||||
'reference' => '66eb9cf4d627df12911344cd328faf9bb596bf2c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../topthink/framework',
|
||||
'aliases' => array(),
|
||||
@ -428,18 +428,18 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'topthink/think-migration' => array(
|
||||
'pretty_version' => 'v3.0.4',
|
||||
'version' => '3.0.4.0',
|
||||
'reference' => 'c5880669b277762d5ff935e551bc0d5c71de6811',
|
||||
'pretty_version' => 'v3.0.6',
|
||||
'version' => '3.0.6.0',
|
||||
'reference' => '82c4226cb14f973b9377c7fc6e89c525cbb8b030',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../topthink/think-migration',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'topthink/think-multi-app' => array(
|
||||
'pretty_version' => 'v1.0.16',
|
||||
'version' => '1.0.16.0',
|
||||
'reference' => '07b9183855150455e1f76f8cbe9d77d6d1bc399f',
|
||||
'pretty_version' => 'v1.0.17',
|
||||
'version' => '1.0.17.0',
|
||||
'reference' => '4055a6187296ac16c0bc7bbab4ed5d92f82f791c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../topthink/think-multi-app',
|
||||
'aliases' => array(),
|
||||
@ -500,18 +500,18 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'workerman/phpsocket.io' => array(
|
||||
'pretty_version' => 'v1.1.16',
|
||||
'version' => '1.1.16.0',
|
||||
'reference' => 'f4dc14e69e9d0d8ce69c6180f93b76b7743f2304',
|
||||
'pretty_version' => 'v1.1.18',
|
||||
'version' => '1.1.18.0',
|
||||
'reference' => 'b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../workerman/phpsocket.io',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'workerman/workerman' => array(
|
||||
'pretty_version' => 'v4.1.10',
|
||||
'version' => '4.1.10.0',
|
||||
'reference' => 'e967b79f95b9251a72acb971be05623ec1a51e83',
|
||||
'pretty_version' => 'v4.1.13',
|
||||
'version' => '4.1.13.0',
|
||||
'reference' => '807780ff672775fcd08f89e573a2824e939021ce',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../workerman/workerman',
|
||||
'aliases' => array(),
|
||||
|
6
vendor/guzzlehttp/promises/CHANGELOG.md
vendored
6
vendor/guzzlehttp/promises/CHANGELOG.md
vendored
@ -1,5 +1,11 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 1.5.3 - 2023-05-21
|
||||
|
||||
### Changed
|
||||
|
||||
- Removed remaining usage of deprecated functions
|
||||
|
||||
## 1.5.2 - 2022-08-07
|
||||
|
||||
### Changed
|
||||
|
5
vendor/guzzlehttp/promises/composer.json
vendored
5
vendor/guzzlehttp/promises/composer.json
vendored
@ -46,11 +46,6 @@
|
||||
"test": "vendor/bin/simple-phpunit",
|
||||
"test-ci": "vendor/bin/simple-phpunit --coverage-text"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.5-dev"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
|
2
vendor/guzzlehttp/promises/src/Each.php
vendored
2
vendor/guzzlehttp/promises/src/Each.php
vendored
@ -78,7 +78,7 @@ final class Each
|
||||
$concurrency,
|
||||
callable $onFulfilled = null
|
||||
) {
|
||||
return each_limit(
|
||||
return self::ofLimit(
|
||||
$iterable,
|
||||
$concurrency,
|
||||
$onFulfilled,
|
||||
|
2
vendor/guzzlehttp/promises/src/Utils.php
vendored
2
vendor/guzzlehttp/promises/src/Utils.php
vendored
@ -107,7 +107,7 @@ final class Utils
|
||||
{
|
||||
$results = [];
|
||||
foreach ($promises as $key => $promise) {
|
||||
$results[$key] = inspect($promise);
|
||||
$results[$key] = self::inspect($promise);
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
@ -51,8 +51,10 @@ echo $closure(); // james;
|
||||
|
||||
### Caveats
|
||||
|
||||
1. Creating **anonymous classes** within closures is not supported.
|
||||
2. Using attributes within closures is not supported.
|
||||
* Anonymous classes cannot be created within closures.
|
||||
* Attributes cannot be used within closures.
|
||||
* Serializing closures on REPL environments like Laravel Tinker is not supported.
|
||||
* Serializing closures that reference objects with readonly properties is not supported.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@ -62,6 +62,17 @@ class SerializableClosure
|
||||
return $this->serializable->getClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new unsigned serializable closure instance.
|
||||
*
|
||||
* @param Closure $closure
|
||||
* @return \Laravel\SerializableClosure\UnsignedSerializableClosure
|
||||
*/
|
||||
public static function unsigned(Closure $closure)
|
||||
{
|
||||
return new UnsignedSerializableClosure($closure);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the serializable closure secret key.
|
||||
*
|
||||
|
@ -10,6 +10,7 @@ use Laravel\SerializableClosure\Support\ClosureScope;
|
||||
use Laravel\SerializableClosure\Support\ClosureStream;
|
||||
use Laravel\SerializableClosure\Support\ReflectionClosure;
|
||||
use Laravel\SerializableClosure\Support\SelfReference;
|
||||
use Laravel\SerializableClosure\UnsignedSerializableClosure;
|
||||
use ReflectionObject;
|
||||
use UnitEnum;
|
||||
|
||||
@ -379,7 +380,7 @@ class Native implements Serializable
|
||||
|
||||
$item = $property->getValue($data);
|
||||
|
||||
if ($item instanceof SerializableClosure || ($item instanceof SelfReference && $item->hash === $this->code['self'])) {
|
||||
if ($item instanceof SerializableClosure || $item instanceof UnsignedSerializableClosure || ($item instanceof SelfReference && $item->hash === $this->code['self'])) {
|
||||
$this->code['objects'][] = [
|
||||
'instance' => $data,
|
||||
'property' => $property,
|
||||
@ -452,7 +453,7 @@ class Native implements Serializable
|
||||
}
|
||||
|
||||
unset($value);
|
||||
} elseif (is_object($data) && ! $data instanceof SerializableClosure) {
|
||||
} elseif (is_object($data) && ! $data instanceof SerializableClosure && ! $data instanceof UnsignedSerializableClosure) {
|
||||
if (isset($this->scope[$data])) {
|
||||
$data = $this->scope[$data];
|
||||
|
||||
|
@ -511,8 +511,7 @@ class ReflectionClosure extends ReflectionFunction
|
||||
// named arguments...
|
||||
case ':':
|
||||
if ($lastState === 'closure' && $context === 'root') {
|
||||
$state = 'ignore_next';
|
||||
$lastState = 'closure';
|
||||
$state = 'closure';
|
||||
$code .= $id_start.$token;
|
||||
}
|
||||
|
||||
@ -651,7 +650,7 @@ class ReflectionClosure extends ReflectionFunction
|
||||
$state = 'id_name';
|
||||
$context = 'extends';
|
||||
$lastState = 'anonymous';
|
||||
break;
|
||||
break;
|
||||
case '{':
|
||||
$state = 'closure';
|
||||
if (! $inside_structure) {
|
||||
|
82
vendor/laravel/serializable-closure/src/UnsignedSerializableClosure.php
vendored
Normal file
82
vendor/laravel/serializable-closure/src/UnsignedSerializableClosure.php
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\SerializableClosure;
|
||||
|
||||
use Closure;
|
||||
use Laravel\SerializableClosure\Exceptions\PhpVersionNotSupportedException;
|
||||
|
||||
class UnsignedSerializableClosure
|
||||
{
|
||||
/**
|
||||
* The closure's serializable.
|
||||
*
|
||||
* @var \Laravel\SerializableClosure\Contracts\Serializable
|
||||
*/
|
||||
protected $serializable;
|
||||
|
||||
/**
|
||||
* Creates a new serializable closure instance.
|
||||
*
|
||||
* @param \Closure $closure
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Closure $closure)
|
||||
{
|
||||
if (\PHP_VERSION_ID < 70400) {
|
||||
throw new PhpVersionNotSupportedException();
|
||||
}
|
||||
|
||||
$this->serializable = new Serializers\Native($closure);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the closure with the given arguments.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function __invoke()
|
||||
{
|
||||
if (\PHP_VERSION_ID < 70400) {
|
||||
throw new PhpVersionNotSupportedException();
|
||||
}
|
||||
|
||||
return call_user_func_array($this->serializable, func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the closure.
|
||||
*
|
||||
* @return \Closure
|
||||
*/
|
||||
public function getClosure()
|
||||
{
|
||||
if (\PHP_VERSION_ID < 70400) {
|
||||
throw new PhpVersionNotSupportedException();
|
||||
}
|
||||
|
||||
return $this->serializable->getClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the serializable representation of the closure.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function __serialize()
|
||||
{
|
||||
return [
|
||||
'serializable' => $this->serializable,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the closure after serialization.
|
||||
*
|
||||
* @param array $data
|
||||
* @return void
|
||||
*/
|
||||
public function __unserialize($data)
|
||||
{
|
||||
$this->serializable = $data['serializable'];
|
||||
}
|
||||
}
|
2
vendor/phpmailer/phpmailer/README.md
vendored
2
vendor/phpmailer/phpmailer/README.md
vendored
@ -47,7 +47,7 @@ This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lg
|
||||
PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file:
|
||||
|
||||
```json
|
||||
"phpmailer/phpmailer": "^6.7.1"
|
||||
"phpmailer/phpmailer": "^6.8.0"
|
||||
```
|
||||
|
||||
or run
|
||||
|
2
vendor/phpmailer/phpmailer/VERSION
vendored
2
vendor/phpmailer/phpmailer/VERSION
vendored
@ -1 +1 @@
|
||||
6.7.1
|
||||
6.8.0
|
@ -4,24 +4,32 @@
|
||||
* Hindi PHPMailer language file: refer to English translation for definitive list
|
||||
* @package PHPMailer
|
||||
* @author Yash Karanke <mr.karanke@gmail.com>
|
||||
* Rewrite and extension of the work by Jayanti Suthar <suthar.jayanti93@gmail.com>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। ';
|
||||
$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। ';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। ';
|
||||
$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। ';
|
||||
$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। ';
|
||||
$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। ';
|
||||
$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। ';
|
||||
$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: ';
|
||||
$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। ';
|
||||
$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। ';
|
||||
$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: ';
|
||||
$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: ';
|
||||
$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। ';
|
||||
$PHPMAILER_LANG['smtp_detail'] = 'विवरण: ';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: ';
|
||||
|
247
vendor/phpmailer/phpmailer/src/DSNConfigurator.php
vendored
Normal file
247
vendor/phpmailer/phpmailer/src/DSNConfigurator.php
vendored
Normal file
@ -0,0 +1,247 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPMailer - PHP email creation and transport class.
|
||||
* PHP Version 5.5.
|
||||
*
|
||||
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||
*
|
||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||
* @author Brent R. Matzelle (original founder)
|
||||
* @copyright 2012 - 2023 Marcus Bointon
|
||||
* @copyright 2010 - 2012 Jim Jagielski
|
||||
* @copyright 2004 - 2009 Andy Prevost
|
||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
namespace PHPMailer\PHPMailer;
|
||||
|
||||
/**
|
||||
* Configure PHPMailer with DSN string.
|
||||
*
|
||||
* @see https://en.wikipedia.org/wiki/Data_source_name
|
||||
*
|
||||
* @author Oleg Voronkovich <oleg-voronkovich@yandex.ru>
|
||||
*/
|
||||
class DSNConfigurator
|
||||
{
|
||||
/**
|
||||
* Create new PHPMailer instance configured by DSN.
|
||||
*
|
||||
* @param string $dsn DSN
|
||||
* @param bool $exceptions Should we throw external exceptions?
|
||||
*
|
||||
* @return PHPMailer
|
||||
*/
|
||||
public static function mailer($dsn, $exceptions = null)
|
||||
{
|
||||
static $configurator = null;
|
||||
|
||||
if (null === $configurator) {
|
||||
$configurator = new DSNConfigurator();
|
||||
}
|
||||
|
||||
return $configurator->configure(new PHPMailer($exceptions), $dsn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure PHPMailer instance with DSN string.
|
||||
*
|
||||
* @param PHPMailer $mailer PHPMailer instance
|
||||
* @param string $dsn DSN
|
||||
*
|
||||
* @return PHPMailer
|
||||
*/
|
||||
public function configure(PHPMailer $mailer, $dsn)
|
||||
{
|
||||
$config = $this->parseDSN($dsn);
|
||||
|
||||
$this->applyConfig($mailer, $config);
|
||||
|
||||
return $mailer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse DSN string.
|
||||
*
|
||||
* @param string $dsn DSN
|
||||
*
|
||||
* @throws Exception If DSN is malformed
|
||||
*
|
||||
* @return array Configuration
|
||||
*/
|
||||
private function parseDSN($dsn)
|
||||
{
|
||||
$config = $this->parseUrl($dsn);
|
||||
|
||||
if (false === $config || !isset($config['scheme']) || !isset($config['host'])) {
|
||||
throw new Exception(
|
||||
sprintf('Malformed DSN: "%s".', $dsn)
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($config['query'])) {
|
||||
parse_str($config['query'], $config['query']);
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply configuration to mailer.
|
||||
*
|
||||
* @param PHPMailer $mailer PHPMailer instance
|
||||
* @param array $config Configuration
|
||||
*
|
||||
* @throws Exception If scheme is invalid
|
||||
*/
|
||||
private function applyConfig(PHPMailer $mailer, $config)
|
||||
{
|
||||
switch ($config['scheme']) {
|
||||
case 'mail':
|
||||
$mailer->isMail();
|
||||
break;
|
||||
case 'sendmail':
|
||||
$mailer->isSendmail();
|
||||
break;
|
||||
case 'qmail':
|
||||
$mailer->isQmail();
|
||||
break;
|
||||
case 'smtp':
|
||||
case 'smtps':
|
||||
$mailer->isSMTP();
|
||||
$this->configureSMTP($mailer, $config);
|
||||
break;
|
||||
default:
|
||||
throw new Exception(
|
||||
sprintf(
|
||||
'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".',
|
||||
$config['scheme']
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($config['query'])) {
|
||||
$this->configureOptions($mailer, $config['query']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure SMTP.
|
||||
*
|
||||
* @param PHPMailer $mailer PHPMailer instance
|
||||
* @param array $config Configuration
|
||||
*/
|
||||
private function configureSMTP($mailer, $config)
|
||||
{
|
||||
$isSMTPS = 'smtps' === $config['scheme'];
|
||||
|
||||
if ($isSMTPS) {
|
||||
$mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
}
|
||||
|
||||
$mailer->Host = $config['host'];
|
||||
|
||||
if (isset($config['port'])) {
|
||||
$mailer->Port = $config['port'];
|
||||
} elseif ($isSMTPS) {
|
||||
$mailer->Port = SMTP::DEFAULT_SECURE_PORT;
|
||||
}
|
||||
|
||||
$mailer->SMTPAuth = isset($config['user']) || isset($config['pass']);
|
||||
|
||||
if (isset($config['user'])) {
|
||||
$mailer->Username = $config['user'];
|
||||
}
|
||||
|
||||
if (isset($config['pass'])) {
|
||||
$mailer->Password = $config['pass'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure options.
|
||||
*
|
||||
* @param PHPMailer $mailer PHPMailer instance
|
||||
* @param array $options Options
|
||||
*
|
||||
* @throws Exception If option is unknown
|
||||
*/
|
||||
private function configureOptions(PHPMailer $mailer, $options)
|
||||
{
|
||||
$allowedOptions = get_object_vars($mailer);
|
||||
|
||||
unset($allowedOptions['Mailer']);
|
||||
unset($allowedOptions['SMTPAuth']);
|
||||
unset($allowedOptions['Username']);
|
||||
unset($allowedOptions['Password']);
|
||||
unset($allowedOptions['Hostname']);
|
||||
unset($allowedOptions['Port']);
|
||||
unset($allowedOptions['ErrorInfo']);
|
||||
|
||||
$allowedOptions = \array_keys($allowedOptions);
|
||||
|
||||
foreach ($options as $key => $value) {
|
||||
if (!in_array($key, $allowedOptions)) {
|
||||
throw new Exception(
|
||||
sprintf(
|
||||
'Unknown option: "%s". Allowed values: "%s"',
|
||||
$key,
|
||||
implode('", "', $allowedOptions)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
switch ($key) {
|
||||
case 'AllowEmpty':
|
||||
case 'SMTPAutoTLS':
|
||||
case 'SMTPKeepAlive':
|
||||
case 'SingleTo':
|
||||
case 'UseSendmailOptions':
|
||||
case 'do_verp':
|
||||
case 'DKIM_copyHeaderFields':
|
||||
$mailer->$key = (bool) $value;
|
||||
break;
|
||||
case 'Priority':
|
||||
case 'SMTPDebug':
|
||||
case 'WordWrap':
|
||||
$mailer->$key = (int) $value;
|
||||
break;
|
||||
default:
|
||||
$mailer->$key = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a URL.
|
||||
* Wrapper for the built-in parse_url function to work around a bug in PHP 5.5.
|
||||
*
|
||||
* @param string $url URL
|
||||
*
|
||||
* @return array|false
|
||||
*/
|
||||
protected function parseUrl($url)
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) {
|
||||
return parse_url($url);
|
||||
}
|
||||
|
||||
$chunks = explode('?', $url);
|
||||
if (is_array($chunks)) {
|
||||
$result = parse_url($chunks[0]);
|
||||
if (is_array($result)) {
|
||||
$result['query'] = $chunks[1];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
4
vendor/phpmailer/phpmailer/src/PHPMailer.php
vendored
4
vendor/phpmailer/phpmailer/src/PHPMailer.php
vendored
@ -750,7 +750,7 @@ class PHPMailer
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.7.1';
|
||||
const VERSION = '6.8.0';
|
||||
|
||||
/**
|
||||
* Error severity: message only, continue processing.
|
||||
@ -2423,7 +2423,7 @@ class PHPMailer
|
||||
*/
|
||||
public function addrFormat($addr)
|
||||
{
|
||||
if (empty($addr[1])) { //No name provided
|
||||
if (!isset($addr[1]) || ($addr[1] === '')) { //No name provided
|
||||
return $this->secureHeader($addr[0]);
|
||||
}
|
||||
|
||||
|
2
vendor/phpmailer/phpmailer/src/POP3.php
vendored
2
vendor/phpmailer/phpmailer/src/POP3.php
vendored
@ -46,7 +46,7 @@ class POP3
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.7.1';
|
||||
const VERSION = '6.8.0';
|
||||
|
||||
/**
|
||||
* Default POP3 port number.
|
||||
|
10
vendor/phpmailer/phpmailer/src/SMTP.php
vendored
10
vendor/phpmailer/phpmailer/src/SMTP.php
vendored
@ -35,7 +35,7 @@ class SMTP
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.7.1';
|
||||
const VERSION = '6.8.0';
|
||||
|
||||
/**
|
||||
* SMTP line break constant.
|
||||
@ -51,6 +51,13 @@ class SMTP
|
||||
*/
|
||||
const DEFAULT_PORT = 25;
|
||||
|
||||
/**
|
||||
* The SMTPs port to use if one is not specified.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
const DEFAULT_SECURE_PORT = 465;
|
||||
|
||||
/**
|
||||
* The maximum line length allowed by RFC 5321 section 4.5.3.1.6,
|
||||
* *excluding* a trailing CRLF break.
|
||||
@ -187,6 +194,7 @@ class SMTP
|
||||
'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
|
||||
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
|
||||
'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
|
||||
'ZoneMTA' => '/[\d]{3} Message queued as (.*)/',
|
||||
'Mailjet' => '/[\d]{3} OK queued as (.*)/',
|
||||
];
|
||||
|
||||
|
2
vendor/psr/http-client/README.md
vendored
2
vendor/psr/http-client/README.md
vendored
@ -7,6 +7,6 @@ Note that this is not a HTTP Client implementation of its own. It is merely abst
|
||||
|
||||
The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
|
||||
|
||||
[psr-url]: http://www.php-fig.org/psr/psr-18
|
||||
[psr-url]: https://www.php-fig.org/psr/psr-18
|
||||
[package-url]: https://packagist.org/packages/psr/http-client
|
||||
[implementation-url]: https://packagist.org/providers/psr/http-client-implementation
|
||||
|
4
vendor/psr/http-client/composer.json
vendored
4
vendor/psr/http-client/composer.json
vendored
@ -7,12 +7,12 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.0 || ^8.0",
|
||||
"psr/http-message": "^1.0"
|
||||
"psr/http-message": "^1.0 || ^2.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// This file is automatically generated at:2023-05-17 09:05:27
|
||||
// This file is automatically generated at:2023-08-02 19:40:44
|
||||
declare (strict_types = 1);
|
||||
return array (
|
||||
0 => 'taoser\\addons\\Service',
|
||||
|
@ -73,20 +73,29 @@ class Exporter
|
||||
|
||||
$class = \get_class($value);
|
||||
$reflector = Registry::$reflectors[$class] ?? Registry::getClassReflector($class);
|
||||
$properties = [];
|
||||
|
||||
if ($reflector->hasMethod('__serialize')) {
|
||||
if (!$reflector->getMethod('__serialize')->isPublic()) {
|
||||
throw new \Error(sprintf('Call to %s method "%s::__serialize()".', $reflector->getMethod('__serialize')->isProtected() ? 'protected' : 'private', $class));
|
||||
}
|
||||
|
||||
if (!\is_array($properties = $value->__serialize())) {
|
||||
if (!\is_array($serializeProperties = $value->__serialize())) {
|
||||
throw new \TypeError($class.'::__serialize() must return an array');
|
||||
}
|
||||
|
||||
if ($reflector->hasMethod('__unserialize')) {
|
||||
$properties = $serializeProperties;
|
||||
} else {
|
||||
foreach ($serializeProperties as $n => $v) {
|
||||
$c = \PHP_VERSION_ID >= 80100 && $reflector->hasProperty($n) && ($p = $reflector->getProperty($n))->isReadOnly() ? $p->class : 'stdClass';
|
||||
$properties[$c][$n] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
goto prepare_value;
|
||||
}
|
||||
|
||||
$properties = [];
|
||||
$sleep = null;
|
||||
$proto = Registry::$prototypes[$class];
|
||||
|
||||
|
@ -23,6 +23,10 @@ class Controller extends BaseController
|
||||
protected $addon_path;
|
||||
// 视图模型
|
||||
protected $view;
|
||||
// 插件配置
|
||||
protected $addon_config = '';
|
||||
// 插件信息
|
||||
protected $addon_info = '';
|
||||
|
||||
|
||||
/**
|
||||
|
43
vendor/taoser/think-addons/src/helper.php
vendored
43
vendor/taoser/think-addons/src/helper.php
vendored
@ -2,9 +2,9 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
use think\facade\Event;
|
||||
use think\facade\App;
|
||||
use think\facade\Route;
|
||||
use taoser\addons\Service;
|
||||
use think\facade\App;
|
||||
use think\facade\Config;
|
||||
use think\facade\Cache;
|
||||
use think\helper\{
|
||||
@ -24,11 +24,8 @@ define('DS', DIRECTORY_SEPARATOR);
|
||||
spl_autoload_register(function ($class) {
|
||||
|
||||
$class = ltrim($class, '\\');
|
||||
// $app = new think\App();
|
||||
// $dir = $app->getRootPath();
|
||||
// $dir = App::getRootPath();
|
||||
$dir = app()->getRootPath();
|
||||
// halt($dir);
|
||||
|
||||
$dir = App::getRootPath();
|
||||
$namespace = 'addons';
|
||||
|
||||
if (strpos($class, $namespace) === 0) {
|
||||
@ -287,3 +284,37 @@ if (!function_exists('get_addons_menu')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('get_addons_list')) {
|
||||
/**
|
||||
* 获得插件列表
|
||||
* @return array
|
||||
*/
|
||||
function get_addons_list()
|
||||
{
|
||||
$list = Cache::get('addonslist');
|
||||
if (empty($list)) {
|
||||
$addonsPath = app()->getRootPath().'addons'.DS; // 插件列表
|
||||
$results = scandir($addonsPath);
|
||||
$list = [];
|
||||
foreach ($results as $name) {
|
||||
if ($name === '.' or $name === '..')
|
||||
continue;
|
||||
if (is_file($addonsPath . $name))
|
||||
continue;
|
||||
$addonDir = $addonsPath . $name . DS;
|
||||
if (!is_dir($addonDir))
|
||||
continue;
|
||||
if (!is_file($addonDir . 'Plugin' . '.php'))
|
||||
continue;
|
||||
$info = get_addons_info($name);
|
||||
if (!isset($info['name']))
|
||||
continue;
|
||||
$info['url'] =isset($info['url']) && $info['url'] ?(string)addons_url($info['url']):'';
|
||||
$list[$name] = $info;
|
||||
}
|
||||
Cache::set('addonslist', $list);
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user