This commit is contained in:
tao 2022-08-16 15:21:08 +08:00
parent 6cf7c3c589
commit ad7510a7bb
77 changed files with 770 additions and 547 deletions

View File

@ -454,7 +454,6 @@ abstract class BaseController
*/ */
public function uploadFiles($type) public function uploadFiles($type)
{ {
$type = Request::param('type');
$uploads = new Uploads(); $uploads = new Uploads();
switch ($type){ switch ($type){
case 'image': case 'image':

View File

@ -19,9 +19,6 @@ class Addons extends AdminController
*/ */
public function index() public function index()
{ {
//$conf = new \addons\social\model\Conf;
//$arr = $conf->getConf();
//dump($arr);
return View::fetch(); return View::fetch();
} }
@ -63,9 +60,6 @@ class Addons extends AdminController
//在线 //在线
case 'onlineAddons': case 'onlineAddons':
$url = $this->getSystem()['api_url'].'/v1/addons'; $url = $this->getSystem()['api_url'].'/v1/addons';
$res = Cache::get('addons');
if(empty($res)){
$addons = Api::urlGet($url,[]); $addons = Api::urlGet($url,[]);
if( $addons->code !== -1){ if( $addons->code !== -1){
$res['code'] = 0; $res['code'] = 0;
@ -84,12 +78,9 @@ class Addons extends AdminController
['field' => 'ctime','title'=> '时间', 'width'=> 150], ['field' => 'ctime','title'=> '时间', 'width'=> 150],
['title' => '操作', 'width'=> 150, 'align'=>'center', 'toolbar'=> '#addons-tool'] ['title' => '操作', 'width'=> 150, 'align'=>'center', 'toolbar'=> '#addons-tool']
]; ];
Cache::set('addons', $res, 600);
} else { } else {
$res = ['code'=>-1,'msg'=>'未获取到服务器信息']; $res = ['code'=>-1,'msg'=>'未获取到服务器信息'];
} }
}
break; break;
} }

View File

@ -339,6 +339,7 @@ class Forum extends AdminController
$data = Request::only(['cate_id', 'title', 'title_color', 'tiny_content', 'content', 'upzip', 'tags', 'description', 'captcha']); $data = Request::only(['cate_id', 'title', 'title_color', 'tiny_content', 'content', 'upzip', 'tags', 'description', 'captcha']);
$data['user_id'] = 1; //管理员ID $data['user_id'] = 1; //管理员ID
// 调用验证器 // 调用验证器
$validate = new \app\common\validate\Article; $validate = new \app\common\validate\Article;
$result = $validate->scene('Artadd')->check($data); $result = $validate->scene('Artadd')->check($data);
@ -452,6 +453,7 @@ class Forum extends AdminController
{ {
$data = Request::only(['tags','flag']); $data = Request::only(['tags','flag']);
return $this->setTags($data); return $this->setTags($data);
} }
/** /**

View File

@ -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 // 手动添加tags
$("#article-tags-button").on("click", function () { $("#article-tags-button").on("click", function () {
var tags = $("input[name='tags']").val(); var tags = $("input[name='tags']").val();

View File

@ -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(){ $("#L_content").bind('input propertychange', function(){
var content = $(this).val() var content = $(this).val()

View File

@ -193,6 +193,13 @@ layui.config({
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){ iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
var field = data.field; //获取提交的字段 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 成功后,静态更新表格中的数据
$.ajax({ $.ajax({
type:"post", type:"post",

View File

@ -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) function getArtContent($content)
{ {
@ -283,23 +262,23 @@ function showSlider($type)
//提取内容第一张图片 //提取内容第一张图片
function getOnepic($str) function getOnepic($str)
{ {
// <img src="http://img.com" /> //匹配格式为 <img src="http://img.com" />
/* $pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/"; $pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
preg_match_all($pattern,$str,$matchContent); preg_match_all($pattern,$str,$matchContent);
if(isset($matchContent[1][0])){ if(isset($matchContent[1][0])){
$img = $matchContent[1][0]; $img = $matchContent[1][0];
}else{ } else {
$temp="./images/no-image.jpg";//在相应位置放置一张命名为no-image的jpg图片 //$temp="./images/no-image.jpg";//在相应位置放置一张命名为no-image的jpg图片
//匹配格式为 img[/storage/1/article_pic/20220428/6c2647d24d5ca2c179e4a5b76990c00c.jpg]
$pattern = "/(?<=img\[)[^\]]*(?=\])/";
preg_match($pattern,$str,$matchContent);
if(isset($matchContent[0])){
$img = $matchContent[0];
}else{
return false;
}
} }
*/
// 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; return $img;
} }

View File

@ -2,7 +2,7 @@
/* /*
* @Author: TaoLer <alipay_tao@qq.com> * @Author: TaoLer <alipay_tao@qq.com>
* @Date: 2021-12-06 16:04:50 * @Date: 2021-12-06 16:04:50
* @LastEditTime: 2022-07-26 15:17:08 * @LastEditTime: 2022-08-03 10:34:42
* @LastEditors: TaoLer * @LastEditors: TaoLer
* @Description: 前端基础控制器设置 * @Description: 前端基础控制器设置
* @FilePath: \github\TaoLer\app\common\controller\BaseController.php * @FilePath: \github\TaoLer\app\common\controller\BaseController.php
@ -122,4 +122,20 @@ class BaseController extends BaseCtrl
return $sysInfo; 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;
}
} }

View File

@ -72,7 +72,12 @@ class Uploads
*/ */
public function put(string $fileName, string $dirName, int $fileSize, string $fileType, string $rule = null) 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()); //halt($file->getOriginalName());
//$type = $file->getMime(); //$type = $file->getMime();
$fileExt = $this->getFileInfo($fileType,'ext'); $fileExt = $this->getFileInfo($fileType,'ext');

View File

@ -1,4 +1,13 @@
<?php <?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; namespace app\common\model;
use think\Model; use think\Model;
@ -11,6 +20,14 @@ class Cate extends Model
protected $deleteTime = 'delete_time'; protected $deleteTime = 'delete_time';
protected $defaultSoftDelete = 0; 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) public function del($id)
{ {
$cates = $this->find($id); $cates = $this->find($id);

View File

@ -8,17 +8,17 @@ use think\facade\Request;
use think\facade\Db; use think\facade\Db;
use think\facade\Cache; use think\facade\Cache;
use think\facade\Config; use think\facade\Config;
use app\common\model\Cate;
use app\common\model\Comment; use app\common\model\Comment;
use app\common\model\Article as ArticleModel; use app\common\model\Article as ArticleModel;
use app\common\model\Slider; use app\common\model\Slider;
use app\common\model\UserZan; use app\common\model\UserZan;
use taoler\com\Message; use taoler\com\Message;
use app\common\lib\Msgres; use app\common\lib\Msgres;
use app\common\lib\Uploads;
use taoser\SetArr;
use taoler\com\Api;
use Overtrue\Pinyin\Pinyin; use Overtrue\Pinyin\Pinyin;
class Article extends BaseController class Article extends BaseController
{ {
protected $middleware = [ protected $middleware = [
@ -35,9 +35,12 @@ class Article extends BaseController
} }
//动态参数 //动态参数
$ename = Request::param('ename') ?? 'all'; $ename = Request::param('ename') ?? 'all';
$cate = new Cate();
$cateInfo = $cate->getCateInfo($ename);
// halt($cateInfo);
$type = Request::param('type') ?? 'all'; $type = Request::param('type') ?? 'all';
$page = Request::param('page') ? Request::param('page') : 1; $page = Request::param('page') ? Request::param('page') : 1;
$tpl = Db::name('cate')->where('ename',$ename)->value('detpl');
//分页url //分页url
$url = url('cate_page',['ename'=>$ename,'type'=>$type,'page'=>$page]); $url = url('cate_page',['ename'=>$ename,'type'=>$type,'page'=>$page]);
//返回最后/前面的字符串 //返回最后/前面的字符串
@ -55,8 +58,18 @@ class Article extends BaseController
//分类钻展赞助 //分类钻展赞助
$ad_comm = $ad->getSliderList(6); $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]); View::assign([
return View::fetch('article/'.$tpl.'/cate'); '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'=>'抱歉,系统维护中,暂时禁止发帖!']); 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) if(Config::get('taoler.config.post_captcha') == 1)
@ -254,10 +267,14 @@ class Article extends BaseController
// 获取内容图片音视频标识 // 获取内容图片音视频标识
$iva= $this->hasIva($data['content']); $iva= $this->hasIva($data['content']);
$data = array_merge($data,$iva); $data = array_merge($data,$iva);
$data['content'] = $this->downUrlPicsReaplace($data['content']);
// 获取分类ename // 获取分类ename
$cate_ename = Db::name('cate')->where('id',$data['cate_id'])->value('ename'); $cate_ename = Db::name('cate')->where('id',$data['cate_id'])->value('ename');
$article = new ArticleModel(); $article = new ArticleModel();
$result = $article->add($data); $result = $article->add($data);
if ($result['code'] == 1) { if ($result['code'] == 1) {
// 获取到的最新ID // 获取到的最新ID
@ -321,6 +338,9 @@ class Article extends BaseController
//获取内容图片音视频标识 //获取内容图片音视频标识
$iva= $this->hasIva($data['content']); $iva= $this->hasIva($data['content']);
$data = array_merge($data,$iva); $data = array_merge($data,$iva);
$data['content'] = $this->downUrlPicsReaplace($data['content']);
$result = $article->edit($data); $result = $article->edit($data);
if($result == 1) { if($result == 1) {
@ -525,10 +545,16 @@ class Article extends BaseController
// 匹配所有 // 匹配所有
//$content = str_replace("$key", 'a('.$value.')['.$key.']',$content); //$content = str_replace("$key", 'a('.$value.')['.$key.']',$content);
// 限定匹配数量 '/'.$key.'/' // 限定匹配数量 '/'.$key.'/'
// 匹配不包含[和]的内容 // 匹配不包含[和]的内容
$pats = '/(?<!\[)'.$key.'(?!\])/'; // $pats = '/(?<!\[)'.$key.'(?!\])/';
//preg_match($pats,$content,$arr); // $pats = '/(?<!<a\s?(.*)?)'.$key.'(?!<\/a>)/';
//halt($arr[0]); //$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.']'; $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; return $content;
} }
//点赞文章
public function userZanArticle() 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;
}
} }

View File

