更新:文件上传最大执行时长修改为30秒内

master
zwesy 2020-12-18 17:19:24 +08:00
parent 99c065b27a
commit 5d1ad23b45
1 changed files with 7 additions and 3 deletions

View File

@ -17,6 +17,9 @@ class Upload extends BaseController
public function __construct()
{
ini_set("memory_limit",-1);
set_time_limit(30); // 默认限制30秒
$system = System::getSystem();
if (!empty($system)) {
$this->isCompress = $system['compress']??true;
@ -73,8 +76,8 @@ class Upload extends BaseController
//图片上传(通用)
public function image()
{
$image = request()->file('image');
{
$image = request()->file('image');
if($this->validate->checkImage($image)){
try{
if(!$this->uploadPathIsWritable){
@ -98,7 +101,9 @@ class Upload extends BaseController
}
return $this->json(0, 'ok', $return);
}else{
var_dump('xxximg');
$errorMsg = Lang::get($this->validate->getError());
var_dump('xxximg2');
return $this->json(1, $errorMsg);
}
}
@ -106,7 +111,6 @@ class Upload extends BaseController
//富文本编辑器商城图片
public function wangImage()
{
$imageArr = request()->file('wang_img'); // 该方式前端js上传方法中字段名称必须以数组形式传参 如 wang_img[] = 值
$errno = 0;
$data = [];