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

fix: 去掉了UUID4的库

parent fa266bfe
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
"symfony/cache": "^5.4", "symfony/cache": "^5.4",
"yosymfony/toml": "^1.0", "yosymfony/toml": "^1.0",
"guzzlehttp/guzzle": "^7.5", "guzzlehttp/guzzle": "^7.5",
"ramsey/uuid": "~3.8.0",
"ext-json": "*" "ext-json": "*"
}, },
"require-dev": { "require-dev": {
......
...@@ -14,9 +14,10 @@ class RequestIDMiddleware implements MiddlewareInterface ...@@ -14,9 +14,10 @@ class RequestIDMiddleware implements MiddlewareInterface
/** /**
* @param string|null $uuid * @param string|null $uuid
*/ */
public function __construct(string $uuid = null){ public function __construct(string $uuid = null)
{
if (!$uuid) { if (!$uuid) {
$uuid = substr(Uuid::uuid4()->toString(), 0, 8); $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