@ -2,10 +2,10 @@
/* /*
* @Author: TaoLer <alipay_tao@qq.com> * @Author: TaoLer <alipay_tao@qq.com>
* @Date: 2021-12-06 16:04:50 * @Date: 2021-12-06 16:04:50
* @LastEditTime: 2022-06-19 16:35:30 * @LastEditTime: 2022-07-31 13:06:34
* @LastEditors: TaoLer * @LastEditors: TaoLer
* @Description: 搜索引擎SEO优化设置 * @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. * Copyright (c) 2020~2022 https://www.aieok.com All rights reserved.
*/ */
declare (strict_types = 1); declare (strict_types = 1);
@ -35,13 +35,30 @@ class UserLogin
if($type == 'log'){ if($type == 'log'){
//$name = $user->user['name']; //$name = $user->user['name'];
$ip = request()->ip(); $ip = request()->ip();
$url = 'http://ip-api.com/json/' . $ip . '?lang=zh-CN&fields=57361'; //$url = 'http://ip-api.com/json/' . $ip . '?lang=zh-CN&fields=57361';
$ipJson = Api::urlGet($url); $url = 'http://freeapi.ipip.net/' . $ip;
if($ipJson->status == 'success'){
$city = $ipJson->city; $ipJson = Api::urlGetRespond($url);
} else { $respond = $ipJson->getData();
$city ='未知';
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( $u->allowField(['city','last_login_ip','last_login_time','login_error_num'])->save(
[ [

32
composer.lock generated
View File

@ -2343,16 +2343,16 @@
}, },
{ {
"name": "workerman/workerman", "name": "workerman/workerman",
"version": "v4.0.41", "version": "v4.0.42",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/walkor/workerman.git", "url": "https://github.com/walkor/workerman.git",
"reference": "8a6a536f7f720a1d8af421ef4a48789c90ab19ec" "reference": "83f09b50eaf7412504604030daa9e1f9c767e6c3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/walkor/workerman/zipball/8a6a536f7f720a1d8af421ef4a48789c90ab19ec", "url": "https://api.github.com/repos/walkor/workerman/zipball/83f09b50eaf7412504604030daa9e1f9c767e6c3",
"reference": "8a6a536f7f720a1d8af421ef4a48789c90ab19ec", "reference": "83f09b50eaf7412504604030daa9e1f9c767e6c3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2402,20 +2402,20 @@
"type": "patreon" "type": "patreon"
} }
], ],
"time": "2022-07-19T08:05:44+00:00" "time": "2022-07-29T09:06:29+00:00"
}, },
{ {
"name": "yansongda/pay", "name": "yansongda/pay",
"version": "v3.1.9", "version": "v3.1.10",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/yansongda/pay.git", "url": "https://github.com/yansongda/pay.git",
"reference": "bd56ba3054aa9b13cfe20e406a8fd5db030031f8" "reference": "e02069503b608f2cb8fcb75011cdd0810bbfe88a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/yansongda/pay/zipball/bd56ba3054aa9b13cfe20e406a8fd5db030031f8", "url": "https://api.github.com/repos/yansongda/pay/zipball/e02069503b608f2cb8fcb75011cdd0810bbfe88a",
"reference": "bd56ba3054aa9b13cfe20e406a8fd5db030031f8", "reference": "e02069503b608f2cb8fcb75011cdd0810bbfe88a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2479,7 +2479,7 @@
"issues": "https://github.com/yansongda/pay/issues", "issues": "https://github.com/yansongda/pay/issues",
"source": "https://github.com/yansongda/pay" "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", "name": "yansongda/supports",
@ -2788,16 +2788,16 @@
}, },
{ {
"name": "symfony/var-dumper", "name": "symfony/var-dumper",
"version": "v4.4.42", "version": "v4.4.44",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/var-dumper.git", "url": "https://github.com/symfony/var-dumper.git",
"reference": "742aab50ad097bcb62d91fccb613f66b8047d2ca" "reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/742aab50ad097bcb62d91fccb613f66b8047d2ca", "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f19951007dae942cc79b979c1fe26bfdfbeb54ed",
"reference": "742aab50ad097bcb62d91fccb613f66b8047d2ca", "reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2857,7 +2857,7 @@
"dump" "dump"
], ],
"support": { "support": {
"source": "https://github.com/symfony/var-dumper/tree/v4.4.42" "source": "https://github.com/symfony/var-dumper/tree/v4.4.44"
}, },
"funding": [ "funding": [
{ {
@ -2873,7 +2873,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-05-21T10:00:54+00:00" "time": "2022-07-20T09:59:04+00:00"
}, },
{ {
"name": "topthink/think-trace", "name": "topthink/think-trace",

View File

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

View File

@ -1,4 +1,13 @@
<?php <?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; namespace taoler\com;
@ -47,6 +56,25 @@ class Api
return json_decode('{"code":-1,"msg":"远程服务器失败,稍后重试"}'); //转换为对象 return json_decode('{"code":-1,"msg":"远程服务器失败,稍后重试"}'); //转换为对象
} }
} }
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() public static function get_real_ip()
{ {

View File

@ -77,6 +77,12 @@ var forms = table.render({
//监听提交 //监听提交
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){ iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
var field = data.field; //获取提交的字段 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", type:"post",

File diff suppressed because one or more lines are too long

View File

@ -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'); include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server');
exit(0); exit(0);
} }

View File

@ -1984,17 +1984,17 @@
}, },
{ {
"name": "symfony/var-dumper", "name": "symfony/var-dumper",
"version": "v4.4.42", "version": "v4.4.44",
"version_normalized": "4.4.42.0", "version_normalized": "4.4.44.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/var-dumper.git", "url": "https://github.com/symfony/var-dumper.git",
"reference": "742aab50ad097bcb62d91fccb613f66b8047d2ca" "reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/742aab50ad097bcb62d91fccb613f66b8047d2ca", "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f19951007dae942cc79b979c1fe26bfdfbeb54ed",
"reference": "742aab50ad097bcb62d91fccb613f66b8047d2ca", "reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2018,7 +2018,7 @@
"ext-intl": "To show region name in time zone dump", "ext-intl": "To show region name in time zone dump",
"symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" "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": [ "bin": [
"Resources/bin/var-dump-server" "Resources/bin/var-dump-server"
], ],
@ -2056,7 +2056,7 @@
"dump" "dump"
], ],
"support": { "support": {
"source": "https://github.com/symfony/var-dumper/tree/v4.4.42" "source": "https://github.com/symfony/var-dumper/tree/v4.4.44"
}, },
"funding": [ "funding": [
{ {
@ -2939,17 +2939,17 @@
}, },
{ {
"name": "workerman/workerman", "name": "workerman/workerman",
"version": "v4.0.41", "version": "v4.0.42",
"version_normalized": "4.0.41.0", "version_normalized": "4.0.42.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/walkor/workerman.git", "url": "https://github.com/walkor/workerman.git",
"reference": "8a6a536f7f720a1d8af421ef4a48789c90ab19ec" "reference": "83f09b50eaf7412504604030daa9e1f9c767e6c3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/walkor/workerman/zipball/8a6a536f7f720a1d8af421ef4a48789c90ab19ec", "url": "https://api.github.com/repos/walkor/workerman/zipball/83f09b50eaf7412504604030daa9e1f9c767e6c3",
"reference": "8a6a536f7f720a1d8af421ef4a48789c90ab19ec", "reference": "83f09b50eaf7412504604030daa9e1f9c767e6c3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2958,7 +2958,7 @@
"suggest": { "suggest": {
"ext-event": "For better performance. " "ext-event": "For better performance. "
}, },
"time": "2022-07-19T08:05:44+00:00", "time": "2022-07-29T09:06:29+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@ -3005,17 +3005,17 @@
}, },
{ {
"name": "yansongda/pay", "name": "yansongda/pay",
"version": "v3.1.9", "version": "v3.1.10",
"version_normalized": "3.1.9.0", "version_normalized": "3.1.10.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/yansongda/pay.git", "url": "https://github.com/yansongda/pay.git",
"reference": "bd56ba3054aa9b13cfe20e406a8fd5db030031f8" "reference": "e02069503b608f2cb8fcb75011cdd0810bbfe88a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/yansongda/pay/zipball/bd56ba3054aa9b13cfe20e406a8fd5db030031f8", "url": "https://api.github.com/repos/yansongda/pay/zipball/e02069503b608f2cb8fcb75011cdd0810bbfe88a",
"reference": "bd56ba3054aa9b13cfe20e406a8fd5db030031f8", "reference": "e02069503b608f2cb8fcb75011cdd0810bbfe88a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3049,7 +3049,7 @@
"illuminate/container": "Laravel 框架下使用 SDK请安装", "illuminate/container": "Laravel 框架下使用 SDK请安装",
"php-di/php-di": "其它/无框架下使用 SDK请安装" "php-di/php-di": "其它/无框架下使用 SDK请安装"
}, },
"time": "2022-07-24T02:23:58+00:00", "time": "2022-08-09T13:49:29+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {

View File

@ -3,7 +3,7 @@
'name' => 'taoser/taoler', 'name' => 'taoser/taoler',
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => '9c56fe07e9c108768ac6d8a254dc3e838186eab1', 'reference' => '36ce800bdbb34844639cbef6c8658e5a36b1dc6e',
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@ -290,9 +290,9 @@
'dev_requirement' => true, 'dev_requirement' => true,
), ),
'symfony/var-dumper' => array( 'symfony/var-dumper' => array(
'pretty_version' => 'v4.4.42', 'pretty_version' => 'v4.4.44',
'version' => '4.4.42.0', 'version' => '4.4.44.0',
'reference' => '742aab50ad097bcb62d91fccb613f66b8047d2ca', 'reference' => 'f19951007dae942cc79b979c1fe26bfdfbeb54ed',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../symfony/var-dumper', 'install_path' => __DIR__ . '/../symfony/var-dumper',
'aliases' => array(), 'aliases' => array(),
@ -301,7 +301,7 @@
'taoser/taoler' => array( 'taoser/taoler' => array(
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => '9c56fe07e9c108768ac6d8a254dc3e838186eab1', 'reference' => '36ce800bdbb34844639cbef6c8658e5a36b1dc6e',
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@ -452,18 +452,18 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'workerman/workerman' => array( 'workerman/workerman' => array(
'pretty_version' => 'v4.0.41', 'pretty_version' => 'v4.0.42',
'version' => '4.0.41.0', 'version' => '4.0.42.0',
'reference' => '8a6a536f7f720a1d8af421ef4a48789c90ab19ec', 'reference' => '83f09b50eaf7412504604030daa9e1f9c767e6c3',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../workerman/workerman', 'install_path' => __DIR__ . '/../workerman/workerman',
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'yansongda/pay' => array( 'yansongda/pay' => array(
'pretty_version' => 'v3.1.9', 'pretty_version' => 'v3.1.10',
'version' => '3.1.9.0', 'version' => '3.1.10.0',
'reference' => 'bd56ba3054aa9b13cfe20e406a8fd5db030031f8', 'reference' => 'e02069503b608f2cb8fcb75011cdd0810bbfe88a',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../yansongda/pay', 'install_path' => __DIR__ . '/../yansongda/pay',
'aliases' => array(), 'aliases' => array(),

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php <?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); declare (strict_types = 1);
return array ( return array (
0 => 'taoser\\addons\\Service', 0 => 'taoser\\addons\\Service',

View File

@ -28,7 +28,7 @@ class ArgsStub extends EnumStub
$values = []; $values = [];
foreach ($args as $k => $v) { 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) { if (null === $params) {
parent::__construct($values, false); parent::__construct($values, false);

View File

@ -102,7 +102,7 @@ class IntlCaster
'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL), 'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL),
'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL), 'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL),
] ]
), ),
]; ];
return self::castError($c, $a); return self::castError($c, $a);

View File

@ -45,7 +45,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
public function __construct($output = null, string $charset = null, int $flags = 0) public function __construct($output = null, string $charset = null, int $flags = 0)
{ {
$this->flags = $flags; $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->decimalPoint = \PHP_VERSION_ID >= 80000 ? '.' : localeconv()['decimal_point'];
$this->setOutput($output ?: static::$defaultOutput); $this->setOutput($output ?: static::$defaultOutput);
if (!$output && \is_string(static::$defaultOutput)) { if (!$output && \is_string(static::$defaultOutput)) {

View File

@ -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';
} }
/** /**

View File

@ -81,7 +81,7 @@ class HtmlDumper extends CliDumper
{ {
AbstractDumper::__construct($output, $charset, $flags); AbstractDumper::__construct($output, $charset, $flags);
$this->dumpId = 'sf-dump-'.mt_rand(); $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']; $this->styles = static::$themes['dark'] ?? self::$themes['dark'];
} }
@ -882,7 +882,7 @@ EOHTML
} }
if ('const' === $style && isset($attr['value'])) { 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) { } elseif ('public' === $style) {
$style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property'); $style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property');
} elseif ('str' === $style && 1 < $attr['length']) { } elseif ('str' === $style && 1 < $attr['length']) {

View File

@ -102,7 +102,7 @@ class Http
if (false === $crlf_pos) { if (false === $crlf_pos) {
// Judge whether the package length exceeds the limit. // Judge whether the package length exceeds the limit.
if ($recv_len = \strlen($recv_buffer) >= 16384) { 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;
} }
return 0; return 0;
@ -140,7 +140,7 @@ class Http
} }
} }
if ($length > $connection->maxPackageSize) { 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 0;
} }
return $length; return $length;

View File

@ -490,11 +490,24 @@ class Request
{ {
$http_post_boundary = \trim($http_post_boundary, '"'); $http_post_boundary = \trim($http_post_boundary, '"');
$buffer = $this->_buffer; $buffer = $this->_buffer;
$post_encode_string = '';
$files_encode_string = '';
$files = [];
$boday_position = strpos($buffer, "\r\n\r\n") + 4; $boday_position = strpos($buffer, "\r\n\r\n") + 4;
$offset = $boday_position + strlen($http_post_boundary) + 2; $offset = $boday_position + strlen($http_post_boundary) + 2;
$max_count = static::$maxFileUploads; $max_count = static::$maxFileUploads;
while ($max_count-- > 0 && $offset) { 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 * @param $section_start_offset
* @return int * @return int
*/ */
protected function parseUploadFile($boundary, $section_start_offset) protected function parseUploadFile($boundary, $section_start_offset, &$post_encode_string, &$files_encode_str, &$files)
{ {
$file = []; $file = [];
$boundary = "\r\n$boundary"; $boundary = "\r\n$boundary";
@ -523,7 +536,7 @@ class Request
if (!\strpos($content_line, ': ')) { if (!\strpos($content_line, ': ')) {
return 0; return 0;
} }
[$key, $value] = \explode(': ', $content_line); list($key, $value) = \explode(': ', $content_line);
switch (strtolower($key)) { switch (strtolower($key)) {
case "content-disposition": case "content-disposition":
// Is file data. // Is file data.
@ -557,12 +570,7 @@ class Request
// Parse $_POST. // Parse $_POST.
if (\preg_match('/name="(.*?)"$/', $value, $match)) { if (\preg_match('/name="(.*?)"$/', $value, $match)) {
$k = $match[1]; $k = $match[1];
$post_str = \urlencode($k) . "=" . \urlencode($boundary_value); $post_encode_string .= \urlencode($k) . "=" . \urlencode($boundary_value) . '&';
$post = [];
parse_str($post_str, $post);
if ($post) {
$this->_data['post'] = \array_merge_recursive($this->_data['post'], $post);
}
} }
return $section_end_offset + \strlen($boundary) + 2; return $section_end_offset + \strlen($boundary) + 2;
} }
@ -575,13 +583,8 @@ class Request
if ($upload_key === false) { if ($upload_key === false) {
return 0; return 0;
} }
$str = \urlencode($upload_key) . "=1"; $files_encode_str .= \urlencode($upload_key) . '=' . \count($files) . '&';
$result = []; $files[] = $file;
\parse_str($str, $result);
\array_walk_recursive($result, function (&$value) use ($file) {
$value = $file;
});
$this->_data['files'] = \array_merge_recursive($this->_data['files'], $result);
return $section_end_offset + \strlen($boundary) + 2; return $section_end_offset + \strlen($boundary) + 2;
} }

View File

@ -33,7 +33,7 @@ class Worker
* *
* @var string * @var string
*/ */
const VERSION = '4.0.41'; const VERSION = '4.0.42';
/** /**
* Status starting. * Status starting.
@ -196,6 +196,13 @@ class Worker
*/ */
public $onWorkerReload = null; public $onWorkerReload = null;
/**
* Emitted when worker processes exited.
*
* @var callable
*/
public $onWorkerExit = null;
/** /**
* Transport layer protocol. * Transport layer protocol.
* *
@ -1680,7 +1687,18 @@ class Worker
$worker = static::$_workers[$worker_id]; $worker = static::$_workers[$worker_id];
// Exit status. // Exit status.
if ($status !== 0) { 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. // For Statistics.

View File

@ -1,3 +1,15 @@
## v3.1.10
### added
- feat: 支付宝周期扣款签约接口(#644)
## v3.1.9
### fixed
- fix: 微信服务商模式预下单存在子商户appid时invoke 时也应该为子商户 appid (#638)
## v3.1.8 ## v3.1.8
### fixed ### fixed

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Data;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/02fkbl
*/
class BillDownloadUrlQueryPlugin extends GeneralPlugin class BillDownloadUrlQueryPlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
use Yansongda\Pay\Logger; use Yansongda\Pay\Logger;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
/**
* @see https://opendocs.alipay.com/open/029p6g
*/
class BillEreceiptApplyPlugin implements PluginInterface class BillEreceiptApplyPlugin implements PluginInterface
{ {
public function assembly(Rocket $rocket, Closure $next): Rocket public function assembly(Rocket $rocket, Closure $next): Rocket

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Data;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/029i7e
*/
class BillEreceiptQueryPlugin extends GeneralPlugin class BillEreceiptQueryPlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Ebpp;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/02hd36
*/
class PdeductBillStatusPlugin extends GeneralPlugin class PdeductBillStatusPlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
use Yansongda\Pay\Logger; use Yansongda\Pay\Logger;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
/**
* @see https://opendocs.alipay.com/open/02hd35
*/
class PdeductPayPlugin implements PluginInterface class PdeductPayPlugin implements PluginInterface
{ {
public function assembly(Rocket $rocket, Closure $next): Rocket public function assembly(Rocket $rocket, Closure $next): Rocket

View File

@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
use Yansongda\Pay\Logger; use Yansongda\Pay\Logger;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
/**
* @see https://opendocs.alipay.com/open/02hd33
*/
class PdeductSignAddPlugin implements PluginInterface class PdeductSignAddPlugin implements PluginInterface
{ {
public function assembly(Rocket $rocket, Closure $next): Rocket public function assembly(Rocket $rocket, Closure $next): Rocket

View File

@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
use Yansongda\Pay\Logger; use Yansongda\Pay\Logger;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
/**
* @see https://opendocs.alipay.com/open/02hd34
*/
class PdeductSignCancelPlugin implements PluginInterface class PdeductSignCancelPlugin implements PluginInterface
{ {
public function assembly(Rocket $rocket, Closure $next): Rocket public function assembly(Rocket $rocket, Closure $next): Rocket

View File

@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
use Yansongda\Pay\Logger; use Yansongda\Pay\Logger;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
/**
* @see https://opendocs.alipay.com/open/02byuq?scene=common
*/
class AccountQueryPlugin implements PluginInterface class AccountQueryPlugin implements PluginInterface
{ {
public function assembly(Rocket $rocket, Closure $next): Rocket public function assembly(Rocket $rocket, Closure $next): Rocket

View File

@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
use Yansongda\Pay\Logger; use Yansongda\Pay\Logger;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
/**
* @see https://opendocs.alipay.com/open/02fkb9
*/
class AuthOrderFreezePlugin implements PluginInterface class AuthOrderFreezePlugin implements PluginInterface
{ {
public function assembly(Rocket $rocket, Closure $next): Rocket public function assembly(Rocket $rocket, Closure $next): Rocket

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Fund;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/02fkbc
*/
class AuthOrderUnfreezePlugin extends GeneralPlugin class AuthOrderUnfreezePlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Fund;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/02byve
*/
class TransCommonQueryPlugin extends GeneralPlugin class TransCommonQueryPlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -6,6 +6,12 @@ namespace Yansongda\Pay\Plugin\Alipay\Fund;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* 老版本转账.
*
* @deprecated
* @see https://opendocs.alipay.com/support/01rfzo
*/
class TransOrderQueryPlugin extends GeneralPlugin class TransOrderQueryPlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -10,6 +10,9 @@ use Yansongda\Pay\Logger;
use Yansongda\Pay\Parser\ResponseParser; use Yansongda\Pay\Parser\ResponseParser;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
/**
* @see https://opendocs.alipay.com/open/03rbye
*/
class TransPagePayPlugin implements PluginInterface class TransPagePayPlugin implements PluginInterface
{ {
public function assembly(Rocket $rocket, Closure $next): Rocket public function assembly(Rocket $rocket, Closure $next): Rocket

View File

@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
use Yansongda\Pay\Logger; use Yansongda\Pay\Logger;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
/**
* @see https://opendocs.alipay.com/open/02byuo?scene=common
*/
class TransUniTransferPlugin implements PluginInterface class TransUniTransferPlugin implements PluginInterface
{ {
public function assembly(Rocket $rocket, Closure $next): Rocket public function assembly(Rocket $rocket, Closure $next): Rocket

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Tools;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/isv/03l9c0
*/
class OpenAuthTokenAppPlugin extends GeneralPlugin class OpenAuthTokenAppPlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Tools;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/isv/03l8ca
*/
class OpenAuthTokenAppQueryPlugin extends GeneralPlugin class OpenAuthTokenAppQueryPlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -7,6 +7,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Tools;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
/**
* @see https://opendocs.alipay.com/open/02ailc
*/
class SystemOauthTokenPlugin extends GeneralPlugin class SystemOauthTokenPlugin extends GeneralPlugin
{ {
protected function doSomethingBefore(Rocket $rocket): void protected function doSomethingBefore(Rocket $rocket): void

View File

@ -11,6 +11,9 @@ use Yansongda\Pay\Parser\ResponseParser;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
use Yansongda\Pay\Traits\SupportServiceProviderTrait; use Yansongda\Pay\Traits\SupportServiceProviderTrait;
/**
* @see https://opendocs.alipay.com/open/02e7gq?scene=common
*/
class AppPayPlugin implements PluginInterface class AppPayPlugin implements PluginInterface
{ {
use SupportServiceProviderTrait; use SupportServiceProviderTrait;

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/02ekfi
*/
class CancelPlugin extends GeneralPlugin class CancelPlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/02o6e7
*/
class ClosePlugin extends GeneralPlugin class ClosePlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/02ekfj
*/
class CreatePlugin extends GeneralPlugin class CreatePlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/028sma
*/
class FastRefundQueryPlugin extends GeneralPlugin class FastRefundQueryPlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/028xqz
*/
class OrderSettlePlugin extends GeneralPlugin class OrderSettlePlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -11,6 +11,9 @@ use Yansongda\Pay\Parser\ResponseParser;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
use Yansongda\Pay\Traits\SupportServiceProviderTrait; use Yansongda\Pay\Traits\SupportServiceProviderTrait;
/**
* @see https://opendocs.alipay.com/open/028r8t?scene=22
*/
class PagePayPlugin implements PluginInterface class PagePayPlugin implements PluginInterface
{ {
use SupportServiceProviderTrait; use SupportServiceProviderTrait;

View File

@ -10,6 +10,9 @@ use Yansongda\Pay\Logger;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
use Yansongda\Pay\Traits\SupportServiceProviderTrait; use Yansongda\Pay\Traits\SupportServiceProviderTrait;
/**
* @see https://opendocs.alipay.com/open/02fkat?ref=api&scene=common
*/
class PayPlugin implements PluginInterface class PayPlugin implements PluginInterface
{ {
use SupportServiceProviderTrait; use SupportServiceProviderTrait;

View File

@ -8,6 +8,9 @@ use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
use Yansongda\Pay\Traits\SupportServiceProviderTrait; use Yansongda\Pay\Traits\SupportServiceProviderTrait;
/**
* @see https://opendocs.alipay.com/open/02ekfg?scene=common
*/
class PreCreatePlugin extends GeneralPlugin class PreCreatePlugin extends GeneralPlugin
{ {
use SupportServiceProviderTrait; use SupportServiceProviderTrait;

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/02ekfh?scene=common
*/
class QueryPlugin extends GeneralPlugin class QueryPlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -6,6 +6,9 @@ namespace Yansongda\Pay\Plugin\Alipay\Trade;
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin; use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
/**
* @see https://opendocs.alipay.com/open/02ekfk
*/
class RefundPlugin extends GeneralPlugin class RefundPlugin extends GeneralPlugin
{ {
protected function getMethod(): string protected function getMethod(): string

View File

@ -11,6 +11,9 @@ use Yansongda\Pay\Parser\ResponseParser;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
use Yansongda\Pay\Traits\SupportServiceProviderTrait; use Yansongda\Pay\Traits\SupportServiceProviderTrait;
/**
* @see https://opendocs.alipay.com/open/02ivbs?scene=common
*/
class WapPayPlugin implements PluginInterface class WapPayPlugin implements PluginInterface
{ {
use SupportServiceProviderTrait; use SupportServiceProviderTrait;

View 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';
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View File

@ -9,6 +9,9 @@ use Yansongda\Pay\Contract\PluginInterface;
use Yansongda\Pay\Logger; use Yansongda\Pay\Logger;
use Yansongda\Pay\Rocket; use Yansongda\Pay\Rocket;
/**
* @see https://opendocs.alipay.com/open/02aild
*/
class InfoSharePlugin implements PluginInterface class InfoSharePlugin implements PluginInterface
{ {
public function assembly(Rocket $rocket, Closure $next): Rocket public function assembly(Rocket $rocket, Closure $next): Rocket

View File

@ -214,7 +214,8 @@
$(".layui-btn-container").children("button").each(function () { $(".layui-btn-container").children("button").each(function () {
numArr.push($(this).val()); //添加至数组 numArr.push($(this).val()); //添加至数组
}); });
tags = numArr.lenth ? "" : numArr.join(","); field.tags = numArr.lenth ? "" : numArr.join(",");
var index = layer.load(1); var index = layer.load(1);
$.ajax({ $.ajax({
type: "post", type: "post",
@ -306,7 +307,8 @@
} }
// 添加关键词button // 添加关键词button
function getTags(tags, flag) { function getTags(tags, flag)
{
if (tags == "") { if (tags == "") {
layer.msg("tag不能为空"); layer.msg("tag不能为空");
return false; return false;

View File

@ -1,10 +1,16 @@
{extend name="public/base" /} {extend name="public/base" /}
{block name="title"}{$Request.param.ename|getCateName}-{$sysInfo.webname}{/block} {block name="title"}{$cateinfo.catename} - {$sysInfo.webname}{/block}
{block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block} {block name="keywords"}{$cateinfo.catename},{$sysInfo.webname}{/block}
{block name="description"}{$Request.param.ename|getCateDesc}{/block} {block name="description"}{$cateinfo.desc}{/block}
{block name="ogtitle"}<meta property="og:title" content="{$Request.param.ename|getCateName}-{$sysInfo.webname}">{/block} {block name="ogtitle"}<meta property="og:title" content="{$cateinfo.catename} - {$sysInfo.webname}">{/block}
{block name="ogdescription"}<meta property="og:description" content="{$Request.param.ename|getCateDesc}" />{/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="column"}{include file="/public/column" /}{/block}
{block name="content"} {block name="content"}

View File

@ -1,10 +1,11 @@
{extend name="public/base" /} {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="keywords"}{$article.tags ?: $article.title}{/block}
{block name="description"}{$article.title},{$article.description ?? ''}{/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="ogdescription"}<meta property="og:description" content="{$article.title},{$article.description ?? ''}" />{/block}
{block name="meta"} {block name="meta"}
<meta property="og:type" content="article"/>
<meta property="article:published_time" content="{$article.create_time|date='c'}"/> <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:published_time" content="{$article.create_time|date='c'}" />
<meta property="bytedance:lrDate_time" content="{$lrDate_time|date='c'}" /> <meta property="bytedance:lrDate_time" content="{$lrDate_time|date='c'}" />
@ -166,45 +167,16 @@
</div> </div>
{/if} {/if}
</div> </div>
{//crud管理模块}
{//帖子管理} {include file="/public/crud" /}
{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}
</div> </div>
<!--底部栏--> <!--底部栏-->
<div class="site-tree-mobile-detail-bottom layui-hide-md"> <div class="site-tree-mobile-detail-bottom layui-hide-md">
<div id="LAY_jieAdmin1" data-id="{$article['id']}"></div> <div id="LAY_jieAdmin1" data-id="{$article['id']}"></div>
</div> </div>
</div> </div>
{include file="public/menu" /} {/block} {include file="public/menu" /}
{/block}
{block name="script"} {block name="script"}
{:hook('taonyeditor')} {:hook('taonyeditor')}
<script> <script>
@ -369,93 +341,11 @@
plyr.setup(); plyr.setup();
}); });
</script> </script>
{//图片点击放大}
{include file="/public/images-click" /}
{:hook('markdownhook')}
{include file="/public/qr-read" /}
{volist name="push_js" id="vo"} {$vo.jscode|raw} {/volist}
{/block}
// 点击图片放大
<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>
{: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>

View File

@ -195,11 +195,11 @@
$('.layui-btn-container').children('button').each(function(){ $('.layui-btn-container').children('button').each(function(){
numArr.push($(this).val());//添加至数组 numArr.push($(this).val());//添加至数组
}); });
tags = numArr.lenth ? '' : numArr.join(','); field.tags = numArr.lenth ? '' : numArr.join(',');
$.ajax({ $.ajax({
type:"post", type:"post",
url:"{:url('article/edit')}", 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", daType:"json",
success:function (data){ success:function (data){
if (data.code == 0) { if (data.code == 0) {

View File

@ -1,9 +1,15 @@
{extend name="public/base" /} {extend name="public/base" /}
{block name="title"}{$Request.param.ename|getCateName}-{$sysInfo.webname}{/block} {block name="title"}{$cateinfo.catename} - {$sysInfo.webname}{/block}
{block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block} {block name="keywords"}{$cateinfo.catename},{$sysInfo.webname}{/block}
{block name="description"}{$Request.param.ename|getCateDesc}{/block} {block name="description"}{$cateinfo.desc}{/block}
{block name="ogtitle"}<meta property="og:title" content="{$Request.param.ename|getCateName}-{$sysInfo.webname}">{/block} {block name="ogtitle"}<meta property="og:title" content="{$cateinfo.catename} - {$sysInfo.webname}">{/block}
{block name="ogdescription"}<meta property="og:description" content="{$Request.param.ename|getCateDesc}" />{/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="column"}{include file="/public/column" /}{/block}
{block name="content"} {block name="content"}

View File

@ -1,10 +1,11 @@
{extend name="public/base" /} {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="keywords"}{$article.tags ?: $article.title}{/block}
{block name="description"}{$article.title},{$article.description ?? ''}{/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="ogdescription"}<meta property="og:description" content="{$article.title},{$article.description ?? ''}" />{/block}
{block name="meta"} {block name="meta"}
<meta property="og:type" content="article"/>
<meta property="article:published_time" content="{$article.create_time|date='c'}"/> <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:published_time" content="{$article.create_time|date='c'}" />
<meta property="bytedance:updated_time" content="{$article.update_time|date='c'}" /> <meta property="bytedance:updated_time" content="{$article.update_time|date='c'}" />
@ -45,38 +46,8 @@
</div> </div>
</div> </div>
</div> </div>
{//帖子管理} {//crud管理模块}
{if (($article.upzip !== '') || session('?user_name'))} {include file="/public/crud" /}
<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}
</div> </div>
<!--底部栏--> <!--底部栏-->
<div class="site-tree-mobile-detail-bottom layui-hide-md"> <div class="site-tree-mobile-detail-bottom layui-hide-md">
@ -230,61 +201,8 @@
}); });
</script> </script>
{//图片点击放大}
<script type="text/javascript"> {include file="/public/images-click" /}
// 点击图片放大
$(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>
{:hook('markdownhook')} {:hook('markdownhook')}
{volist name="push_js" id="vo"} {volist name="push_js" id="vo"}

View File

@ -1,10 +1,15 @@
{extend name="public/base" /} {extend name="public/base" /}
{block name="title"}{$cateinfo.catename} - {$sysInfo.webname}{/block}
{block name="title"}{$Request.param.ename|getCateName}-{$sysInfo.webname}{/block} {block name="keywords"}{$cateinfo.catename},{$sysInfo.webname}{/block}
{block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block} {block name="description"}{$cateinfo.desc}{/block}
{block name="description"}{$Request.param.ename|getCateDesc}{/block} {block name="ogtitle"}<meta property="og:title" content="{$cateinfo.catename} - {$sysInfo.webname}">{/block}
{block name="ogtitle"}<meta property="og:title" content="{$Request.param.ename|getCateName}-{$sysInfo.webname}">{/block} {block name="ogdescription"}<meta property="og:description" content="{$cateinfo.desc}" />{/block}
{block name="ogdescription"}<meta property="og:description" content="{$Request.param.ename|getCateDesc}" />{/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="column"}{include file="/public/column" /}{/block}
{block name="content"} {block name="content"}

View File

@ -1,10 +1,12 @@
{extend name="public/base" /} {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="keywords"}{$article.tags ?: $article.title}{/block}
{block name="description"}{$article.title},{$article.description}{/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="ogdescription"}<meta property="og:description" content="{$article.title},{$article.description ?? ''}" />{/block}
{block name="meta"} {block name="meta"}
<meta property="og:type" content="article"/>
<meta property="article:published_time" content="{$article.create_time|date='c'}"/> <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:published_time" content="{$article.create_time|date='c'}" />
<meta property="bytedance:lrDate_time" content="{$lrDate_time|date='c'}" /> <meta property="bytedance:lrDate_time" content="{$lrDate_time|date='c'}" />
@ -149,7 +151,7 @@
</a> </a>
</div> </div>
<div class="questions"> <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> <span class="layui-badge layui-bg-green">+ 关注</span>
</div> </div>
</div> </div>
@ -183,40 +185,8 @@
</div> </div>
{/if} {/if}
</div> </div>
{//crud管理模块}
{//管理} {include file="/public/crud" /}
{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}
</div> </div>
<!--底部栏--> <!--底部栏-->
<div class="site-tree-mobile-detail-bottom layui-hide-md"> <div class="site-tree-mobile-detail-bottom layui-hide-md">
@ -384,85 +354,10 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){
}); });
</script> </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;"> {include file="/public/images-click" /}
<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>
{:hook('markdownhook')} {:hook('markdownhook')}
{include file="/public/qr-read" /}
<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"} {volist name="push_js" id="vo"}
{$vo.jscode|raw} {$vo.jscode|raw}

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: TaoLer <alipay_tao@qq.com> * @Author: TaoLer <alipay_tao@qq.com>
* @Date: 2021-12-06 16:04:51 * @Date: 2021-12-06 16:04:51
* @LastEditTime: 2022-07-30 07:20:01 * @LastEditTime: 2022-08-10 16:50:38
* @LastEditors: TaoLer * @LastEditors: TaoLer
* @Description: 搜索引擎SEO优化设置 * @Description: 搜索引擎SEO优化设置
* @FilePath: \github\TaoLer\view\taoler\index\public\base.html * @FilePath: \github\TaoLer\view\taoler\index\public\base.html
@ -22,13 +22,14 @@
<meta name="keywords" content="{block name='keywords'}关键词{/block}" /> <meta name="keywords" content="{block name='keywords'}关键词{/block}" />
<meta name="description" content="{block name='description'}描述{/block}" /> <meta name="description" content="{block name='description'}描述{/block}" />
<meta name="Copyright" content="{$sysInfo.webname}" /> <meta name="Copyright" content="{$sysInfo.webname}" />
<meta property="og:type" content="article">
{block name="ogtitle"} {/block} {block name="ogtitle"} {/block}
{block name="ogdescription"} {/block} {block name="ogdescription"} {/block}
<meta property="og:url" content="{$Request.domain}{$Request.url}" /> <meta property="og:url" content="{$Request.domain}{$Request.url}" />
<meta property="og:site_name" content="{$sysInfo.webname}" /> <meta property="og:site_name" content="{$sysInfo.webname}" />
{block name="ogimage"} {/block} {block name="ogimage"} {/block}
{block name="meta"}{/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="canonical" href="{$Request.domain}{$Request.url}">
<link rel="stylesheet" href="{$Request.domain}/static/layui/css/layui.css" charset="utf-8"> <link rel="stylesheet" href="{$Request.domain}/static/layui/css/layui.css" charset="utf-8">
@ -43,7 +44,6 @@
html body{margin-top: 1px;} html body{margin-top: 1px;}
{/if} {/if}
</style> </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> <script src="{$Request.domain}/static/share/plusShare.js" type="text/javascript" charset="utf-8"></script>
</head> </head>
<body > <body >

View 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}

View 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>

View 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>