优化多项

This commit is contained in:
tao 2022-04-17 17:05:20 +08:00
parent 76b90ab8b0
commit 9a3faa0bd3
46 changed files with 786 additions and 439 deletions

View File

@ -3,8 +3,8 @@
> TaoLer是一个简单迅捷的轻论坛系统适用于个人或组织区域型信息交流发布平台。
* 官网https://www.aieok.com
* 版本TaoLer 1.8.20
* 日期2022.1.7
* 版本TaoLer 1.9.0
* 日期2022.3.16
webman版新架构已适配90%
@ -140,6 +140,6 @@
本项目包含的第三方源码和二进制文件之版权信息另行标注。
版权所有Copyright © 2020-2021 by aieok.com (https://www.aieok.com)
版权所有Copyright © 2020-2022 by aieok.com (https://www.aieok.com)
All rights reserved。

View File

@ -237,6 +237,20 @@
</div>
<div class="layui-form-mid layui-word-aux">是否显示发件人所在地区简称</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">登录验证码:</label>
<div class="layui-input-inline" style="width: 30px;">
<input type="checkbox" name="login_captcha" lay-skin="primary" value=1 {if config('taoler.config.login_captcha') == 1} checked {/if}>
</div>
<div class="layui-form-mid layui-word-aux">勾选则验证</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发帖验证码:</label>
<div class="layui-input-inline" style="width: 30px;">
<input type="checkbox" name="post_captcha" lay-skin="primary" value=1 {if config('taoler.config.post_captcha') == 1} checked {/if}>
</div>
<div class="layui-form-mid layui-word-aux">勾选则验证</div>
</div>
<div class="layui-form-item">

View File

@ -7,8 +7,18 @@
*/
namespace app\common\lib;
class SetConf
{
protected string $str = '';
function __construct(string $fileName)
{
$this->file = $fileName;
$this->file = app()->getConfigPath() . $fileName . '.php';
$this->str = $str = file_get_contents($this->file); //加载配置文件
}
/**
* 修改配置
* @param string $file
@ -62,4 +72,79 @@ class SetConf
return json(['code'=>-1,'msg'=>'配置项错误!']);
}
}
// 修改配置
function editConfig($data)
{
if (is_array($data)){
foreach ($data as $key => $value)
{
// 多维数组
if (is_array($value)) {
$this->editConfig($value);
} else {
// 一维数组
if(is_int($value)){
// 数字类型
$pats = '/\'' . $key . '\'(.*?),/';
$reps = "'". $key. "'". " => " . "".$value .",";
} else {
// 字符类型
$pats = '/\'' . $key . '\'(.*?)\',/';
$reps = "'". $key. "'". " => " . "'".$value ."',";
}
$this->str = preg_replace($pats, $reps, $this->str); // 正则查找然后替换
}
}
try {
file_put_contents($this->file, $this->str); // 写入配置文件
}
catch (\Exception $e) {
// 这是进行异常捕获
echo $e->getMessage();
//return json(['code'=>-1,'msg'=> $file . '无写入权限']);
}
}
return true;
}
/* 删除配置
*
*/
function del(array $arr)
{
if (is_array($arr)){
foreach ($arr as $key => $value)
{
// 递归删除key
if (is_array($value)) {
$this->del($value);
} else {
// 正则查找然后替换
$pats = '/\s?\'' . $value . '\'(.*?)\r\n/';
$this->str = preg_replace($pats, '', $this->str);
}
/* 匹配空数组
* 'key' => [
* ],
*/
$pats = '/\s?\'\w+\'\s*\=\>\s*\[\s*\]{1}\S*\,?\s$/m';
$this->str = preg_replace($pats, '', $this->str);
}
//写入配置
file_put_contents($this->file, $this->str); // 写入配置文件
}
return true;
}
}

View File

@ -15,6 +15,6 @@ class Article extends Validate
public function sceneArtadd()
{
return $this->only(['cate_id','title','content','captcha']);
return $this->only(['cate_id','title','content']);
}
}

View File

@ -22,20 +22,20 @@ class User extends Validate
//邮件邮件码验证
public function sceneCode()
{
return $this->only(['code',]);
return $this->only(['code']);
}
//name登陆验证场景
public function sceneLoginName()
{
return $this->only(['name','password','captcha'])
return $this->only(['name','password'])
->remove('name', 'unique');
}
//emai登陆验证场景
public function sceneLoginEmail()
{
return $this->only(['email','password','captcha'])
return $this->only(['email','password'])
->remove('email', 'unique');
}

View File

@ -156,6 +156,15 @@ class Article extends BaseController
{
if (Request::isAjax()) {
$data = Request::only(['cate_id', 'title', 'title_color', 'user_id', 'content', 'upzip', 'tags', 'captcha']);
// 验证码
if(Config::get('taoler.config.post_captcha') == 1)
{
if(!captcha_check($data['captcha'])){ // 验证失败
return json(['code'=>-1,'msg'=> '验证码失败']);
};
}
$validate = new \app\common\validate\Article; //调用验证器
$result = $validate->scene('Artadd')->check($data); //进行数据验证
if (true !== $result) {
@ -202,6 +211,15 @@ class Article extends BaseController
//编辑
if(Request::isAjax()){
$data = Request::only(['id','cate_id','title','title_color','user_id','content','upzip','tags','captcha']);
// 验证码
if(Config::get('taoler.config.post_captcha') == 1)
{
if(!captcha_check($data['captcha'])){ // 验证失败
return json(['code'=>-1,'msg'=> '验证码失败']);
};
}
$validate = new \app\common\validate\Article(); //调用验证器
$res = $validate->scene('Artadd')->check($data); //进行数据验证

View File

@ -9,6 +9,7 @@ use think\facade\Db;
use app\facade\Article;
use app\common\model\Slider;
use app\common\lib\Msgres;
use app\common\lib\SetConf;
class Index extends BaseController
{
@ -20,7 +21,7 @@ class Index extends BaseController
* @throws \think\db\exception\ModelNotFoundException
*/
public function index()
{
{
$types = input('type');
//幻灯

View File

@ -42,9 +42,18 @@ class Login extends BaseController
//$url = substr($refer,strlen($domain));
Cookie::set('url',$refer);
if(Request::isAjax()) {
//登陆前数据校验
$data = Request::param();
if(Config::get('taoler.config.login_captcha') == 1)
{
//先校验验证码
if(!captcha_check($data['captcha'])){
// 验证失败
return json(['code'=>-1,'msg'=> '验证码失败']);
};
}
//邮箱正则表达式
$pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
//判断输入的是邮箱还是用户名

View File

@ -46,7 +46,10 @@
]
},
"config": {
"preferred-install": "dist"
"preferred-install": "dist",
"allow-plugins": {
"topthink/think-installer": true
}
},
"scripts": {
"post-autoload-dump": [

298
composer.lock generated
View File

@ -18,13 +18,7 @@
"type": "zip",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/83b609028194aa042ea33b5af2d41a7427de80e6",
"reference": "83b609028194aa042ea33b5af2d41a7427de80e6",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.3.0"
@ -81,13 +75,7 @@
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/094defdb4a7001845300334e7c1ee2335925ef99",
"reference": "094defdb4a7001845300334e7c1ee2335925ef99",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
@ -181,13 +169,7 @@
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff",
"reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"league/flysystem": "~1.0",
@ -238,13 +220,7 @@
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/aa70e813a6ad3d1558fc927863d47309b4c23e69",
"reference": "aa70e813a6ad3d1558fc927863d47309b4c23e69",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
@ -300,13 +276,7 @@
"type": "zip",
"url": "https://api.github.com/repos/liliuwei/thinkphp-social/zipball/2067fc2c2cc3b3d109602bc19c3e5a99c5f4c970",
"reference": "2067fc2c2cc3b3d109602bc19c3e5a99c5f4c970",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.6.0",
@ -381,13 +351,7 @@
"type": "zip",
"url": "https://api.github.com/repos/lotofbadcode/phpspirit_databackup/zipball/2627b2e4206031731c94c8d637fb06b3b96e8860",
"reference": "2627b2e4206031731c94c8d637fb06b3b96e8860",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.0"
@ -421,23 +385,17 @@
},
{
"name": "phpmailer/phpmailer",
"version": "v6.5.4",
"version": "v6.6.0",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "c0d9f7dd3c2aa247ca44791e9209233829d82285"
"reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c0d9f7dd3c2aa247ca44791e9209233829d82285",
"reference": "c0d9f7dd3c2aa247ca44791e9209233829d82285",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e43bac82edc26ca04b36143a48bde1c051cfd5b1",
"reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1",
"shasum": ""
},
"require": {
"ext-ctype": "*",
@ -493,7 +451,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.4"
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.0"
},
"funding": [
{
@ -501,7 +459,7 @@
"type": "github"
}
],
"time": "2022-02-17T08:19:04+00:00"
"time": "2022-02-28T15:31:21+00:00"
},
{
"name": "psr/cache",
@ -515,13 +473,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.3.0"
@ -570,13 +522,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.4.0"
@ -624,13 +570,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.3.0"
@ -683,13 +623,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.3.0"
@ -739,13 +673,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.3.0"
@ -796,13 +724,7 @@
"type": "zip",
"url": "https://api.github.com/repos/taoser/think-addons/zipball/bd8b0bfa4543fe8d2da65355c134250f78c0d457",
"reference": "bd8b0bfa4543fe8d2da65355c134250f78c0d457",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -858,13 +780,7 @@
"type": "zip",
"url": "https://api.github.com/repos/taoser/think-auth/zipball/19bb04e4fb957a95ff3fdc142939922c19167b43",
"reference": "19bb04e4fb957a95ff3fdc142939922c19167b43",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -917,13 +833,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/framework/zipball/e478316ac843c1a884a3b3a7a94db17c4001ff5c",
"reference": "e478316ac843c1a884a3b3a7a94db17c4001ff5c",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"ext-json": "*",
@ -990,13 +900,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-captcha/zipball/db5be361d3cd664d236fb95d5dffe93a117283ad",
"reference": "db5be361d3cd664d236fb95d5dffe93a117283ad",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"topthink/framework": "^6.0.0"
@ -1013,12 +917,12 @@
}
},
"autoload": {
"psr-4": {
"think\\captcha\\": "src/"
},
"files": [
"src/helper.php"
]
],
"psr-4": {
"think\\captcha\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -1049,13 +953,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-helper/zipball/769acbe50a4274327162f9c68ec2e89a38eb2aff",
"reference": "769acbe50a4274327162f9c68ec2e89a38eb2aff",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0"
@ -1065,12 +963,12 @@
},
"type": "library",
"autoload": {
"psr-4": {
"think\\": "src"
},
"files": [
"src/helper.php"
]
],
"psr-4": {
"think\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -1101,13 +999,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-installer/zipball/38ba647706e35d6704b5d370c06f8a160b635f88",
"reference": "38ba647706e35d6704b5d370c06f8a160b635f88",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0||^2.0"
@ -1152,13 +1044,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-multi-app/zipball/ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3",
"reference": "ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -1196,23 +1082,17 @@
},
{
"name": "topthink/think-orm",
"version": "v2.0.52",
"version": "v2.0.53",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-orm.git",
"reference": "407a60658f37fc57422ab95a9922c6f69af90f46"
"reference": "06783eda65547a70ea686360a897759e1f873fff"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-orm/zipball/407a60658f37fc57422ab95a9922c6f69af90f46",
"reference": "407a60658f37fc57422ab95a9922c6f69af90f46",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/top-think/think-orm/zipball/06783eda65547a70ea686360a897759e1f873fff",
"reference": "06783eda65547a70ea686360a897759e1f873fff",
"shasum": ""
},
"require": {
"ext-json": "*",
@ -1251,9 +1131,9 @@
],
"support": {
"issues": "https://github.com/top-think/think-orm/issues",
"source": "https://github.com/top-think/think-orm/tree/v2.0.52"
"source": "https://github.com/top-think/think-orm/tree/v2.0.53"
},
"time": "2022-01-25T06:00:05+00:00"
"time": "2022-02-28T14:54:22+00:00"
},
{
"name": "topthink/think-template",
@ -1267,13 +1147,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-template/zipball/abfc293f74f9ef5127b5c416310a01fe42e59368",
"reference": "abfc293f74f9ef5127b5c416310a01fe42e59368",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -1314,13 +1188,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-view/zipball/edce0ae2c9551ab65f9e94a222604b0dead3576d",
"reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -1361,13 +1229,7 @@
"type": "zip",
"url": "https://api.github.com/repos/wamkj/thinkphp6.0-databackup/zipball/28a0e406d827132942723a3c9f69bb20c98e652f",
"reference": "28a0e406d827132942723a3c9f69bb20c98e652f",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -1404,7 +1266,7 @@
"packages-dev": [
{
"name": "symfony/polyfill-mbstring",
"version": "v1.24.0",
"version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
@ -1414,13 +1276,7 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
"reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1"
@ -1473,7 +1329,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0"
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0"
},
"funding": [
{
@ -1493,7 +1349,7 @@
},
{
"name": "symfony/polyfill-php72",
"version": "v1.24.0",
"version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
@ -1503,13 +1359,7 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976",
"reference": "9a142215a36a3888e30d0a9eeea9766764e96976",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1"
@ -1555,7 +1405,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0"
"source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0"
},
"funding": [
{
@ -1575,23 +1425,17 @@
},
{
"name": "symfony/polyfill-php80",
"version": "v1.24.0",
"version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "57b712b08eddb97c762a8caa32c84e037892d2e9"
"reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9",
"reference": "57b712b08eddb97c762a8caa32c84e037892d2e9",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c",
"reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c",
"shasum": ""
},
"require": {
"php": ">=7.1"
@ -1644,7 +1488,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0"
"source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0"
},
"funding": [
{
@ -1660,27 +1504,21 @@
"type": "tidelift"
}
],
"time": "2021-09-13T13:58:33+00:00"
"time": "2022-03-04T08:16:47+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v4.4.37",
"version": "v4.4.39",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "e74eee4ec02de71db3d60151aa5b203c990556df"
"reference": "35237c5e5dcb6593a46a860ba5b29c1d4683d80e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/e74eee4ec02de71db3d60151aa5b203c990556df",
"reference": "e74eee4ec02de71db3d60151aa5b203c990556df",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/35237c5e5dcb6593a46a860ba5b29c1d4683d80e",
"reference": "35237c5e5dcb6593a46a860ba5b29c1d4683d80e",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
@ -1739,7 +1577,7 @@
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v4.4.37"
"source": "https://github.com/symfony/var-dumper/tree/v4.4.39"
},
"funding": [
{
@ -1755,7 +1593,7 @@
"type": "tidelift"
}
],
"time": "2022-01-02T09:41:36+00:00"
"time": "2022-02-25T10:38:15+00:00"
},
{
"name": "topthink/think-trace",
@ -1769,13 +1607,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-trace/zipball/9a9fa8f767b6c66c5a133ad21ca1bc96ad329444",
"reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -1824,5 +1656,5 @@
"php": ">=7.1.0"
},
"platform-dev": [],
"plugin-api-version": "2.1.0"
"plugin-api-version": "2.2.0"
}

View File

@ -7,7 +7,7 @@ return [
//应用名,此项不可更改
'appname' => 'TaoLer',
//版本配置
'version' => '1.8.22',
'version' => '1.9.0',
//加盐
'salt' => 'taoler',
//数据库备份目录
@ -20,8 +20,9 @@ return [
'regist_check' => 0,
'posts_check' => 0,
'commnets_check' => 0,
'login_captcha' => 0,
'post_captcha' => 0,
]
];

View File

@ -54,7 +54,7 @@ var compressImage = {
reader.readAsDataURL(file)
reader.onload = function (e) {
const img = new Image()
const quality = 0.4 // 图像质量
const quality = 0.8 // 图像质量
const canvas = document.createElement('canvas')
const drawer = canvas.getContext('2d')
img.src = this.result
@ -64,7 +64,7 @@ var compressImage = {
originHeight = img.height; /* 图片的高度 */
// 设置最大尺寸限制将所有图片都压缩到小于1m
const maxWidth = 1024, maxHeight = 1024;
const maxWidth = 2560, maxHeight = 1600;
// 需要压缩的目标尺寸
let targetWidth = originWidth, targetHeight = originHeight;
// 等比例计算超过最大限制时缩放后的图片尺寸

View File

@ -94,9 +94,10 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'],
//简易编辑器
,layEditor: function(options){
var html = ['<div class="layui-unselect fly-edit">'
,'<span type="strong" title="加粗"><i class="layui-icon layedit-tool-b layedit-tool-active" title="加粗" lay-command="Bold" layedit-event="b" "=""></i></span>'
,'<span type="face" title="表情"><i class="iconfont icon-yxj-expression" style="top: 1px;"></i></span>'
,'<span type="picture" title="图片img[src]"><i class="iconfont icon-tupian"></i></span>'
,'<span type="video" title="视频"><i class="layui-icon layui-icon-video"></i></span>'
,'<span type="video" title="视频"><i class="layui-icon layui-icon-video"></i></span>'
,'<span type="audio" title="音频"><i class="layui-icon layui-icon-headset"></i></span>'
,'<span type="href" title="超链接格式a(href)[text]"><i class="iconfont icon-lianjie"></i></span>'
,'<span type="quote" title="引用"><i class="iconfont icon-yinyong" style="top: 1px;"></i></span>'
@ -110,6 +111,16 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'],
};
var log = {}, mod = {
//加粗
strong: function(editor){
var str = window.getSelection().toString();
if(!str == ''){
//var strB = '<b>'+ str + '</b>';
layui.focusInsert(editor[0], '[strong] '+ str + '[/strong]');
//console.log(str);
// console.log(strB);
}
},
face: function(editor, self){ //插入表情
var str = '', ul, face = fly.faces;
for(var key in face){
@ -280,8 +291,8 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'],
,area: 'auto'
,shade: false
//,area: '465px'
,fixed: false
,offset: [
,fixed: false
,offset: [
editor.offset().top - $(window).scrollTop() + 'px'
,editor.offset().left + 'px'
]
@ -341,45 +352,45 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'],
//,field: 'image'
,size: 10240
,choose: function (obj) { //选择文件后的回调
imgcom.uploads(obj);
imgcom.uploads(obj);
}
,done: function(res){
if(res.status == 0){
cover.val(res.url);
} else {
layer.msg(res.msg, {icon: 5});
}
}
,done: function(res){
if(res.status == 0){
cover.val(res.url);
} else {
layer.msg(res.msg, {icon: 5});
}
}
,error: function(){
layer.msg('系统错误,请联系管理员');
}
});
form.on('submit(uploadImages)', function(data){
var field = data.field;
if(!field.video) return video.focus();
layui.focusInsert(editor[0], 'video('+field.cover+')['+ field.video + '] ');
layer.close(index);
});
}
});
});
form.on('submit(uploadImages)', function(data){
var field = data.field;
if(!field.video) return video.focus();
layui.focusInsert(editor[0], 'video('+field.cover+')['+ field.video + '] ');
layer.close(index);
});
}
});
}
,audio: function(editor){ //插入音频
//判断登陆
if(uid == -1){
layer.msg('请登录再发布', {icon: 6}, function(){
location.href = login;
})
return false;
}
//判断登陆
if(uid == -1){
layer.msg('请登录再发布', {icon: 6}, function(){
location.href = login;
})
return false;
}
layer.open({
type: 1
,id: 'fly-jie-audio-upload'
,title: '插入音频'
,area: 'auto'
,area: 'auto'
,shade: false
//,area: '465px'
,fixed: false
,offset: [
,fixed: false
,offset: [
editor.offset().top - $(window).scrollTop() + 'px'
,editor.offset().left + 'px'
]
@ -570,6 +581,12 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'],
.replace(/\n*\[\/quote\]\n*/g, '</div>');
})
//转义加粗
.replace(/\[strong\]([\s\S]*)\[\/strong\]\n*/g, function(str){
return str.replace(/\[strong\]\n*/g, '<b>')
.replace(/\n*\[\/strong\]\n*/g, '</b>');
})
//转义换行
.replace(/\n/g, '<br>')

View File

@ -4,15 +4,16 @@
/**
* Proxy PHP file generated by Composer
*
* This file includes the referenced bin path (../symfony/var-dumper/Resources/bin/var-dump-server) using ob_start to remove the shebang if present
* to prevent the shebang from being output on PHP<8
* This file includes the referenced bin path (../symfony/var-dumper/Resources/bin/var-dump-server)
* using a stream wrapper to prevent the shebang from being output on PHP<8
*
* @generated
*/
namespace Composer;
$binPath = __DIR__ . "/" . '../symfony/var-dumper/Resources/bin/var-dump-server';
$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
if (PHP_VERSION_ID < 80000) {
if (!class_exists('Composer\BinProxyWrapper')) {
@ -23,18 +24,17 @@ if (PHP_VERSION_ID < 80000) {
{
private $handle;
private $position;
private $realpath;
public function stream_open($path, $mode, $options, &$opened_path)
{
// get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution
$opened_path = substr($path, 21);
$opened_path = realpath($opened_path) ?: $opened_path;
$this->handle = fopen($opened_path, $mode);
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
$opened_path = substr($path, 17);
$this->realpath = realpath($opened_path) ?: $opened_path;
$opened_path = $this->realpath;
$this->handle = fopen($this->realpath, $mode);
$this->position = 0;
// remove all traces of this stream wrapper once it has been used
stream_wrapper_unregister('composer-bin-proxy');
return (bool) $this->handle;
}
@ -66,6 +66,16 @@ if (PHP_VERSION_ID < 80000) {
return $operation ? flock($this->handle, $operation) : true;
}
public function stream_seek($offset, $whence)
{
if (0 === fseek($this->handle, $offset, $whence)) {
$this->position = ftell($this->handle);
return true;
}
return false;
}
public function stream_tell()
{
return $this->position;
@ -78,20 +88,30 @@ if (PHP_VERSION_ID < 80000) {
public function stream_stat()
{
return fstat($this->handle);
return array();
}
public function stream_set_option($option, $arg1, $arg2)
{
return true;
}
public function url_stat($path, $flags)
{
$path = substr($path, 17);
if (file_exists($path)) {
return stat($path);
}
return false;
}
}
}
if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) {
include("composer-bin-proxy://" . $binPath);
if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server');
exit(0);
}
}
include $binPath;
include __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server';

View File

@ -1,4 +1,5 @@
@ECHO OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/../symfony/var-dumper/Resources/bin/var-dump-server
SET BIN_TARGET=%~dp0/var-dump-server
SET COMPOSER_RUNTIME_BIN_DIR=%~dp0
php "%BIN_TARGET%" %*

View File

@ -149,7 +149,7 @@ class ClassLoader
/**
* @return string[] Array of classname => path
* @psalm-var array<string, string>
* @psalm-return array<string, string>
*/
public function getClassMap()
{

View File

@ -8,6 +8,7 @@ $baseDir = dirname($vendorDir);
return array(
'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',

View File

@ -65,11 +65,16 @@ class ComposerAutoloaderInit1b32198725235c8d6500c87262ef30c2
}
}
/**
* @param string $fileIdentifier
* @param string $file
* @return void
*/
function composerRequire1b32198725235c8d6500c87262ef30c2($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}

View File

@ -12,8 +12,8 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
'223fa6f9b46fbe5d6b44c5ff847bfceb' => __DIR__ . '/..' . '/taoser/think-addons/src/helper.php',
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
'223fa6f9b46fbe5d6b44c5ff847bfceb' => __DIR__ . '/..' . '/taoser/think-addons/src/helper.php',
'1cfd2761b63b0a29ed23657ea394cb2d' => __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php',
'd421242fd42b2ea6cd13f802bcf18a6e' => __DIR__ . '/../..' . '/extend/taoler/com/form.php',
);
@ -101,10 +101,10 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
),
'think\\' =>
array (
0 => __DIR__ . '/..' . '/topthink/think-helper/src',
1 => __DIR__ . '/..' . '/topthink/think-template/src',
0 => __DIR__ . '/..' . '/topthink/framework/src/think',
1 => __DIR__ . '/..' . '/topthink/think-helper/src',
2 => __DIR__ . '/..' . '/topthink/think-orm/src',
3 => __DIR__ . '/..' . '/topthink/framework/src/think',
3 => __DIR__ . '/..' . '/topthink/think-template/src',
),
'taoser\\think\\' =>
array (
@ -191,6 +191,7 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
public static $classMap = array (
'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',

View File

@ -429,24 +429,18 @@
},
{
"name": "phpmailer/phpmailer",
"version": "v6.5.4",
"version_normalized": "6.5.4.0",
"version": "v6.6.0",
"version_normalized": "6.6.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "c0d9f7dd3c2aa247ca44791e9209233829d82285"
"reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c0d9f7dd3c2aa247ca44791e9209233829d82285",
"reference": "c0d9f7dd3c2aa247ca44791e9209233829d82285",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e43bac82edc26ca04b36143a48bde1c051cfd5b1",
"reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1",
"shasum": ""
},
"require": {
"ext-ctype": "*",
@ -472,7 +466,7 @@
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)"
},
"time": "2022-02-17T08:19:04+00:00",
"time": "2022-02-28T15:31:21+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -504,7 +498,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.4"
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.0"
},
"funding": [
{
@ -806,8 +800,8 @@
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.24.0",
"version_normalized": "1.24.0.0",
"version": "v1.25.0",
"version_normalized": "1.25.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
@ -817,13 +811,7 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
"reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1"
@ -847,12 +835,12 @@
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
],
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -878,7 +866,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0"
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0"
},
"funding": [
{
@ -898,8 +886,8 @@
},
{
"name": "symfony/polyfill-php72",
"version": "v1.24.0",
"version_normalized": "1.24.0.0",
"version": "v1.25.0",
"version_normalized": "1.25.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
@ -909,13 +897,7 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976",
"reference": "9a142215a36a3888e30d0a9eeea9766764e96976",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1"
@ -933,12 +915,12 @@
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php72\\": ""
},
"files": [
"bootstrap.php"
]
],
"psr-4": {
"Symfony\\Polyfill\\Php72\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -963,7 +945,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0"
"source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0"
},
"funding": [
{
@ -983,29 +965,23 @@
},
{
"name": "symfony/polyfill-php80",
"version": "v1.24.0",
"version_normalized": "1.24.0.0",
"version": "v1.25.0",
"version_normalized": "1.25.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "57b712b08eddb97c762a8caa32c84e037892d2e9"
"reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9",
"reference": "57b712b08eddb97c762a8caa32c84e037892d2e9",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c",
"reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"time": "2021-09-13T13:58:33+00:00",
"time": "2022-03-04T08:16:47+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -1018,12 +994,12 @@
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
},
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
},
"classmap": [
"Resources/stubs"
]
@ -1055,7 +1031,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0"
"source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0"
},
"funding": [
{
@ -1075,24 +1051,18 @@
},
{
"name": "symfony/var-dumper",
"version": "v4.4.37",
"version_normalized": "4.4.37.0",
"version": "v4.4.39",
"version_normalized": "4.4.39.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "e74eee4ec02de71db3d60151aa5b203c990556df"
"reference": "35237c5e5dcb6593a46a860ba5b29c1d4683d80e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/e74eee4ec02de71db3d60151aa5b203c990556df",
"reference": "e74eee4ec02de71db3d60151aa5b203c990556df",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/35237c5e5dcb6593a46a860ba5b29c1d4683d80e",
"reference": "35237c5e5dcb6593a46a860ba5b29c1d4683d80e",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
@ -1115,7 +1085,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-01-02T09:41:36+00:00",
"time": "2022-02-25T10:38:15+00:00",
"bin": [
"Resources/bin/var-dump-server"
],
@ -1153,7 +1123,7 @@
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v4.4.37"
"source": "https://github.com/symfony/var-dumper/tree/v4.4.39"
},
"funding": [
{
@ -1596,24 +1566,18 @@
},
{
"name": "topthink/think-orm",
"version": "v2.0.52",
"version_normalized": "2.0.52.0",
"version": "v2.0.53",
"version_normalized": "2.0.53.0",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-orm.git",
"reference": "407a60658f37fc57422ab95a9922c6f69af90f46"
"reference": "06783eda65547a70ea686360a897759e1f873fff"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-orm/zipball/407a60658f37fc57422ab95a9922c6f69af90f46",
"reference": "407a60658f37fc57422ab95a9922c6f69af90f46",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/top-think/think-orm/zipball/06783eda65547a70ea686360a897759e1f873fff",
"reference": "06783eda65547a70ea686360a897759e1f873fff",
"shasum": ""
},
"require": {
"ext-json": "*",
@ -1626,7 +1590,7 @@
"require-dev": {
"phpunit/phpunit": "^7|^8|^9.5"
},
"time": "2022-01-25T06:00:05+00:00",
"time": "2022-02-28T14:54:22+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -1654,7 +1618,7 @@
],
"support": {
"issues": "https://github.com/top-think/think-orm/issues",
"source": "https://github.com/top-think/think-orm/tree/v2.0.52"
"source": "https://github.com/top-think/think-orm/tree/v2.0.53"
},
"install-path": "../topthink/think-orm"
},

View File

@ -5,7 +5,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'e0b7efe3f2680ac9d7910e02abcd943b0cc226ec',
'reference' => 'c22383e6432ee0dc4992378dbd006d79492737b3',
'name' => 'taoser/taoler',
'dev' => true,
),
@ -65,12 +65,12 @@
'dev_requirement' => false,
),
'phpmailer/phpmailer' => array(
'pretty_version' => 'v6.5.4',
'version' => '6.5.4.0',
'pretty_version' => 'v6.6.0',
'version' => '6.6.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
'aliases' => array(),
'reference' => 'c0d9f7dd3c2aa247ca44791e9209233829d82285',
'reference' => 'e43bac82edc26ca04b36143a48bde1c051cfd5b1',
'dev_requirement' => false,
),
'psr/cache' => array(
@ -119,8 +119,8 @@
'dev_requirement' => false,
),
'symfony/polyfill-mbstring' => array(
'pretty_version' => 'v1.24.0',
'version' => '1.24.0.0',
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(),
@ -128,8 +128,8 @@
'dev_requirement' => true,
),
'symfony/polyfill-php72' => array(
'pretty_version' => 'v1.24.0',
'version' => '1.24.0.0',
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php72',
'aliases' => array(),
@ -137,21 +137,21 @@
'dev_requirement' => true,
),
'symfony/polyfill-php80' => array(
'pretty_version' => 'v1.24.0',
'version' => '1.24.0.0',
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(),
'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9',
'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c',
'dev_requirement' => true,
),
'symfony/var-dumper' => array(
'pretty_version' => 'v4.4.37',
'version' => '4.4.37.0',
'pretty_version' => 'v4.4.39',
'version' => '4.4.39.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/var-dumper',
'aliases' => array(),
'reference' => 'e74eee4ec02de71db3d60151aa5b203c990556df',
'reference' => '35237c5e5dcb6593a46a860ba5b29c1d4683d80e',
'dev_requirement' => true,
),
'taoser/taoler' => array(
@ -160,7 +160,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'e0b7efe3f2680ac9d7910e02abcd943b0cc226ec',
'reference' => 'c22383e6432ee0dc4992378dbd006d79492737b3',
'dev_requirement' => false,
),
'taoser/think-addons' => array(
@ -227,12 +227,12 @@
'dev_requirement' => false,
),
'topthink/think-orm' => array(
'pretty_version' => 'v2.0.52',
'version' => '2.0.52.0',
'pretty_version' => 'v2.0.53',
'version' => '2.0.53.0',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-orm',
'aliases' => array(),
'reference' => '407a60658f37fc57422ab95a9922c6f69af90f46',
'reference' => '06783eda65547a70ea686360a897759e1f873fff',
'dev_requirement' => false,
),
'topthink/think-template' => array(

View File

@ -1 +1 @@
6.5.4
6.6.0

View File

@ -33,7 +33,7 @@ use League\OAuth2\Client\Token\AccessToken;
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
*/
class OAuth
class OAuth implements OAuthTokenProvider
{
/**
* An instance of the League OAuth Client Provider.

View File

@ -0,0 +1,44 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
namespace PHPMailer\PHPMailer;
/**
* OAuthTokenProvider - OAuth2 token provider interface.
* Provides base64 encoded OAuth2 auth strings for SMTP authentication.
*
* @see OAuth
* @see SMTP::authenticate()
*
* @author Peter Scopes (pdscopes)
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
*/
interface OAuthTokenProvider
{
/**
* Generate a base64-encoded OAuth token ensuring that the access token has not expired.
* The string to be base 64 encoded should be in the form:
* "user=<user_email_address>\001auth=Bearer <access_token>\001\001"
*
* @return string
*/
public function getOauth64();
}

View File

@ -358,9 +358,9 @@ class PHPMailer
public $AuthType = '';
/**
* An instance of the PHPMailer OAuth class.
* An implementation of the PHPMailer OAuthTokenProvider interface.
*
* @var OAuth
* @var OAuthTokenProvider
*/
protected $oauth;
@ -750,7 +750,7 @@ class PHPMailer
*
* @var string
*/
const VERSION = '6.5.4';
const VERSION = '6.6.0';
/**
* Error severity: message only, continue processing.
@ -2161,7 +2161,8 @@ class PHPMailer
}
if ($tls) {
if (!$this->smtp->startTLS()) {
throw new Exception($this->lang('connect_host'));
$message = $this->getSmtpErrorMessage('connect_host');
throw new Exception($message);
}
//We must resend EHLO after TLS negotiation
$this->smtp->hello($hello);
@ -2191,6 +2192,10 @@ class PHPMailer
//As we've caught all exceptions, just report whatever the last one was
if ($this->exceptions && null !== $lastexception) {
throw $lastexception;
} elseif ($this->exceptions) {
// no exception was thrown, likely $this->smtp->connect() failed
$message = $this->getSmtpErrorMessage('connect_host');
throw new Exception($message);
}
return false;
@ -4127,6 +4132,26 @@ class PHPMailer
return $key;
}
/**
* Build an error message starting with a generic one and adding details if possible.
*
* @param string $base_key
* @return string
*/
private function getSmtpErrorMessage($base_key)
{
$message = $this->lang($base_key);
$error = $this->smtp->getError();
if (!empty($error['error'])) {
$message .= ' ' . $error['error'];
if (!empty($error['detail'])) {
$message .= ' ' . $error['detail'];
}
}
return $message;
}
/**
* Check if an error occurred.
*
@ -5027,9 +5052,9 @@ class PHPMailer
}
/**
* Get the OAuth instance.
* Get the OAuthTokenProvider instance.
*
* @return OAuth
* @return OAuthTokenProvider
*/
public function getOAuth()
{
@ -5037,9 +5062,9 @@ class PHPMailer
}
/**
* Set an OAuth instance.
* Set an OAuthTokenProvider instance.
*/
public function setOAuth(OAuth $oauth)
public function setOAuth(OAuthTokenProvider $oauth)
{
$this->oauth = $oauth;
}

View File

@ -46,7 +46,7 @@ class POP3
*
* @var string
*/
const VERSION = '6.5.4';
const VERSION = '6.6.0';
/**
* Default POP3 port number.

View File

@ -35,7 +35,7 @@ class SMTP
*
* @var string
*/
const VERSION = '6.5.4';
const VERSION = '6.6.0';
/**
* SMTP line break constant.
@ -483,7 +483,7 @@ class SMTP
* @param string $username The user name
* @param string $password The password
* @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2)
* @param OAuth $OAuth An optional OAuth instance for XOAUTH2 authentication
* @param OAuthTokenProvider $OAuth An optional OAuthTokenProvider instance for XOAUTH2 authentication
*
* @return bool True if successfully authenticated
*/

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2022-02-21 14:28:02
// This file is automatically generated at:2022-03-16 18:40:36
declare (strict_types = 1);
return array (
0 => 'taoser\\addons\\Service',

View File

@ -100,6 +100,16 @@ final class Php80
public static function str_ends_with(string $haystack, string $needle): bool
{
return '' === $needle || ('' !== $haystack && 0 === substr_compare($haystack, $needle, -\strlen($needle)));
if ('' === $needle || $needle === $haystack) {
return true;
}
if ('' === $haystack) {
return false;
}
$needleLength = \strlen($needle);
return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength);
}
}

View File

@ -0,0 +1,103 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Polyfill\Php80;
/**
* @author Fedonyuk Anton <info@ensostudio.ru>
*
* @internal
*/
class PhpToken implements \Stringable
{
/**
* @var int
*/
public $id;
/**
* @var string
*/
public $text;
/**
* @var int
*/
public $line;
/**
* @var int
*/
public $pos;
public function __construct(int $id, string $text, int $line = -1, int $position = -1)
{
$this->id = $id;
$this->text = $text;
$this->line = $line;
$this->pos = $position;
}
public function getTokenName(): ?string
{
if ('UNKNOWN' === $name = token_name($this->id)) {
$name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text;
}
return $name;
}
/**
* @param int|string|array $kind
*/
public function is($kind): bool
{
foreach ((array) $kind as $value) {
if (\in_array($value, [$this->id, $this->text], true)) {
return true;
}
}
return false;
}
public function isIgnorable(): bool
{
return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true);
}
public function __toString(): string
{
return (string) $this->text;
}
/**
* @return static[]
*/
public static function tokenize(string $code, int $flags = 0): array
{
$line = 1;
$position = 0;
$tokens = token_get_all($code, $flags);
foreach ($tokens as $index => $token) {
if (\is_string($token)) {
$id = \ord($token);
$text = $token;
} else {
[$id, $text, $line] = $token;
}
$tokens[$index] = new static($id, $text, $line, $position);
$position += \strlen($text);
}
return $tokens;
}
}

View File

@ -0,0 +1,7 @@
<?php
if (\PHP_VERSION_ID < 80000 && \extension_loaded('tokenizer')) {
class PhpToken extends Symfony\Polyfill\Php80\PhpToken
{
}
}

View File

@ -0,0 +1,33 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\VarDumper\Caster;
use Symfony\Component\VarDumper\Cloner\Stub;
/**
* @author Nicolas Grekas <p@tchwork.com>
*
* @internal
*/
final class MysqliCaster
{
public static function castMysqliDriver(\mysqli_driver $c, array $a, Stub $stub, bool $isNested): array
{
foreach ($a as $k => $v) {
if (isset($c->$k)) {
$a[$k] = $c->$k;
}
}
return $a;
}
}

View File

@ -144,6 +144,8 @@ abstract class AbstractCloner implements ClonerInterface
'Ds\Pair' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPair'],
'Symfony\Component\VarDumper\Caster\DsPairStub' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPairStub'],
'mysqli_driver' => ['Symfony\Component\VarDumper\Caster\MysqliCaster', 'castMysqliDriver'],
'CurlHandle' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'],
':curl' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'],

View File

@ -978,7 +978,7 @@ EOHTML
}
$this->lastDepth = $depth;
$this->line = mb_convert_encoding($this->line, 'HTML-ENTITIES', 'UTF-8');
$this->line = mb_encode_numericentity($this->line, [0x80, 0xFFFF, 0, 0xFFFF], 'UTF-8');
if (-1 === $depth) {
AbstractDumper::dumpLine(0);

View File

@ -350,7 +350,7 @@ abstract class BaseQuery
$field = array_merge((array) $this->options['field'], $field);
}
$this->options['field'] = array_unique($field);
$this->options['field'] = array_unique($field, SORT_REGULAR);
return $this;
}
@ -379,7 +379,7 @@ abstract class BaseQuery
$field = array_merge((array) $this->options['field'], $field);
}
$this->options['field'] = array_unique($field);
$this->options['field'] = array_unique($field, SORT_REGULAR);
return $this;
}
@ -424,7 +424,7 @@ abstract class BaseQuery
$field = array_merge((array) $this->options['field'], $field);
}
$this->options['field'] = array_unique($field);
$this->options['field'] = array_unique($field, SORT_REGULAR);
return $this;
}
@ -765,14 +765,15 @@ abstract class BaseQuery
}
/**
* 查询缓存
* 查询缓存 数据为空不缓存
* @access public
* @param mixed $key 缓存key
* @param integer|\DateTime $expire 缓存有效期
* @param string|array $tag 缓存标签
* @param bool $always 始终缓存
* @return $this
*/
public function cache($key = true, $expire = null, $tag = null)
public function cache($key = true, $expire = null, $tag = null, bool $always = false)
{
if (false === $key || !$this->getConnection()->getCache()) {
return $this;
@ -783,11 +784,25 @@ abstract class BaseQuery
$key = true;
}
$this->options['cache'] = [$key, $expire, $tag];
$this->options['cache'] = [$key, $expire, $tag];
$this->options['cache_always'] = $always;
return $this;
}
/**
* 查询缓存 允许缓存空数据
* @access public
* @param mixed $key 缓存key
* @param integer|\DateTime $expire 缓存有效期
* @param string|array $tag 缓存标签
* @return $this
*/
public function cacheAlways($key = true, $expire = null, $tag = null)
{
return $this->cache($key, $expire, $tag, true);
}
/**
* 指定查询lock
* @access public

View File

@ -703,6 +703,8 @@ abstract class Builder
// 比较运算
if ($value instanceof Closure) {
$value = $this->parseClosure($query, $value);
} elseif ($value instanceof Raw) {
$value = $this->parseRaw($query, $value);
}
if ('=' == $exp && is_null($value)) {

View File

@ -709,9 +709,10 @@ abstract class PDOConnection extends Connection
$this->getPDOStatement($sql, $bind, $master, $procedure);
$resultSet = $this->getResult($procedure);
$resultSet = $this->getResult($procedure);
$requireCache = $query->getOptions('cache_always') || !empty($resultSet);
if (isset($cacheItem) && $resultSet) {
if (isset($cacheItem) && $requireCache) {
// 缓存数据集
$cacheItem->set($resultSet);
$this->cacheData($cacheItem);

View File

@ -374,7 +374,9 @@ trait WhereQuery
} elseif ($field instanceof Closure) {
$where = $field;
} elseif (is_string($field)) {
if (preg_match('/[,=\<\'\"\(\s]/', $field)) {
if ($condition instanceof Raw) {
} elseif (preg_match('/[,=\<\'\"\(\s]/', $field)) {
return $this->whereRaw($field, is_array($op) ? $op : [], $logic);
} elseif (is_string($op) && strtolower($op) == 'exp' && !is_null($condition)) {
$bind = isset($param[2]) && is_array($param[2]) ? $param[2] : [];

View File

@ -18,6 +18,11 @@ use think\Paginator;
/**
* 模型数据集类
*
* @template TKey of array-key
* @template TModel of \think\Model
*
* @extends BaseCollection<TKey, TModel>
*/
class Collection extends BaseCollection
{
@ -184,8 +189,8 @@ class Collection extends BaseCollection
* 按指定键整理数据
*
* @access public
* @param mixed $items 数据
* @param string $indexKey 键名
* @param mixed $items 数据
* @param string|null $indexKey 键名
* @return array
*/
public function dictionary($items = null, string &$indexKey = null)
@ -211,8 +216,8 @@ class Collection extends BaseCollection
* 比较数据集,返回差集
*
* @access public
* @param mixed $items 数据
* @param string $indexKey 指定比较的键名
* @param mixed $items 数据
* @param string|null $indexKey 指定比较的键名
* @return static
*/
public function diff($items, string $indexKey = null)
@ -239,8 +244,8 @@ class Collection extends BaseCollection
* 比较数据集,返回交集
*
* @access public
* @param mixed $items 数据
* @param string $indexKey 指定比较的键名
* @param mixed $items 数据
* @param string|null $indexKey 指定比较的键名
* @return static
*/
public function intersect($items, string $indexKey = null)

View File

@ -215,11 +215,15 @@ abstract class Relation
/**
* 限制关联数据的字段
* @access public
* @param array $field 关联字段限制
* @param array|string $field 关联字段限制
* @return $this
*/
public function withField(array $field)
public function withField($field)
{
if (is_string($field)) {
$field = array_map('trim', explode(',', $field));
}
$this->withField = $field;
return $this;
}

View File

@ -15,6 +15,7 @@ namespace think\model\concern;
use InvalidArgumentException;
use think\db\Raw;
use think\helper\Str;
use think\Model;
use think\model\Relation;
/**
@ -382,7 +383,7 @@ trait Attribute
} elseif (isset($this->type[$name])) {
// 类型转换
$value = $this->writeTransform($value, $this->type[$name]);
} elseif (is_object($value) && method_exists($value, '__toString')) {
} elseif (array_key_exists($name, $this->origin) && is_object($value) && method_exists($value, '__toString')) {
// 对象类型
$value = $value->__toString();
}

View File

@ -112,6 +112,7 @@
<div class="layui-form-mid layui-word-aux">发表后无法更改飞吻</div>
</div>
</div-->
{if config('taoler.config.post_captcha') == 1}
<div class="layui-form-item">
<label for="L_vercode" class="layui-form-label">{:lang('captcha')}</label>
<div class="layui-input-inline">
@ -121,6 +122,7 @@
<span style="color: #c00;"><img id="captcha" src="{:captcha_src()}" onclick="this.src='{:captcha_src()}?'+Math.random();" style="float:left; cursor:pointer;" alt="captcha" /></span>
</div>
</div>
{/if}
<div class="layui-form-item">
<button type="submit" class="layui-btn" lay-filter="article-add" lay-submit id="add">{:lang('post now')}</button>
</div>

View File

@ -333,6 +333,64 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){
});
</script>
// 点击图片放大
<script type="text/javascript">
$(function(){
$(".photos").on("click","img",function(){
var _this = $(this);
console.log(_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')}
<script>

View File

@ -116,6 +116,7 @@
{/volist}
</div>
</div>
{if config('taoler.config.post_captcha') == 1}
<div class="layui-form-item">
<label for="L_vercode" class="layui-form-label">{:lang('captcha')}</label>
<div class="layui-input-inline">
@ -125,6 +126,7 @@
<span style="color: #c00;"><img id="captcha" src="{:captcha_src()}" onclick="this.src='{:captcha_src()}?'+Math.random();" style="float:left; cursor:pointer;" alt="captcha" /></span>
</div>
</div>
{/if}
<div class="layui-form-item">
<button type="submit" class="layui-btn" lay-filter="article-edit" lay-submit id="edit">{:lang('post now')}</button>
</div>

View File

@ -304,6 +304,63 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){
});
</script>
// 点击图片放大
<script type="text/javascript">
$(function(){
$(".photos").on("click","img",function(){
var _this = $(this);
console.log(_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')}
<script>

View File

@ -26,6 +26,7 @@
<input type="password" id="L_pass" name="password" required lay-verify="required" autocomplete="off" class="layui-input" placeholder="{:lang('please input the password')}">
</div>
</div>
{if config('taoler.config.login_captcha') == 1}
<div class="layui-form-item">
<label for="L_vercode" class="layui-form-label">{:lang('captcha')}</label>
<div class="layui-input-inline">
@ -35,7 +36,8 @@
<img src="{:captcha_src()}" style="float:left; cursor:pointer;" id="captcha" alt="captcha" />
</div>
</div>
<div class="layui-form-item">
{/if}
<div class="layui-form-item">
<input type="checkbox" name="remember" title="{:lang('remember password')}" lay-skin="primary" lay-filter="remember" value="1">
</div>
<div class="layui-form-item">