Commit e4d0a1a3 authored by 谢宇轩's avatar 谢宇轩

fix: 调整RequestID Middleware

parent d62dd571
...@@ -12,11 +12,11 @@ class RequestIDMiddleware implements MiddlewareInterface ...@@ -12,11 +12,11 @@ class RequestIDMiddleware implements MiddlewareInterface
protected $uuid; protected $uuid;
/** /**
* @param string|null $uuid * @param string $uuid
*/ */
public function __construct(string $uuid = null) public function __construct(string $uuid = "")
{ {
if (!$uuid) { if (empty($uuid)) {
$uuid = sprintf('%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff)); $uuid = sprintf('%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff));
} }
$this->uuid = $uuid; $this->uuid = $uuid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment