feat: add note module and route fixes
This commit is contained in:
@@ -33,9 +33,11 @@ class Auth
|
||||
return Response::error('令牌无效或已过期', 401);
|
||||
}
|
||||
|
||||
// 将用户信息注入请求
|
||||
$request->payload = $payload;
|
||||
$request->userid = $payload['userid'] ?? null;
|
||||
// 将用户信息写入请求中间件上下文,供控制器统一读取
|
||||
$request->withMiddleware([
|
||||
'payload' => $payload,
|
||||
'userid' => (int) ($payload['userid'] ?? 0),
|
||||
]);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user