1.9.22
This commit is contained in:
parent
6cf7c3c589
commit
ad7510a7bb
@ -454,7 +454,6 @@ abstract class BaseController
|
||||
*/
|
||||
public function uploadFiles($type)
|
||||
{
|
||||
$type = Request::param('type');
|
||||
$uploads = new Uploads();
|
||||
switch ($type){
|
||||
case 'image':
|
||||
|
@ -19,9 +19,6 @@ class Addons extends AdminController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//$conf = new \addons\social\model\Conf;
|
||||
//$arr = $conf->getConf();
|
||||
//dump($arr);
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
@ -63,9 +60,6 @@ class Addons extends AdminController
|
||||
//在线
|
||||
case 'onlineAddons':
|
||||
$url = $this->getSystem()['api_url'].'/v1/addons';
|
||||
$res = Cache::get('addons');
|
||||
if(empty($res)){
|
||||
|
||||
$addons = Api::urlGet($url,[]);
|
||||
if( $addons->code !== -1){
|
||||
$res['code'] = 0;
|
||||
@ -84,12 +78,9 @@ class Addons extends AdminController
|
||||
['field' => 'ctime','title'=> '时间', 'width'=> 150],
|
||||
['title' => '操作', 'width'=> 150, 'align'=>'center', 'toolbar'=> '#addons-tool']
|
||||
];
|
||||
|
||||
Cache::set('addons', $res, 600);
|
||||
} else {
|
||||
$res = ['code'=>-1,'msg'=>'未获取到服务器信息'];
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -339,6 +339,7 @@ class Forum extends AdminController
|
||||
|
||||
$data = Request::only(['cate_id', 'title', 'title_color', 'tiny_content', 'content', 'upzip', 'tags', 'description', 'captcha']);
|
||||
$data['user_id'] = 1; //管理员ID
|
||||
|
||||
// 调用验证器
|
||||
$validate = new \app\common\validate\Article;
|
||||
$result = $validate->scene('Artadd')->check($data);
|
||||
@ -452,6 +453,7 @@ class Forum extends AdminController
|
||||
{
|
||||
$data = Request::only(['tags','flag']);
|
||||
return $this->setTags($data);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -156,35 +156,6 @@ layui.config({
|
||||
},
|
||||
});
|
||||
|
||||
// 发布文章
|
||||
// form.on("submit(article-add)", function (data) {
|
||||
// var field = data.field;
|
||||
// var numArr = new Array();
|
||||
// $(".layui-btn-container").children("button").each(function () {
|
||||
// numArr.push($(this).val()); //添加至数组
|
||||
// });
|
||||
// tags = numArr.lenth ? "" : numArr.join(",");
|
||||
// var index = layer.load(1);
|
||||
// $.ajax({
|
||||
// type: "post",
|
||||
// url: "{:url('Forum/add')}",
|
||||
// data: field,
|
||||
// dataType: "json",
|
||||
// success: function (data) {
|
||||
// if (data.code == 0) {
|
||||
// layer.msg(data.msg, { icon: 6, time: 2000 }, function () {
|
||||
// location.href = data.url;
|
||||
// });
|
||||
// } else {
|
||||
// layer.open({ title: "发布失败", content: data.msg, icon: 5, anim: 6 });
|
||||
// }
|
||||
// layer.close(index);
|
||||
// },
|
||||
// });
|
||||
// return false;
|
||||
// });
|
||||
|
||||
|
||||
// 手动添加tags
|
||||
$("#article-tags-button").on("click", function () {
|
||||
var tags = $("input[name='tags']").val();
|
||||
|
@ -147,32 +147,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
//编辑文章
|
||||
form.on('submit(article-edit)', function(data){
|
||||
var field = data.field;
|
||||
var numArr = new Array();
|
||||
$('.layui-btn-container').children('button').each(function(){
|
||||
numArr.push($(this).val());//添加至数组
|
||||
});
|
||||
tags = numArr.lenth ? '' : numArr.join(',');
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('Forum/edit')}",
|
||||
data: field,
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{icon:6,time:2000}, function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.open({title:'编辑失败',content:data.msg,icon:5,anim:6});
|
||||
};
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
// 获取描述的内容
|
||||
$("#L_content").bind('input propertychange', function(){
|
||||
var content = $(this).val()
|
||||
|
@ -193,6 +193,13 @@ layui.config({
|
||||
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
// tag
|
||||
var numArr = new Array();
|
||||
layero.find('iframe').contents().find(".layui-btn-container").children("button").each(function () {
|
||||
numArr.push($(this).val()); //添加至数组
|
||||
});
|
||||
field.tags = numArr.lenth ? "" : numArr.join(",");
|
||||
|
||||
//提交 Ajax 成功后,静态更新表格中的数据
|
||||
$.ajax({
|
||||
type:"post",
|
||||
|
@ -76,27 +76,6 @@ if(!function_exists('getUserImg'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//根据文章分类ID查询分类名
|
||||
function getCateName($ename)
|
||||
{
|
||||
if($ename == 'all') {
|
||||
return '全部分类';
|
||||
} else {
|
||||
return Db::name('cate')->where('ename',$ename)->cache(3600)->value('catename');
|
||||
}
|
||||
}
|
||||
|
||||
//根据文章分类ID查询分类描述
|
||||
function getCateDesc($ename)
|
||||
{
|
||||
if($ename == 'all') {
|
||||
return '全部分类,为您展示全部分类信息';
|
||||
} else {
|
||||
return Db::name('cate')->where('ename',$ename)->cache(3600)->value('desc');
|
||||
}
|
||||
}
|
||||
|
||||
//过滤文章摘要
|
||||
function getArtContent($content)
|
||||
{
|
||||
@ -283,23 +262,23 @@ function showSlider($type)
|
||||
//提取内容第一张图片
|
||||
function getOnepic($str)
|
||||
{
|
||||
// <img src="http://img.com" />
|
||||
/* $pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
|
||||
//匹配格式为 <img src="http://img.com" />
|
||||
$pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
|
||||
preg_match_all($pattern,$str,$matchContent);
|
||||
if(isset($matchContent[1][0])){
|
||||
$img = $matchContent[1][0];
|
||||
}else{
|
||||
$temp="./images/no-image.jpg";//在相应位置放置一张命名为no-image的jpg图片
|
||||
}
|
||||
*/
|
||||
// img[/storage/1/article_pic/20220428/6c2647d24d5ca2c179e4a5b76990c00c.jpg]
|
||||
$pattern = "/(?<=img\[)[^\]]*(?=\])/";
|
||||
preg_match($pattern,$str,$matchContent);
|
||||
if(isset($matchContent[0])){
|
||||
$img = $matchContent[0];
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
return $img;
|
||||
} else {
|
||||
//$temp="./images/no-image.jpg";//在相应位置放置一张命名为no-image的jpg图片
|
||||
|
||||
//匹配格式为 img[/storage/1/article_pic/20220428/6c2647d24d5ca2c179e4a5b76990c00c.jpg]
|
||||
$pattern = "/(?<=img\[)[^\]]*(?=\])/";
|
||||
preg_match($pattern,$str,$matchContent);
|
||||
if(isset($matchContent[0])){
|
||||
$img = $matchContent[0];
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return $img;
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* @Author: TaoLer <alipay_tao@qq.com>
|
||||
* @Date: 2021-12-06 16:04:50
|
||||
* @LastEditTime: 2022-07-26 15:17:08
|
||||
* @LastEditTime: 2022-08-03 10:34:42
|
||||
* @LastEditors: TaoLer
|
||||
* @Description: 前端基础控制器设置
|
||||
* @FilePath: \github\TaoLer\app\common\controller\BaseController.php
|
||||
@ -122,4 +122,20 @@ class BaseController extends BaseCtrl
|
||||
return $sysInfo;
|
||||
}
|
||||
|
||||
//获取artcile所有图片
|
||||
protected function getArticleAllpic($str)
|
||||
{
|
||||
// <img src="http://img.com" />
|
||||
$pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
|
||||
preg_match_all($pattern,$str,$matchContent);
|
||||
if(isset($matchContent[1])){
|
||||
$img = $matchContent[1];
|
||||
}else{
|
||||
$temp = "./images/no-image.jpg";//在相应位置放置一张命名为no-image的jpg图片
|
||||
}
|
||||
|
||||
return $img;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -72,7 +72,12 @@ class Uploads
|
||||
*/
|
||||
public function put(string $fileName, string $dirName, int $fileSize, string $fileType, string $rule = null)
|
||||
{
|
||||
$file = request()->file($fileName);
|
||||
if(stripos($fileName,'http') !== false) {
|
||||
$file = $fileName;
|
||||
} else {
|
||||
$file = request()->file($fileName);
|
||||
}
|
||||
|
||||
//halt($file->getOriginalName());
|
||||
//$type = $file->getMime();
|
||||
$fileExt = $this->getFileInfo($fileType,'ext');
|
||||
|
@ -1,4 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
* @Author: TaoLer <317927823@qq.com>
|
||||
* @Date: 2021-12-06 16:04:50
|
||||
* @LastEditTime: 2022-08-10 14:36:20
|
||||
* @LastEditors: TaoLer
|
||||
* @Description: 优化版
|
||||
* @FilePath: \github\TaoLer\app\common\model\Cate.php
|
||||
* Copyright (c) 2020~2022 https://www.aieok.com All rights reserved.
|
||||
*/
|
||||
namespace app\common\model;
|
||||
|
||||
use think\Model;
|
||||
@ -11,6 +20,14 @@ class Cate extends Model
|
||||
protected $deleteTime = 'delete_time';
|
||||
protected $defaultSoftDelete = 0;
|
||||
|
||||
// 查询类别信息
|
||||
public function getCateInfo(string $ename)
|
||||
{
|
||||
//
|
||||
return $this::field('ename,catename,detpl,desc')->where('ename',$ename)->cache('cate_'.$ename,600)->find();
|
||||
}
|
||||
|
||||
// 删除类别
|
||||
public function del($id)
|
||||
{
|
||||
$cates = $this->find($id);
|
||||
|
@ -8,17 +8,17 @@ use think\facade\Request;
|
||||
use think\facade\Db;
|
||||
use think\facade\Cache;
|
||||
use think\facade\Config;
|
||||
use app\common\model\Cate;
|
||||
use app\common\model\Comment;
|
||||
use app\common\model\Article as ArticleModel;
|
||||
use app\common\model\Slider;
|
||||
use app\common\model\UserZan;
|
||||
|
||||
use taoler\com\Message;
|
||||
use app\common\lib\Msgres;
|
||||
use app\common\lib\Uploads;
|
||||
use taoser\SetArr;
|
||||
use taoler\com\Api;
|
||||
use Overtrue\Pinyin\Pinyin;
|
||||
|
||||
|
||||
class Article extends BaseController
|
||||
{
|
||||
protected $middleware = [
|
||||
@ -35,9 +35,12 @@ class Article extends BaseController
|
||||
}
|
||||
//动态参数
|
||||
$ename = Request::param('ename') ?? 'all';
|
||||
$cate = new Cate();
|
||||
$cateInfo = $cate->getCateInfo($ename);
|
||||
// halt($cateInfo);
|
||||
$type = Request::param('type') ?? 'all';
|
||||
$page = Request::param('page') ? Request::param('page') : 1;
|
||||
$tpl = Db::name('cate')->where('ename',$ename)->value('detpl');
|
||||
|
||||
//分页url
|
||||
$url = url('cate_page',['ename'=>$ename,'type'=>$type,'page'=>$page]);
|
||||
//返回最后/前面的字符串
|
||||
@ -55,8 +58,18 @@ class Article extends BaseController
|
||||
//分类钻展赞助
|
||||
$ad_comm = $ad->getSliderList(6);
|
||||
|
||||
View::assign(['type'=>$type,'artList'=>$artList,'artHot'=>$artHot,'ad_cateImg'=>$ad_cateImg,'ad_comm'=>$ad_comm,'jspage'=>'jie','ename'=>$ename,'path'=>$path]);
|
||||
return View::fetch('article/'.$tpl.'/cate');
|
||||
View::assign([
|
||||
'ename'=>$ename,
|
||||
'cateinfo'=> $cateInfo,
|
||||
'type'=>$type,
|
||||
'artList'=>$artList,
|
||||
'artHot'=>$artHot,
|
||||
'ad_cateImg'=>$ad_cateImg,
|
||||
'ad_comm'=>$ad_comm,
|
||||
'path'=>$path,
|
||||
'jspage'=>'jie'
|
||||
]);
|
||||
return View::fetch('article/' . $cateInfo->detpl . '/cate');
|
||||
}
|
||||
|
||||
//文章详情页
|
||||
@ -234,7 +247,7 @@ class Article extends BaseController
|
||||
// 检验发帖是否开放
|
||||
if(config('taoler.config.is_post') == 0 ) return json(['code'=>-1,'msg'=>'抱歉,系统维护中,暂时禁止发帖!']);
|
||||
|
||||
$data = Request::only(['cate_id', 'title', 'title_color', 'user_id', 'tiny_content', 'content', 'upzip', 'tags', 'description', 'captcha']);
|
||||
$data = Request::only(['cate_id', 'title', 'title_color', 'user_id', 'content', 'upzip', 'tags', 'description', 'captcha']);
|
||||
|
||||
// 验证码
|
||||
if(Config::get('taoler.config.post_captcha') == 1)
|
||||
@ -254,10 +267,14 @@ class Article extends BaseController
|
||||
// 获取内容图片音视频标识
|
||||
$iva= $this->hasIva($data['content']);
|
||||
$data = array_merge($data,$iva);
|
||||
|
||||
$data['content'] = $this->downUrlPicsReaplace($data['content']);
|
||||
|
||||
// 获取分类ename
|
||||
$cate_ename = Db::name('cate')->where('id',$data['cate_id'])->value('ename');
|
||||
|
||||
$article = new ArticleModel();
|
||||
|
||||
$result = $article->add($data);
|
||||
if ($result['code'] == 1) {
|
||||
// 获取到的最新ID
|
||||
@ -322,6 +339,9 @@ class Article extends BaseController
|
||||
$iva= $this->hasIva($data['content']);
|
||||
$data = array_merge($data,$iva);
|
||||
|
||||
$data['content'] = $this->downUrlPicsReaplace($data['content']);
|
||||
|
||||
|
||||
$result = $article->edit($data);
|
||||
if($result == 1) {
|
||||
//删除原有缓存显示编辑后内容
|
||||
@ -525,10 +545,16 @@ class Article extends BaseController
|
||||
// 匹配所有
|
||||
//$content = str_replace("$key", 'a('.$value.')['.$key.']',$content);
|
||||
// 限定匹配数量 '/'.$key.'/'
|
||||
|
||||
// 匹配不包含[和]的内容
|
||||
$pats = '/(?<!\[)'.$key.'(?!\])/';
|
||||
//preg_match($pats,$content,$arr);
|
||||
//halt($arr[0]);
|
||||
// $pats = '/(?<!\[)'.$key.'(?!\])/';
|
||||
// $pats = '/(?<!<a\s?(.*)?)'.$key.'(?!<\/a>)/';
|
||||
//$pats = '/'.$key.'(?!<\/a>)/';
|
||||
// 不匹配 $key</a>已经存在链接的情况
|
||||
$pats = '/'.$key. '\s?(?!<\/a>|")/is';
|
||||
|
||||
preg_match($pats,$content,$arr);
|
||||
|
||||
// 开启和关闭编辑器使用不同的链接方式
|
||||
$rpes = hook('taonystatus') ? '<a href="'.$value.'" target="_blank" title="'.$key.'" style="font-weight: bold;color:#31BDEC">'.$key.'</a>' : 'a('.$value.')['.$key.']';
|
||||
|
||||
@ -539,6 +565,7 @@ class Article extends BaseController
|
||||
return $content;
|
||||
}
|
||||
|
||||
//点赞文章
|
||||
public function userZanArticle()
|
||||
{
|
||||
//
|
||||
@ -557,4 +584,77 @@ class Article extends BaseController
|
||||
|
||||
}
|
||||
|
||||
//下载图片
|
||||
private function downloadImage($url)
|
||||
{
|
||||
$ch = curl_init();
|
||||
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, 'GET' );
|
||||
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false );
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
||||
$file = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return $this->saveAsImage($url, $file);
|
||||
|
||||
}
|
||||
|
||||
//保存图片
|
||||
private function saveAsImage($url, $file)
|
||||
{
|
||||
$filename = pathinfo($url, PATHINFO_BASENAME);
|
||||
//$dirname = pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_DIRNAME);
|
||||
$dirname = date('Ymd',time());
|
||||
//路径
|
||||
$path = 'storage/' . $this->uid . '/article_pic/' . $dirname . '/';
|
||||
//绝对文件夹
|
||||
$fileDir = public_path() . $path;
|
||||
//文件绝对路径
|
||||
$filePath = $fileDir . $filename;
|
||||
//相对路径文件名
|
||||
$realFile = '/' . $path . $filename;
|
||||
// 如果目录不存在,则创建
|
||||
|
||||
if(!is_dir($fileDir)) {
|
||||
mkdir($fileDir, 0777, true);
|
||||
}
|
||||
|
||||
if(file_exists($filePath)) {
|
||||
//$this->output->writeln("【已存在】输出路径" . $fullpath);
|
||||
return $realFile;
|
||||
|
||||
} else {
|
||||
$resource = fopen($filePath, 'a');
|
||||
$res = fwrite($resource, $file);
|
||||
fclose($resource);
|
||||
if($res !== false) {
|
||||
return $realFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//下载网络图片到本地并替换
|
||||
public function downUrlPicsReaplace($content)
|
||||
{
|
||||
// 批量下载网络图片并替换
|
||||
$images = $this->getArticleAllpic($content);
|
||||
if(count($images)) {
|
||||
foreach($images as $image){
|
||||
//1.网络图片
|
||||
//halt((stripos($image, Request::domain()) === false));
|
||||
if((stripos($image,'http') !== false) && (stripos($image, Request::domain()) === false)) {
|
||||
|
||||
//2.下载远程图片
|
||||
$newImageUrl = $this->downloadImage($image);
|
||||
|
||||
$content = str_replace($image,Request::domain().$newImageUrl,$content);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -2,10 +2,10 @@
|
||||
/*
|
||||
* @Author: TaoLer <alipay_tao@qq.com>
|
||||
* @Date: 2021-12-06 16:04:50
|
||||
* @LastEditTime: 2022-06-19 16:35:30
|
||||
* @LastEditTime: 2022-07-31 13:06:34
|
||||
* @LastEditors: TaoLer
|
||||
* @Description: 搜索引擎SEO优化设置
|
||||
* @FilePath: \TaoLer\app\listener\UserLogin.php
|
||||
* @FilePath: \github\TaoLer\app\listener\UserLogin.php
|
||||
* Copyright (c) 2020~2022 https://www.aieok.com All rights reserved.
|
||||
*/
|
||||
declare (strict_types = 1);
|
||||
@ -35,13 +35,30 @@ class UserLogin
|
||||
if($type == 'log'){
|
||||
//$name = $user->user['name'];
|
||||
$ip = request()->ip();
|
||||
$url = 'http://ip-api.com/json/' . $ip . '?lang=zh-CN&fields=57361';
|
||||
$ipJson = Api::urlGet($url);
|
||||
if($ipJson->status == 'success'){
|
||||
$city = $ipJson->city;
|
||||
} else {
|
||||
$city ='未知';
|
||||
//$url = 'http://ip-api.com/json/' . $ip . '?lang=zh-CN&fields=57361';
|
||||
$url = 'http://freeapi.ipip.net/' . $ip;
|
||||
|
||||
$ipJson = Api::urlGetRespond($url);
|
||||
$respond = $ipJson->getData();
|
||||
|
||||
if($respond['code'] == 0){
|
||||
//字符串数组["中国","北京","北京"]
|
||||
$data = $respond['data'];
|
||||
//正则去掉[''],保留字符串
|
||||
$str = preg_replace('/(\"|\[|\])/','',$data);
|
||||
//地址数组
|
||||
$arr = explode(',', $str);
|
||||
if($arr[0] !== '本机地址') {
|
||||
$city = $arr[2];
|
||||
} else {
|
||||
$city = 'earth';
|
||||
}
|
||||
}
|
||||
// if($ipJson->status == 'success'){
|
||||
// $city = $ipJson->city;
|
||||
// } else {
|
||||
// $city ='未知';
|
||||
// }
|
||||
|
||||
$u->allowField(['city','last_login_ip','last_login_time','login_error_num'])->save(
|
||||
[
|
||||
|
32
composer.lock
generated
32
composer.lock
generated
@ -2343,16 +2343,16 @@
|
||||
},
|
||||
{
|
||||
"name": "workerman/workerman",
|
||||
"version": "v4.0.41",
|
||||
"version": "v4.0.42",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/walkor/workerman.git",
|
||||
"reference": "8a6a536f7f720a1d8af421ef4a48789c90ab19ec"
|
||||
"reference": "83f09b50eaf7412504604030daa9e1f9c767e6c3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/walkor/workerman/zipball/8a6a536f7f720a1d8af421ef4a48789c90ab19ec",
|
||||
"reference": "8a6a536f7f720a1d8af421ef4a48789c90ab19ec",
|
||||
"url": "https://api.github.com/repos/walkor/workerman/zipball/83f09b50eaf7412504604030daa9e1f9c767e6c3",
|
||||
"reference": "83f09b50eaf7412504604030daa9e1f9c767e6c3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2402,20 +2402,20 @@
|
||||
"type": "patreon"
|
||||
}
|
||||
],
|
||||
"time": "2022-07-19T08:05:44+00:00"
|
||||
"time": "2022-07-29T09:06:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "yansongda/pay",
|
||||
"version": "v3.1.9",
|
||||
"version": "v3.1.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/yansongda/pay.git",
|
||||
"reference": "bd56ba3054aa9b13cfe20e406a8fd5db030031f8"
|
||||
"reference": "e02069503b608f2cb8fcb75011cdd0810bbfe88a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/yansongda/pay/zipball/bd56ba3054aa9b13cfe20e406a8fd5db030031f8",
|
||||
"reference": "bd56ba3054aa9b13cfe20e406a8fd5db030031f8",
|
||||
"url": "https://api.github.com/repos/yansongda/pay/zipball/e02069503b608f2cb8fcb75011cdd0810bbfe88a",
|
||||
"reference": "e02069503b608f2cb8fcb75011cdd0810bbfe88a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2479,7 +2479,7 @@
|
||||
"issues": "https://github.com/yansongda/pay/issues",
|
||||
"source": "https://github.com/yansongda/pay"
|
||||
},
|
||||
"time": "2022-07-24T02:23:58+00:00"
|
||||
"time": "2022-08-09T13:49:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "yansongda/supports",
|
||||
@ -2788,16 +2788,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.4.42",
|
||||
"version": "v4.4.44",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "742aab50ad097bcb62d91fccb613f66b8047d2ca"
|
||||
"reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/742aab50ad097bcb62d91fccb613f66b8047d2ca",
|
||||
"reference": "742aab50ad097bcb62d91fccb613f66b8047d2ca",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/f19951007dae942cc79b979c1fe26bfdfbeb54ed",
|
||||
"reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2857,7 +2857,7 @@
|
||||
"dump"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.42"
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.44"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -2873,7 +2873,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-21T10:00:54+00:00"
|
||||
"time": "2022-07-20T09:59:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-trace",
|
||||
|
@ -16,7 +16,7 @@ return [
|
||||
// 应用名,此项不可更改
|
||||
'appname' => 'TaoLer',
|
||||
// 版本配置
|
||||
'version' => '1.9.21',
|
||||
'version' => '1.9.22',
|
||||
// 加盐
|
||||
'salt' => 'taoler',
|
||||
// 数据库备份目录
|
||||
|
@ -1,4 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
* @Author: TaoLer <317927823@qq.com>
|
||||
* @Date: 2021-12-06 16:04:50
|
||||
* @LastEditTime: 2022-08-01 10:09:11
|
||||
* @LastEditors: TaoLer
|
||||
* @Description: 优化版
|
||||
* @FilePath: \github\TaoLer\extend\taoler\com\Api.php
|
||||
* Copyright (c) 2020~2022 https://www.aieok.com All rights reserved.
|
||||
*/
|
||||
|
||||
namespace taoler\com;
|
||||
|
||||
@ -48,6 +57,25 @@ class Api
|
||||
}
|
||||
}
|
||||
|
||||
public static function urlGetRespond($url)
|
||||
{
|
||||
$ch =curl_init ();
|
||||
curl_setopt($ch,CURLOPT_URL, $url);
|
||||
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); //将curl_exec()获取的信息以文件流的形式返回,而不是直接输出。 1表示传输数据,为0表示直接输出显示。
|
||||
//curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 20);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false); //启用时会将头文件的信息作为数据流输出。 参数为1表示输出信息头,为0表示不输出
|
||||
$data = curl_exec($ch);
|
||||
$httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
if($httpCode == '200'){
|
||||
//return json_decode($data);
|
||||
return json(['code'=>0, 'data'=>$data]);
|
||||
} else {
|
||||
//return json_decode('{"code":-1,"msg":"远程服务器失败,稍后重试"}'); //转换为对象
|
||||
return json(['code'=>-1,'msg'=>'Remote server failed, try again later']);
|
||||
}
|
||||
}
|
||||
|
||||
public static function get_real_ip()
|
||||
{
|
||||
static $realip;
|
||||
|
@ -77,6 +77,12 @@ var forms = table.render({
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
//tag
|
||||
var numArr = new Array();
|
||||
layero.find('iframe').contents().find(".layui-btn-container").children("button").each(function () {
|
||||
numArr.push($(this).val()); //添加至数组
|
||||
});
|
||||
field.tags = numArr.lenth ? "" : numArr.join(",");
|
||||
|
||||
$.ajax({
|
||||
type:"post",
|
||||
|
File diff suppressed because one or more lines are too long
5
vendor/bin/var-dump-server
vendored
5
vendor/bin/var-dump-server
vendored
@ -108,7 +108,10 @@ if (PHP_VERSION_ID < 80000) {
|
||||
}
|
||||
}
|
||||
|
||||
if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
|
||||
if (
|
||||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server');
|
||||
exit(0);
|
||||
}
|
||||
|
38
vendor/composer/installed.json
vendored
38
vendor/composer/installed.json
vendored
@ -1984,17 +1984,17 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.4.42",
|
||||
"version_normalized": "4.4.42.0",
|
||||
"version": "v4.4.44",
|
||||
"version_normalized": "4.4.44.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "742aab50ad097bcb62d91fccb613f66b8047d2ca"
|
||||
"reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/742aab50ad097bcb62d91fccb613f66b8047d2ca",
|
||||
"reference": "742aab50ad097bcb62d91fccb613f66b8047d2ca",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/f19951007dae942cc79b979c1fe26bfdfbeb54ed",
|
||||
"reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2018,7 +2018,7 @@
|
||||
"ext-intl": "To show region name in time zone dump",
|
||||
"symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
|
||||
},
|
||||
"time": "2022-05-21T10:00:54+00:00",
|
||||
"time": "2022-07-20T09:59:04+00:00",
|
||||
"bin": [
|
||||
"Resources/bin/var-dump-server"
|
||||
],
|
||||
@ -2056,7 +2056,7 @@
|
||||
"dump"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.42"
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.44"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -2939,17 +2939,17 @@
|
||||
},
|
||||
{
|
||||
"name": "workerman/workerman",
|
||||
"version": "v4.0.41",
|
||||
"version_normalized": "4.0.41.0",
|
||||
"version": "v4.0.42",
|
||||
"version_normalized": "4.0.42.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/walkor/workerman.git",
|
||||
"reference": "8a6a536f7f720a1d8af421ef4a48789c90ab19ec"
|
||||
"reference": "83f09b50eaf7412504604030daa9e1f9c767e6c3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/walkor/workerman/zipball/8a6a536f7f720a1d8af421ef4a48789c90ab19ec",
|
||||
"reference": "8a6a536f7f720a1d8af421ef4a48789c90ab19ec",
|
||||
"url": "https://api.github.com/repos/walkor/workerman/zipball/83f09b50eaf7412504604030daa9e1f9c767e6c3",
|
||||
"reference": "83f09b50eaf7412504604030daa9e1f9c767e6c3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2958,7 +2958,7 @@
|
||||
"suggest": {
|
||||
"ext-event": "For better performance. "
|
||||
},
|
||||
"time": "2022-07-19T08:05:44+00:00",
|
||||
"time": "2022-07-29T09:06:29+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -3005,17 +3005,17 @@
|
||||
},
|
||||
{
|
||||
"name": "yansongda/pay",
|
||||
"version": "v3.1.9",
|
||||
"version_normalized": "3.1.9.0",
|
||||
"version": "v3.1.10",
|
||||
"version_normalized": "3.1.10.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/yansongda/pay.git",
|
||||
"reference": "bd56ba3054aa9b13cfe20e406a8fd5db030031f8"
|
||||
"reference": "e02069503b608f2cb8fcb75011cdd0810bbfe88a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/yansongda/pay/zipball/bd56ba3054aa9b13cfe20e406a8fd5db030031f8",
|
||||
"reference": "bd56ba3054aa9b13cfe20e406a8fd5db030031f8",
|
||||
"url": "https://api.github.com/repos/yansongda/pay/zipball/e02069503b608f2cb8fcb75011cdd0810bbfe88a",
|
||||
"reference": "e02069503b608f2cb8fcb75011cdd0810bbfe88a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -3049,7 +3049,7 @@
|
||||
"illuminate/container": "Laravel 框架下使用 SDK,请安装",
|
||||
"php-di/php-di": "其它/无框架下使用 SDK,请安装"
|
||||
},
|
||||
"time": "2022-07-24T02:23:58+00:00",
|
||||
"time": "2022-08-09T13:49:29+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
22
vendor/composer/installed.php
vendored
22
vendor/composer/installed.php
vendored
@ -3,7 +3,7 @@
|
||||
'name' => 'taoser/taoler',
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '9c56fe07e9c108768ac6d8a254dc3e838186eab1',
|
||||
'reference' => '36ce800bdbb34844639cbef6c8658e5a36b1dc6e',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
@ -290,9 +290,9 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/var-dumper' => array(
|
||||
'pretty_version' => 'v4.4.42',
|
||||
'version' => '4.4.42.0',
|
||||
'reference' => '742aab50ad097bcb62d91fccb613f66b8047d2ca',
|
||||
'pretty_version' => 'v4.4.44',
|
||||
'version' => '4.4.44.0',
|
||||
'reference' => 'f19951007dae942cc79b979c1fe26bfdfbeb54ed',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/var-dumper',
|
||||
'aliases' => array(),
|
||||
@ -301,7 +301,7 @@
|
||||
'taoser/taoler' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '9c56fe07e9c108768ac6d8a254dc3e838186eab1',
|
||||
'reference' => '36ce800bdbb34844639cbef6c8658e5a36b1dc6e',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
@ -452,18 +452,18 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'workerman/workerman' => array(
|
||||
'pretty_version' => 'v4.0.41',
|
||||
'version' => '4.0.41.0',
|
||||
'reference' => '8a6a536f7f720a1d8af421ef4a48789c90ab19ec',
|
||||
'pretty_version' => 'v4.0.42',
|
||||
'version' => '4.0.42.0',
|
||||
'reference' => '83f09b50eaf7412504604030daa9e1f9c767e6c3',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../workerman/workerman',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'yansongda/pay' => array(
|
||||
'pretty_version' => 'v3.1.9',
|
||||
'version' => '3.1.9.0',
|
||||
'reference' => 'bd56ba3054aa9b13cfe20e406a8fd5db030031f8',
|
||||
'pretty_version' => 'v3.1.10',
|
||||
'version' => '3.1.10.0',
|
||||
'reference' => 'e02069503b608f2cb8fcb75011cdd0810bbfe88a',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../yansongda/pay',
|
||||
'aliases' => array(),
|
||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// This file is automatically generated at:2022-07-29 21:13:15
|
||||
// This file is automatically generated at:2022-08-10 16:58:09
|
||||
declare (strict_types = 1);
|
||||
return array (
|
||||
0 => 'taoser\\addons\\Service',
|
||||
|
@ -28,7 +28,7 @@ class ArgsStub extends EnumStub
|
||||
|
||||
$values = [];
|
||||
foreach ($args as $k => $v) {
|
||||
$values[$k] = !is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v;
|
||||
$values[$k] = !\is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v;
|
||||
}
|
||||
if (null === $params) {
|
||||
parent::__construct($values, false);
|
||||
|
@ -102,7 +102,7 @@ class IntlCaster
|
||||
'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL),
|
||||
'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL),
|
||||
]
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
return self::castError($c, $a);
|
||||
|
@ -45,7 +45,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
||||
public function __construct($output = null, string $charset = null, int $flags = 0)
|
||||
{
|
||||
$this->flags = $flags;
|
||||
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
|
||||
$this->setCharset($charset ?: \ini_get('php.output_encoding') ?: \ini_get('default_charset') ?: 'UTF-8');
|
||||
$this->decimalPoint = \PHP_VERSION_ID >= 80000 ? '.' : localeconv()['decimal_point'];
|
||||
$this->setOutput($output ?: static::$defaultOutput);
|
||||
if (!$output && \is_string(static::$defaultOutput)) {
|
||||
|
@ -83,7 +83,7 @@ class CliDumper extends AbstractDumper
|
||||
]);
|
||||
}
|
||||
|
||||
$this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
|
||||
$this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -81,7 +81,7 @@ class HtmlDumper extends CliDumper
|
||||
{
|
||||
AbstractDumper::__construct($output, $charset, $flags);
|
||||
$this->dumpId = 'sf-dump-'.mt_rand();
|
||||
$this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
|
||||
$this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
|
||||
$this->styles = static::$themes['dark'] ?? self::$themes['dark'];
|
||||
}
|
||||
|
||||
@ -882,7 +882,7 @@ EOHTML
|
||||
}
|
||||
|
||||
if ('const' === $style && isset($attr['value'])) {
|
||||
$style .= sprintf(' title="%s"', esc(is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value'])));
|
||||
$style .= sprintf(' title="%s"', esc(\is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value'])));
|
||||
} elseif ('public' === $style) {
|
||||
$style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property');
|
||||
} elseif ('str' === $style && 1 < $attr['length']) {
|
||||
|
@ -102,7 +102,7 @@ class Http
|
||||
if (false === $crlf_pos) {
|
||||
// Judge whether the package length exceeds the limit.
|
||||
if ($recv_len = \strlen($recv_buffer) >= 16384) {
|
||||
$connection->close("HTTP/1.1 413 Request Entity Too Large\r\n\r\n");
|
||||
$connection->close("HTTP/1.1 413 Request Entity Too Large\r\n\r\n", true);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
@ -140,7 +140,7 @@ class Http
|
||||
}
|
||||
}
|
||||
if ($length > $connection->maxPackageSize) {
|
||||
$connection->close("HTTP/1.1 413 Request Entity Too Large\r\n\r\n");
|
||||
$connection->close("HTTP/1.1 413 Request Entity Too Large\r\n\r\n", true);
|
||||
return 0;
|
||||
}
|
||||
return $length;
|
||||
|
@ -490,11 +490,24 @@ class Request
|
||||
{
|
||||
$http_post_boundary = \trim($http_post_boundary, '"');
|
||||
$buffer = $this->_buffer;
|
||||
$post_encode_string = '';
|
||||
$files_encode_string = '';
|
||||
$files = [];
|
||||
$boday_position = strpos($buffer, "\r\n\r\n") + 4;
|
||||
$offset = $boday_position + strlen($http_post_boundary) + 2;
|
||||
$max_count = static::$maxFileUploads;
|
||||
while ($max_count-- > 0 && $offset) {
|
||||
$offset = $this->parseUploadFile($http_post_boundary, $offset);
|
||||
$offset = $this->parseUploadFile($http_post_boundary, $offset, $post_encode_string, $files_encode_string, $files);
|
||||
}
|
||||
if ($post_encode_string) {
|
||||
parse_str($post_encode_string, $this->_data['post']);
|
||||
}
|
||||
|
||||
if ($files_encode_string) {
|
||||
parse_str($files_encode_string, $this->_data['files']);
|
||||
\array_walk_recursive($this->_data['files'], function (&$value) use ($files) {
|
||||
$value = $files[$value];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -503,7 +516,7 @@ class Request
|
||||
* @param $section_start_offset
|
||||
* @return int
|
||||
*/
|
||||
protected function parseUploadFile($boundary, $section_start_offset)
|
||||
protected function parseUploadFile($boundary, $section_start_offset, &$post_encode_string, &$files_encode_str, &$files)
|
||||
{
|
||||
$file = [];
|
||||
$boundary = "\r\n$boundary";
|
||||
@ -523,7 +536,7 @@ class Request
|
||||
if (!\strpos($content_line, ': ')) {
|
||||
return 0;
|
||||
}
|
||||
[$key, $value] = \explode(': ', $content_line);
|
||||
list($key, $value) = \explode(': ', $content_line);
|
||||
switch (strtolower($key)) {
|
||||
case "content-disposition":
|
||||
// Is file data.
|
||||
@ -557,12 +570,7 @@ class Request
|
||||
// Parse $_POST.
|
||||
if (\preg_match('/name="(.*?)"$/', $value, $match)) {
|
||||
$k = $match[1];
|
||||
$post_str = \urlencode($k) . "=" . \urlencode($boundary_value);
|
||||
$post = [];
|
||||
parse_str($post_str, $post);
|
||||
if ($post) {
|
||||
$this->_data['post'] = \array_merge_recursive($this->_data['post'], $post);
|
||||
}
|
||||
$post_encode_string .= \urlencode($k) . "=" . \urlencode($boundary_value) . '&';
|
||||
}
|
||||
return $section_end_offset + \strlen($boundary) + 2;
|
||||
}
|
||||
@ -575,13 +583,8 @@ class Request
|
||||
if ($upload_key === false) {
|
||||
return 0;
|
||||
}
|
||||
$str = \urlencode($upload_key) . "=1";
|
||||
$result = [];
|
||||
\parse_str($str, $result);
|
||||
\array_walk_recursive($result, function (&$value) use ($file) {
|
||||
$value = $file;
|
||||
});
|
||||
$this->_data['files'] = \array_merge_recursive($this->_data['files'], $result);
|
||||
$files_encode_str .= \urlencode($upload_key) . '=' . \count($files) . '&';
|
||||
$files[] = $file;
|
||||
|
||||
return $section_end_offset + \strlen($boundary) + 2;
|
||||
}
|
||||
|
22
vendor/workerman/workerman/Worker.php
vendored
22
vendor/workerman/workerman/Worker.php
vendored
@ -33,7 +33,7 @@ class Worker
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '4.0.41';
|
||||
const VERSION = '4.0.42';
|
||||
|
||||
/**
|
||||
* Status starting.
|
||||
@ -196,6 +196,13 @@ class Worker
|
||||
*/
|
||||
public $onWorkerReload = null;
|
||||
|
||||
/**
|
||||
* Emitted when worker processes exited.
|
||||
*
|
||||
* @var callable
|
||||
*/
|
||||
public $onWorkerExit = null;
|
||||
|
||||
/**
|
||||
* Transport layer protocol.
|
||||
*
|
||||
@ -1680,7 +1687,18 @@ class Worker
|
||||
$worker = static::$_workers[$worker_id];
|
||||
// Exit status.
|
||||
if ($status !== 0) {
|
||||
static::log("worker[" . $worker->name . ":$pid] exit with status $status");
|
||||
static::log("worker[{$worker->name}:$pid] exit with status $status");
|
||||
}
|
||||
|
||||
// onWorkerExit
|
||||
if ($worker->onWorkerExit) {
|
||||
try {
|
||||
call_user_func($worker->onWorkerExit, $worker, $status, $pid);
|
||||
} catch (\Exception $e) {
|
||||
static::log("worker[{$worker->name}] onWorkerExit $e");
|
||||
} catch (\Error $e) {
|
||||
static::log("worker[{$worker->name}] onWorkerExit $e");
|
||||
}
|
||||
}
|
||||
|
||||
// For Statistics.
|
||||
|
12
vendor/yansongda/pay/CHANGELOG.md
vendored
12
vendor/yansongda/pay/CHANGELOG.md
vendored
@ -1,3 +1,15 @@
|
||||
## v3.1.10
|
||||
|
||||
### added
|
||||
|
||||
- feat: 支付宝周期扣款签约接口(#644)
|
||||
|
||||
## v3.1.9
|
||||
|
||||
### fixed
|
||||
|
||||
- fix: 微信服务商模式预下单存在子商户appid时,invoke 时也应该为子商户 appid (#638)
|
||||
|
||||
## v3.1.8
|
||||
|
||||
### fixed
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Data;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02fkbl
|
||||
*/
|
||||
class BillDownloadUrlQueryPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/029p6g
|
||||
*/
|
||||
class BillEreceiptApplyPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Data;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/029i7e
|
||||
*/
|
||||
class BillEreceiptQueryPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Ebpp;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02hd36
|
||||
*/
|
||||
class PdeductBillStatusPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02hd35
|
||||
*/
|
||||
class PdeductPayPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
|
@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02hd33
|
||||
*/
|
||||
class PdeductSignAddPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
|
@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02hd34
|
||||
*/
|
||||
class PdeductSignCancelPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
|
@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02byuq?scene=common
|
||||
*/
|
||||
class AccountQueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
|
@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02fkb9
|
||||
*/
|
||||
class AuthOrderFreezePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Fund;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02fkbc
|
||||
*/
|
||||
class AuthOrderUnfreezePlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Fund;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02byve
|
||||
*/
|
||||
class TransCommonQueryPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -6,6 +6,12 @@ namespace Yansongda\Pay\Plugin\Alipay\Fund;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* 老版本转账.
|
||||
*
|
||||
* @deprecated
|
||||
* @see https://opendocs.alipay.com/support/01rfzo
|
||||
*/
|
||||
class TransOrderQueryPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -10,6 +10,9 @@ use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Parser\ResponseParser;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/03rbye
|
||||
*/
|
||||
class TransPagePayPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
|
@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02byuo?scene=common
|
||||
*/
|
||||
class TransUniTransferPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Tools;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/isv/03l9c0
|
||||
*/
|
||||
class OpenAuthTokenAppPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Tools;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/isv/03l8ca
|
||||
*/
|
||||
class OpenAuthTokenAppQueryPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -7,6 +7,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Tools;
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ailc
|
||||
*/
|
||||
class SystemOauthTokenPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function doSomethingBefore(Rocket $rocket): void
|
||||
|
@ -11,6 +11,9 @@ use Yansongda\Pay\Parser\ResponseParser;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02e7gq?scene=common
|
||||
*/
|
||||
class AppPayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ekfi
|
||||
*/
|
||||
class CancelPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02o6e7
|
||||
*/
|
||||
class ClosePlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ekfj
|
||||
*/
|
||||
class CreatePlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/028sma
|
||||
*/
|
||||
class FastRefundQueryPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/028xqz
|
||||
*/
|
||||
class OrderSettlePlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -11,6 +11,9 @@ use Yansongda\Pay\Parser\ResponseParser;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/028r8t?scene=22
|
||||
*/
|
||||
class PagePayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
@ -10,6 +10,9 @@ use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02fkat?ref=api&scene=common
|
||||
*/
|
||||
class PayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
@ -8,6 +8,9 @@ use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ekfg?scene=common
|
||||
*/
|
||||
class PreCreatePlugin extends GeneralPlugin
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ekfh?scene=common
|
||||
*/
|
||||
class QueryPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ekfk
|
||||
*/
|
||||
class RefundPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
|
@ -11,6 +11,9 @@ use Yansongda\Pay\Parser\ResponseParser;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ivbs?scene=common
|
||||
*/
|
||||
class WapPayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
18
vendor/yansongda/pay/src/Plugin/Alipay/User/AgreementExecutionPlanModifyPlugin.php
vendored
Normal file
18
vendor/yansongda/pay/src/Plugin/Alipay/User/AgreementExecutionPlanModifyPlugin.php
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\User;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02fkaq?ref=api
|
||||
*/
|
||||
class AgreementExecutionPlanModifyPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'alipay.user.agreement.executionplan.modify';
|
||||
}
|
||||
}
|
35
vendor/yansongda/pay/src/Plugin/Alipay/User/AgreementPageSignPlugin.php
vendored
Normal file
35
vendor/yansongda/pay/src/Plugin/Alipay/User/AgreementPageSignPlugin.php
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\User;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Parser\ResponseParser;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02fkan?ref=api&scene=35
|
||||
*/
|
||||
class AgreementPageSignPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::info('[alipay][AgreementPageSignPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->setDirection(ResponseParser::class)
|
||||
->mergePayload([
|
||||
'method' => 'alipay.user.agreement.page.sign',
|
||||
'biz_content' => array_merge(
|
||||
['product_code' => 'CYCLE_PAY_AUTH'],
|
||||
$rocket->getParams()
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[alipay][AgreementPageSignPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
33
vendor/yansongda/pay/src/Plugin/Alipay/User/AgreementQueryPlugin.php
vendored
Normal file
33
vendor/yansongda/pay/src/Plugin/Alipay/User/AgreementQueryPlugin.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\User;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02fkao?ref=api&scene=8837b4183390497f84bb53783b488ecc
|
||||
*/
|
||||
class AgreementQueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::info('[alipay][AgreementQueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.user.agreement.query',
|
||||
'biz_content' => array_merge(
|
||||
['personal_product_code' => 'CYCLE_PAY_AUTH_P'],
|
||||
$rocket->getParams()
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[alipay][AgreementQueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
33
vendor/yansongda/pay/src/Plugin/Alipay/User/AgreementTransferPlugin.php
vendored
Normal file
33
vendor/yansongda/pay/src/Plugin/Alipay/User/AgreementTransferPlugin.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\User;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02fkar?ref=api
|
||||
*/
|
||||
class AgreementTransferPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::info('[alipay][AgreementTransferPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.user.agreement.transfer',
|
||||
'biz_content' => array_merge(
|
||||
['target_product_code' => 'CYCLE_PAY_AUTH_P'],
|
||||
$rocket->getParams()
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[alipay][AgreementTransferPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
33
vendor/yansongda/pay/src/Plugin/Alipay/User/AgreementUnsignPlugin.php
vendored
Normal file
33
vendor/yansongda/pay/src/Plugin/Alipay/User/AgreementUnsignPlugin.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\User;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02fkap?ref=api&scene=90766afb41f74df6ae1676e89625ebac
|
||||
*/
|
||||
class AgreementUnsignPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::info('[alipay][AgreementUnsignPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.user.agreement.unsign',
|
||||
'biz_content' => array_merge(
|
||||
['personal_product_code' => 'CYCLE_PAY_AUTH_P'],
|
||||
$rocket->getParams()
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[alipay][AgreementUnsignPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02aild
|
||||
*/
|
||||
class InfoSharePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
|
@ -214,7 +214,8 @@
|
||||
$(".layui-btn-container").children("button").each(function () {
|
||||
numArr.push($(this).val()); //添加至数组
|
||||
});
|
||||
tags = numArr.lenth ? "" : numArr.join(",");
|
||||
field.tags = numArr.lenth ? "" : numArr.join(",");
|
||||
|
||||
var index = layer.load(1);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
@ -306,7 +307,8 @@
|
||||
}
|
||||
|
||||
// 添加关键词button
|
||||
function getTags(tags, flag) {
|
||||
function getTags(tags, flag)
|
||||
{
|
||||
if (tags == "") {
|
||||
layer.msg("tag不能为空");
|
||||
return false;
|
||||
|
@ -1,10 +1,16 @@
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="title"}{$Request.param.ename|getCateName}-{$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block}
|
||||
{block name="description"}{$Request.param.ename|getCateDesc}{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$Request.param.ename|getCateName}-{$sysInfo.webname}">{/block}
|
||||
{block name="ogdescription"}<meta property="og:description" content="{$Request.param.ename|getCateDesc}" />{/block}
|
||||
{block name="title"}{$cateinfo.catename} - {$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$cateinfo.catename},{$sysInfo.webname}{/block}
|
||||
{block name="description"}{$cateinfo.desc}{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$cateinfo.catename} - {$sysInfo.webname}">{/block}
|
||||
{block name="ogdescription"}<meta property="og:description" content="{$cateinfo.desc}" />{/block}
|
||||
{block name="meta"}
|
||||
<!-- SEO优化 -->
|
||||
<meta name="Copyright" content="{$sysInfo.webname}">
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta property="og:image" content=""/>
|
||||
{/block}
|
||||
{block name="column"}{include file="/public/column" /}{/block}
|
||||
|
||||
{block name="content"}
|
||||
|
@ -1,10 +1,11 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="title"}{$article.title}-{$sysInfo.webname}{/block}
|
||||
{block name="title"}{$article.title} - {$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$article.tags ?: $article.title}{/block}
|
||||
{block name="description"}{$article.title},{$article.description ?? ''}{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$article.title}-{$sysInfo.webname}"/>{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$article.title} - {$sysInfo.webname}"/>{/block}
|
||||
{block name="ogdescription"}<meta property="og:description" content="{$article.title},{$article.description ?? ''}" />{/block}
|
||||
{block name="meta"}
|
||||
<meta property="og:type" content="article"/>
|
||||
<meta property="article:published_time" content="{$article.create_time|date='c'}"/>
|
||||
<meta property="bytedance:published_time" content="{$article.create_time|date='c'}" />
|
||||
<meta property="bytedance:lrDate_time" content="{$lrDate_time|date='c'}" />
|
||||
@ -166,45 +167,16 @@
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{//帖子管理}
|
||||
{if (($article.upzip !== '') || (session('user_id')==$article.user_id) OR ($user.auth ?? ''))}
|
||||
<div class="detail-assist">
|
||||
{notempty name="$article.upzip"}
|
||||
<button type="button" class="layui-btn layui-btn-xs" id="zip-download">
|
||||
<i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次
|
||||
</button>
|
||||
{/notempty}
|
||||
<div class="fly-admin-box" data-id="{$article.id}">
|
||||
{if ($user.auth ?? '')}
|
||||
{article:istop}
|
||||
{if($article.is_hot == 0)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="1" style="background-color: #ccc" title="加精">精</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="0" title="取消加精">精</span>
|
||||
{/if}
|
||||
{if($article.is_reply == 1)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="0" title="禁评">评</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="1" style="background-color: #ccc" title="可评">评</span>
|
||||
{/if}
|
||||
<span id="color">{:lang('title color')}</span>
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="del" title="删除"><i class="layui-icon layui-icon-delete"></i></span>
|
||||
{/if}
|
||||
{if(session('user_name')==$article.user.name || ($user.auth ?? ''))}
|
||||
<a class="layui-btn layui-btn-xs" href="{$Request.domain}{:url('article/edit',['id'=>$article.id])}" title="编辑"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{//crud管理模块}
|
||||
{include file="/public/crud" /}
|
||||
</div>
|
||||
<!--底部栏-->
|
||||
<div class="site-tree-mobile-detail-bottom layui-hide-md">
|
||||
<div id="LAY_jieAdmin1" data-id="{$article['id']}"></div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="public/menu" /} {/block}
|
||||
{include file="public/menu" /}
|
||||
{/block}
|
||||
{block name="script"}
|
||||
{:hook('taonyeditor')}
|
||||
<script>
|
||||
@ -369,93 +341,11 @@
|
||||
plyr.setup();
|
||||
});
|
||||
</script>
|
||||
{//图片点击放大}
|
||||
{include file="/public/images-click" /}
|
||||
{:hook('markdownhook')}
|
||||
{include file="/public/qr-read" /}
|
||||
|
||||
// 点击图片放大
|
||||
<div id="outerdiv" style="position: fixed; top: 0; left: 0; background: rgba(0, 0, 0, 0.7); z-index: 2; width: 100%; height: 100%; display: none">
|
||||
<div id="innerdiv" style="position: absolute">
|
||||
<img id="bigimg" style="border: 5px solid #fff" src="" />
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$(".photos").on("click", "img", function () {
|
||||
var _this = $(this);
|
||||
imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
|
||||
});
|
||||
});
|
||||
function imgShow(outerdiv, innerdiv, bigimg, _this) {
|
||||
var src = _this.attr("src");
|
||||
$(bigimg).attr("src", src);
|
||||
{volist name="push_js" id="vo"} {$vo.jscode|raw} {/volist}
|
||||
{/block}
|
||||
|
||||
$("<img/>")
|
||||
.attr("src", src)
|
||||
.on("load", function () {
|
||||
var windowW = $(window).width();
|
||||
var windowH = $(window).height();
|
||||
var realWidth = this.width;
|
||||
var realHeight = this.height;
|
||||
var imgWidth, imgHeight;
|
||||
var scale = 0.8;
|
||||
if (realHeight > windowH * scale) {
|
||||
//判断图片高度
|
||||
imgHeight = windowH * scale;
|
||||
imgWidth = (imgHeight / realHeight) * realWidth;
|
||||
if (imgWidth > windowW * scale) {
|
||||
//如宽度扔大于窗口宽度
|
||||
imgWidth = windowW * scale;
|
||||
}
|
||||
} else if (realWidth > windowW * scale) {
|
||||
imgWidth = windowW * scale;
|
||||
imgHeight = (imgWidth / realWidth) * realHeight;
|
||||
} else {
|
||||
//如果图片真实高度和宽度都符合要求,高宽不变
|
||||
imgWidth = realWidth;
|
||||
imgHeight = realHeight;
|
||||
}
|
||||
$(bigimg).css("width", imgWidth);
|
||||
var w = (windowW - imgWidth) / 2;
|
||||
var h = (windowH - imgHeight) / 2;
|
||||
$(innerdiv).css({ top: h, left: w });
|
||||
$(outerdiv).fadeIn("fast");
|
||||
});
|
||||
$(outerdiv).click(function () {
|
||||
//再次点击淡出消失弹出层
|
||||
$(this).fadeOut("fast");
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
{:hook('markdownhook')}
|
||||
|
||||
<script>
|
||||
//扫码阅读
|
||||
$("#rdown").hover(
|
||||
function () {
|
||||
$("#phonedl").show().stop();
|
||||
},
|
||||
function () {
|
||||
$("#phonedl").hide().stop();
|
||||
}
|
||||
);
|
||||
|
||||
$("#phonedl").hover(
|
||||
function () {
|
||||
$("#phonedl").show().stop();
|
||||
},
|
||||
function () {
|
||||
$("#phonedl").hide().stop();
|
||||
}
|
||||
);
|
||||
|
||||
function PhoneDown() {
|
||||
layer.open({
|
||||
title: "扫码查阅",
|
||||
skin: "layui-layer",
|
||||
content: "<img src='/qrcode/?text={$Request.domain}{:url('article/detail',['id' => $article.id])}&size=230'>",
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
{volist name="push_js" id="vo"} {$vo.jscode|raw} {/volist}
|
||||
{/block}
|
||||
</div>
|
||||
|
@ -195,11 +195,11 @@
|
||||
$('.layui-btn-container').children('button').each(function(){
|
||||
numArr.push($(this).val());//添加至数组
|
||||
});
|
||||
tags = numArr.lenth ? '' : numArr.join(',');
|
||||
field.tags = numArr.lenth ? '' : numArr.join(',');
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('article/edit')}",
|
||||
data:{"id":field.id,"cate_id":field.cate_id,"title":field.title,"title_color":field.title_color,"user_id":field.user_id,"content":field.content,"upzip":field.upzip,"tags":tags,"description":field.description,"captcha":field.captcha},
|
||||
data: field,
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
|
@ -1,9 +1,15 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="title"}{$Request.param.ename|getCateName}-{$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block}
|
||||
{block name="description"}{$Request.param.ename|getCateDesc}{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$Request.param.ename|getCateName}-{$sysInfo.webname}">{/block}
|
||||
{block name="ogdescription"}<meta property="og:description" content="{$Request.param.ename|getCateDesc}" />{/block}
|
||||
{block name="title"}{$cateinfo.catename} - {$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$cateinfo.catename},{$sysInfo.webname}{/block}
|
||||
{block name="description"}{$cateinfo.desc}{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$cateinfo.catename} - {$sysInfo.webname}">{/block}
|
||||
{block name="ogdescription"}<meta property="og:description" content="{$cateinfo.desc}" />{/block}
|
||||
{block name="meta"}
|
||||
<!-- SEO优化 -->
|
||||
<meta name="Copyright" content="{$sysInfo.webname}">
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta property="og:image" content=""/>
|
||||
{/block}
|
||||
{block name="column"}{include file="/public/column" /}{/block}
|
||||
|
||||
{block name="content"}
|
||||
|
@ -1,10 +1,11 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="title"}{$article.title}-{$sysInfo.webname}{/block}
|
||||
{block name="title"}{$article.title} - {$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$article.tags ?: $article.title}{/block}
|
||||
{block name="description"}{$article.title},{$article.description ?? ''}{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$article.title}-{$sysInfo.webname}">{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$article.title} - {$sysInfo.webname}">{/block}
|
||||
{block name="ogdescription"}<meta property="og:description" content="{$article.title},{$article.description ?? ''}" />{/block}
|
||||
{block name="meta"}
|
||||
<meta property="og:type" content="article"/>
|
||||
<meta property="article:published_time" content="{$article.create_time|date='c'}"/>
|
||||
<meta property="bytedance:published_time" content="{$article.create_time|date='c'}" />
|
||||
<meta property="bytedance:updated_time" content="{$article.update_time|date='c'}" />
|
||||
@ -45,38 +46,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{//帖子管理}
|
||||
{if (($article.upzip !== '') || session('?user_name'))}
|
||||
<div class="detail-assist">
|
||||
{notempty name="$article.upzip"}
|
||||
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
|
||||
{/notempty}
|
||||
<div class="fly-admin-box" data-id="{$article.id}">
|
||||
{if ($user.auth ?? '')}
|
||||
{if($article.is_top == 0)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="1" style="background-color:#ccc;" title="置顶">顶</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="0" title="取消置顶">顶</span>
|
||||
{/if}
|
||||
{if($article.is_hot == 0)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="1" style="background-color:#ccc;" title="加精">精</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="0" title="取消加精">精</span>
|
||||
{/if}
|
||||
{if($article.is_reply == 1)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="0" title="禁评">评</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="1" style="background-color:#ccc;" title="可评">评</span>
|
||||
{/if}
|
||||
<span id="color">{:lang('title color')}</span>
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="del" title="删除"><i class="layui-icon layui-icon-delete"></i></span>
|
||||
{/if}
|
||||
{if(session('user_name')==$article.user.name || ($user.auth ?? ''))}
|
||||
<a class="layui-btn layui-btn-xs" href="{$Request.domain}{:url('article/edit',['id'=>$article.id])}" title="编辑"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{//crud管理模块}
|
||||
{include file="/public/crud" /}
|
||||
</div>
|
||||
<!--底部栏-->
|
||||
<div class="site-tree-mobile-detail-bottom layui-hide-md">
|
||||
@ -230,61 +201,8 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
// 点击图片放大
|
||||
$(function(){
|
||||
$(".photos").on("click","img",function(){
|
||||
var _this = $(this);
|
||||
imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
|
||||
});
|
||||
});
|
||||
function imgShow(outerdiv, innerdiv, bigimg, _this){
|
||||
var src = _this.attr("src");
|
||||
$(bigimg).attr("src", src);
|
||||
|
||||
$("<img/>").attr("src", src).on("load",function(){
|
||||
var windowW = $(window).width();
|
||||
var windowH = $(window).height();
|
||||
var realWidth = this.width;
|
||||
var realHeight = this.height;
|
||||
var imgWidth, imgHeight;
|
||||
var scale = 0.8;
|
||||
if(realHeight>windowH*scale) {
|
||||
//判断图片高度
|
||||
imgHeight = windowH*scale;
|
||||
imgWidth = imgHeight/realHeight*realWidth;
|
||||
if(imgWidth>windowW*scale) {
|
||||
//如宽度扔大于窗口宽度
|
||||
imgWidth = windowW*scale;
|
||||
}
|
||||
} else if(realWidth>windowW*scale) {
|
||||
|
||||
imgWidth = windowW*scale;
|
||||
imgHeight = imgWidth/realWidth*realHeight;
|
||||
} else {
|
||||
//如果图片真实高度和宽度都符合要求,高宽不变
|
||||
imgWidth = realWidth;
|
||||
imgHeight = realHeight;
|
||||
}
|
||||
$(bigimg).css("width",imgWidth);
|
||||
var w = (windowW-imgWidth)/2;
|
||||
var h = (windowH-imgHeight)/2;
|
||||
$(innerdiv).css({"top":h, "left":w});
|
||||
$(outerdiv).fadeIn("fast");
|
||||
});
|
||||
$(outerdiv).click(function(){
|
||||
//再次点击淡出消失弹出层
|
||||
$(this).fadeOut("fast");
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;">
|
||||
<div id="innerdiv" style="position:absolute;">
|
||||
<img id="bigimg" style="border:5px solid #fff;" src="" />
|
||||
</div>
|
||||
|
||||
{//图片点击放大}
|
||||
{include file="/public/images-click" /}
|
||||
{:hook('markdownhook')}
|
||||
|
||||
{volist name="push_js" id="vo"}
|
||||
|
@ -1,10 +1,15 @@
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="title"}{$Request.param.ename|getCateName}-{$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block}
|
||||
{block name="description"}{$Request.param.ename|getCateDesc}{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$Request.param.ename|getCateName}-{$sysInfo.webname}">{/block}
|
||||
{block name="ogdescription"}<meta property="og:description" content="{$Request.param.ename|getCateDesc}" />{/block}
|
||||
{block name="title"}{$cateinfo.catename} - {$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$cateinfo.catename},{$sysInfo.webname}{/block}
|
||||
{block name="description"}{$cateinfo.desc}{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$cateinfo.catename} - {$sysInfo.webname}">{/block}
|
||||
{block name="ogdescription"}<meta property="og:description" content="{$cateinfo.desc}" />{/block}
|
||||
{block name="meta"}
|
||||
<!-- SEO优化 -->
|
||||
<meta name="Copyright" content="{$sysInfo.webname}">
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta property="og:image" content=""/>
|
||||
{/block}
|
||||
{block name="column"}{include file="/public/column" /}{/block}
|
||||
|
||||
{block name="content"}
|
||||
|
@ -1,10 +1,12 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="title"}{$article.title}-{$sysInfo.webname}{/block}
|
||||
|
||||
{block name="title"}{$article.title} - {$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$article.tags ?: $article.title}{/block}
|
||||
{block name="description"}{$article.title},{$article.description}{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$article.title}-{$sysInfo.webname}">{/block}
|
||||
{block name="ogtitle"}<meta property="og:title" content="{$article.title} - {$sysInfo.webname}">{/block}
|
||||
{block name="ogdescription"}<meta property="og:description" content="{$article.title},{$article.description ?? ''}" />{/block}
|
||||
{block name="meta"}
|
||||
<meta property="og:type" content="article"/>
|
||||
<meta property="article:published_time" content="{$article.create_time|date='c'}"/>
|
||||
<meta property="bytedance:published_time" content="{$article.create_time|date='c'}" />
|
||||
<meta property="bytedance:lrDate_time" content="{$lrDate_time|date='c'}" />
|
||||
@ -149,7 +151,7 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="questions">
|
||||
<span class="layui-badge layui-bg-green">回答 {$article.user.comments_count}</span> <span class="layui-badge layui-bg-green">提问 {$article.user.article_count}</span>
|
||||
<span class="layui-badge layui-bg-green">回答 {$article.user.comments_count}</span> <span class="layui-badge layui-bg-green">发表 {$article.user.article_count}</span>
|
||||
<span class="layui-badge layui-bg-green">+ 关注</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -183,40 +185,8 @@
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{//管理}
|
||||
{if (($article.upzip !== '') || session('?user_name'))}
|
||||
<div class="detail-assist">
|
||||
{notempty name="$article.upzip"}
|
||||
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
|
||||
{/notempty}
|
||||
<div class="fly-admin-box" data-id="{$article.id}">
|
||||
{if ($user.auth ?? '')}
|
||||
{if($article.is_top == 0)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="1" style="background-color:#ccc;" title="置顶">顶</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="0" title="取消置顶">顶</span>
|
||||
{/if}
|
||||
{if($article.is_hot == 0)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="1" style="background-color:#ccc;" title="加精">精</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="0" title="取消加精">精</span>
|
||||
{/if}
|
||||
{if($article.is_reply == 1)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="0" title="禁评">评</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="1" style="background-color:#ccc;" title="可评">评</span>
|
||||
{/if}
|
||||
<span id="color">{:lang('title color')}</span>
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="del" title="删除"><i class="layui-icon layui-icon-delete"></i></span>
|
||||
{/if}
|
||||
{if(session('user_name')==$article.user.name || ($user.auth ?? ''))}
|
||||
<a class="layui-btn layui-btn-xs" href="{$Request.domain}{:url('article/edit',['id'=>$article.id])}" title="编辑"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{//crud管理模块}
|
||||
{include file="/public/crud" /}
|
||||
</div>
|
||||
<!--底部栏-->
|
||||
<div class="site-tree-mobile-detail-bottom layui-hide-md">
|
||||
@ -384,85 +354,10 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;">
|
||||
<div id="innerdiv" style="position:absolute;">
|
||||
<img id="bigimg" style="border:5px solid #fff;" src="" />
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
// 点击图片放大
|
||||
$(function(){
|
||||
$(".photos").on("click","img",function(){
|
||||
var _this = $(this);
|
||||
imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
|
||||
});
|
||||
});
|
||||
|
||||
function imgShow(outerdiv, innerdiv, bigimg, _this){
|
||||
var src = _this.attr("src");
|
||||
$(bigimg).attr("src", src);
|
||||
|
||||
$("<img/>").attr("src", src).on("load",function(){
|
||||
var windowW = $(window).width();
|
||||
var windowH = $(window).height();
|
||||
var realWidth = this.width;
|
||||
var realHeight = this.height;
|
||||
var imgWidth, imgHeight;
|
||||
var scale = 0.8;
|
||||
if(realHeight>windowH*scale) {
|
||||
//判断图片高度
|
||||
imgHeight = windowH*scale;
|
||||
imgWidth = imgHeight/realHeight*realWidth;
|
||||
if(imgWidth>windowW*scale) {
|
||||
//如宽度扔大于窗口宽度
|
||||
imgWidth = windowW*scale;
|
||||
}
|
||||
} else if(realWidth>windowW*scale) {
|
||||
|
||||
imgWidth = windowW*scale;
|
||||
imgHeight = imgWidth/realWidth*realHeight;
|
||||
} else {
|
||||
//如果图片真实高度和宽度都符合要求,高宽不变
|
||||
imgWidth = realWidth;
|
||||
imgHeight = realHeight;
|
||||
}
|
||||
$(bigimg).css("width",imgWidth);
|
||||
var w = (windowW-imgWidth)/2;
|
||||
var h = (windowH-imgHeight)/2;
|
||||
$(innerdiv).css({"top":h, "left":w});
|
||||
$(outerdiv).fadeIn("fast");
|
||||
});
|
||||
$(outerdiv).click(function(){
|
||||
//再次点击淡出消失弹出层
|
||||
$(this).fadeOut("fast");
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
{//图片点击放大}
|
||||
{include file="/public/images-click" /}
|
||||
{:hook('markdownhook')}
|
||||
|
||||
<script>
|
||||
//扫码阅读
|
||||
$("#rdown").hover(function(){
|
||||
$("#phonedl").show().stop();
|
||||
},function(){
|
||||
$("#phonedl").hide().stop();
|
||||
});
|
||||
|
||||
$("#phonedl").hover(function(){
|
||||
$("#phonedl").show().stop();
|
||||
},function(){
|
||||
$("#phonedl").hide().stop();
|
||||
});
|
||||
|
||||
function PhoneDown(){
|
||||
layer.open({
|
||||
title: "扫码查阅",
|
||||
skin: 'layui-layer',
|
||||
content: "<img src='/qrcode/?text={$Request.domain}{:url('article/detail',['id' => $article.id])}&size=230'>"
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{include file="/public/qr-read" /}
|
||||
|
||||
{volist name="push_js" id="vo"}
|
||||
{$vo.jscode|raw}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: TaoLer <alipay_tao@qq.com>
|
||||
* @Date: 2021-12-06 16:04:51
|
||||
* @LastEditTime: 2022-07-30 07:20:01
|
||||
* @LastEditTime: 2022-08-10 16:50:38
|
||||
* @LastEditors: TaoLer
|
||||
* @Description: 搜索引擎SEO优化设置
|
||||
* @FilePath: \github\TaoLer\view\taoler\index\public\base.html
|
||||
@ -22,13 +22,14 @@
|
||||
<meta name="keywords" content="{block name='keywords'}关键词{/block}" />
|
||||
<meta name="description" content="{block name='description'}描述{/block}" />
|
||||
<meta name="Copyright" content="{$sysInfo.webname}" />
|
||||
<meta property="og:type" content="article">
|
||||
{block name="ogtitle"} {/block}
|
||||
{block name="ogdescription"} {/block}
|
||||
<meta property="og:url" content="{$Request.domain}{$Request.url}" />
|
||||
<meta property="og:site_name" content="{$sysInfo.webname}" />
|
||||
{block name="ogimage"} {/block}
|
||||
{block name="meta"}{/block}
|
||||
<script src="/static/jquery-3.6.0.min.js"></script>
|
||||
<script src="{$Request.domain}/static/layui/layui.js" charset="utf-8"></script>
|
||||
<!-- 样式 -->
|
||||
<link rel="canonical" href="{$Request.domain}{$Request.url}">
|
||||
<link rel="stylesheet" href="{$Request.domain}/static/layui/css/layui.css" charset="utf-8">
|
||||
@ -43,7 +44,6 @@
|
||||
html body{margin-top: 1px;}
|
||||
{/if}
|
||||
</style>
|
||||
<script src="{$Request.domain}/static/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="{$Request.domain}/static/share/plusShare.js" type="text/javascript" charset="utf-8"></script>
|
||||
</head>
|
||||
<body >
|
||||
|
32
view/taoler/index/public/crud.html
Normal file
32
view/taoler/index/public/crud.html
Normal file
@ -0,0 +1,32 @@
|
||||
{//管理帖子加精、置顶、编辑、删除模块}
|
||||
{if (($article.upzip !== '') || session('?user_name'))}
|
||||
<div class="detail-assist">
|
||||
{notempty name="$article.upzip"}
|
||||
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
|
||||
{/notempty}
|
||||
<div class="fly-admin-box" data-id="{$article.id}">
|
||||
{if ($user.auth ?? '')}
|
||||
{if($article.is_top == 0)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="1" style="background-color:#ccc;" title="置顶">顶</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="0" title="取消置顶">顶</span>
|
||||
{/if}
|
||||
{if($article.is_hot == 0)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="1" style="background-color:#ccc;" title="加精">精</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="0" title="取消加精">精</span>
|
||||
{/if}
|
||||
{if($article.is_reply == 1)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="0" title="禁评">评</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="1" style="background-color:#ccc;" title="可评">评</span>
|
||||
{/if}
|
||||
<span id="color">{:lang('title color')}</span>
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="del" title="删除"><i class="layui-icon layui-icon-delete"></i></span>
|
||||
{/if}
|
||||
{if(session('user_name')==$article.user.name || ($user.auth ?? ''))}
|
||||
<a class="layui-btn layui-btn-xs" href="{$Request.domain}{:url('article/edit',['id'=>$article.id])}" title="编辑"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
54
view/taoler/index/public/images-click.html
Normal file
54
view/taoler/index/public/images-click.html
Normal file
@ -0,0 +1,54 @@
|
||||
{// 点击图片放大}
|
||||
<div id="outerdiv" style="position: fixed; top: 0; left: 0; background: rgba(0, 0, 0, 0.7); z-index: 2; width: 100%; height: 100%; display: none">
|
||||
<div id="innerdiv" style="position: absolute">
|
||||
<img id="bigimg" style="border: 5px solid #fff" src="" />
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$(".photos").on("click", "img", function () {
|
||||
var _this = $(this);
|
||||
imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
|
||||
});
|
||||
});
|
||||
function imgShow(outerdiv, innerdiv, bigimg, _this) {
|
||||
var src = _this.attr("src");
|
||||
$(bigimg).attr("src", src);
|
||||
|
||||
$("<img/>")
|
||||
.attr("src", src)
|
||||
.on("load", function () {
|
||||
var windowW = $(window).width();
|
||||
var windowH = $(window).height();
|
||||
var realWidth = this.width;
|
||||
var realHeight = this.height;
|
||||
var imgWidth, imgHeight;
|
||||
var scale = 0.8;
|
||||
if (realHeight > windowH * scale) {
|
||||
//判断图片高度
|
||||
imgHeight = windowH * scale;
|
||||
imgWidth = (imgHeight / realHeight) * realWidth;
|
||||
if (imgWidth > windowW * scale) {
|
||||
//如宽度扔大于窗口宽度
|
||||
imgWidth = windowW * scale;
|
||||
}
|
||||
} else if (realWidth > windowW * scale) {
|
||||
imgWidth = windowW * scale;
|
||||
imgHeight = (imgWidth / realWidth) * realHeight;
|
||||
} else {
|
||||
//如果图片真实高度和宽度都符合要求,高宽不变
|
||||
imgWidth = realWidth;
|
||||
imgHeight = realHeight;
|
||||
}
|
||||
$(bigimg).css("width", imgWidth);
|
||||
var w = (windowW - imgWidth) / 2;
|
||||
var h = (windowH - imgHeight) / 2;
|
||||
$(innerdiv).css({ top: h, left: w });
|
||||
$(outerdiv).fadeIn("fast");
|
||||
});
|
||||
$(outerdiv).click(function () {
|
||||
//再次点击淡出消失弹出层
|
||||
$(this).fadeOut("fast");
|
||||
});
|
||||
}
|
||||
</script>
|
22
view/taoler/index/public/qr-read.html
Normal file
22
view/taoler/index/public/qr-read.html
Normal file
@ -0,0 +1,22 @@
|
||||
<script>
|
||||
//扫码阅读
|
||||
$("#rdown").hover(function(){
|
||||
$("#phonedl").show().stop();
|
||||
},function(){
|
||||
$("#phonedl").hide().stop();
|
||||
});
|
||||
|
||||
$("#phonedl").hover(function(){
|
||||
$("#phonedl").show().stop();
|
||||
},function(){
|
||||
$("#phonedl").hide().stop();
|
||||
});
|
||||
|
||||
function PhoneDown(){
|
||||
layer.open({
|
||||
title: "扫码查阅",
|
||||
skin: 'layui-layer',
|
||||
content: "<img src='/qrcode/?text={$Request.domain}{:url('article/detail',['id' => $article.id])}&size=230'>"
|
||||
});
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user