perf: 补充优化
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -51,7 +51,7 @@ class Doo
|
||||
char* pgpEncrypt(char* plainText, char* publicKey);
|
||||
char* pgpDecrypt(char* cipherText, char* privateKey, char* passphrase);
|
||||
EOF, "/usr/lib/doo/doo.so");
|
||||
$token = $token ?: Base::headerOrInput('dootask-token') ?: Base::headerOrInput('token');
|
||||
$token = $token ?: Base::token();
|
||||
$language = $language ?: Base::headerOrInput('language');
|
||||
self::$doo->initialize("/var/www", $token, $language);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user