mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update Plugs.php
This commit is contained in:
parent
ef342a7c9f
commit
597e2d0dc3
@ -37,6 +37,24 @@ class Plugs extends Controller
|
||||
$this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件上传参数
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function check()
|
||||
{
|
||||
$diff1 = explode(',', strtolower(input('exts')));
|
||||
$diff2 = explode(',', strtolower(sysconf('storage_local_exts')));
|
||||
$exts = array_intersect($diff1, $diff2);
|
||||
$this->success('获取文件上传参数', [
|
||||
'exts' => join('|', $exts),
|
||||
'mime' => File::mine($exts),
|
||||
'type' => $this->getUploadType(),
|
||||
'data' => $this->getUploadData(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台通用文件上传
|
||||
* @return \think\response\Json
|
||||
@ -69,24 +87,6 @@ class Plugs extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件上传参数
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function check()
|
||||
{
|
||||
$diff1 = explode(',', strtolower(input('exts')));
|
||||
$diff2 = explode(',', strtolower(sysconf('storage_local_exts')));
|
||||
$exts = array_intersect($diff1, $diff2);
|
||||
$this->success('获取文件上传参数', [
|
||||
'exts' => join('|', $exts),
|
||||
'mime' => File::mine($exts),
|
||||
'type' => $this->getUploadType(),
|
||||
'data' => $this->getUploadData(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成文件上传参数
|
||||
* @return array
|
||||
|
Loading…
x
Reference in New Issue
Block a user