修改考试设置表格
This commit is contained in:
1 parent
acd4180181
commit
a30ed5b256
146 files changed
+3216
-2782
No files matched your search
+1
-1
@@ -39,7 +39,7 @@ use think\initializer\RegisterService;
|
||||
*/
|
||||
class App extends Container
|
||||
{
|
||||
const VERSION = '6.0.1';
|
||||
const VERSION = '6.0.2';
|
||||
|
||||
/**
|
||||
* 应用调试模式
|
||||
|
||||
+7
-9
@@ -66,7 +66,7 @@ class Middleware
|
||||
{
|
||||
$middleware = $this->buildMiddleware($middleware, $type);
|
||||
|
||||
if ($middleware) {
|
||||
if (!empty($middleware)) {
|
||||
$this->queue[$type][] = $middleware;
|
||||
$this->queue[$type] = array_unique($this->queue[$type], SORT_REGULAR);
|
||||
}
|
||||
@@ -135,11 +135,11 @@ class Middleware
|
||||
return (new Pipeline())
|
||||
->through(array_map(function ($middleware) {
|
||||
return function ($request, $next) use ($middleware) {
|
||||
[$call, $param] = $middleware;
|
||||
[$call, $params] = $middleware;
|
||||
if (is_array($call) && is_string($call[0])) {
|
||||
$call = [$this->app->make($call[0]), $call[1]];
|
||||
}
|
||||
$response = call_user_func($call, $request, $next, $param);
|
||||
$response = call_user_func($call, $request, $next, ...$params);
|
||||
|
||||
if (!$response instanceof Response) {
|
||||
throw new LogicException('The middleware must return Response instance');
|
||||
@@ -182,9 +182,7 @@ class Middleware
|
||||
|
||||
$handler->report($e);
|
||||
|
||||
$response = $handler->render($passable, $e);
|
||||
|
||||
return $response;
|
||||
return $handler->render($passable, $e);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -197,11 +195,11 @@ class Middleware
|
||||
protected function buildMiddleware($middleware, string $type): array
|
||||
{
|
||||
if (is_array($middleware)) {
|
||||
[$middleware, $param] = $middleware;
|
||||
[$middleware, $params] = $middleware;
|
||||
}
|
||||
|
||||
if ($middleware instanceof Closure) {
|
||||
return [$middleware, $param ?? null];
|
||||
return [$middleware, $params ?? []];
|
||||
}
|
||||
|
||||
if (!is_string($middleware)) {
|
||||
@@ -220,7 +218,7 @@ class Middleware
|
||||
return [];
|
||||
}
|
||||
|
||||
return [[$middleware, 'handle'], $param ?? null];
|
||||
return [[$middleware, 'handle'], $params ?? []];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+16
-10
@@ -327,12 +327,14 @@ class Request
|
||||
}
|
||||
|
||||
$request->header = array_change_key_case($header);
|
||||
$request->server = $_SERVER;
|
||||
$request->env = $app->env;
|
||||
|
||||
$inputData = $request->getInputData($request->input);
|
||||
|
||||
$request->server = $_SERVER;
|
||||
$request->env = $app->env;
|
||||
$request->get = $_GET;
|
||||
$request->post = $_POST ?: $request->getInputData($request->input);
|
||||
$request->put = $request->getInputData($request->input);
|
||||
$request->post = $_POST ?: $inputData;
|
||||
$request->put = $inputData;
|
||||
$request->request = $_REQUEST;
|
||||
$request->cookie = $_COOKIE;
|
||||
$request->file = $_FILES ?? [];
|
||||
@@ -982,11 +984,12 @@ class Request
|
||||
|
||||
protected function getInputData($content): array
|
||||
{
|
||||
if (false !== strpos($this->contentType(), 'json')) {
|
||||
return (array) json_decode($content, true);
|
||||
} elseif (strpos($content, '=')) {
|
||||
$contentType = $this->contentType();
|
||||
if ($contentType == 'application/x-www-form-urlencoded') {
|
||||
parse_str($content, $data);
|
||||
return $data;
|
||||
} elseif (false !== strpos($contentType, 'json')) {
|
||||
return (array) json_decode($content, true);
|
||||
}
|
||||
|
||||
return [];
|
||||
@@ -2051,15 +2054,18 @@ class Request
|
||||
/**
|
||||
* 设置php://input数据
|
||||
* @access public
|
||||
* @param string $input RAW数据
|
||||
* @param string $input RAW数据
|
||||
* @return $this
|
||||
*/
|
||||
public function withInput(string $input)
|
||||
{
|
||||
$this->input = $input;
|
||||
if (!empty($input)) {
|
||||
$this->post = $this->getInputData($input);
|
||||
$this->put = $this->getInputData($input);
|
||||
$inputData = $this->getInputData($input);
|
||||
if (!empty($inputData)) {
|
||||
$this->post = $inputData;
|
||||
$this->put = $inputData;
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
Loaded 3 of 146 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user