perf: 补充优化

This commit is contained in:
kuaifan
2023-11-08 22:13:13 +08:00
parent e0fc1c5ef7
commit efe80ce0eb
22 changed files with 631 additions and 542 deletions

View File

@@ -77,6 +77,15 @@ class Base
});
}
/**
* 获取token
* @return mixed|string
*/
public static function token()
{
return Base::headerOrInput('dootask-token') ?: Base::headerOrInput('token');
}
/**
* 如果header没有则通过input读取
* @param $key
@@ -2882,13 +2891,13 @@ class Base
if ($name && !str_contains($name, '.')) {
$name .= ".";
}
//
//
if ($file instanceof \Closure) {
return Response::streamDownload($file, $name, [
'Content-Type' => $contentType,
]);
}
//
//
if (!$file instanceof File) {
if ($file instanceof \SplFileInfo) {
$file = new File($file->getPathname());