This commit is contained in:
梁朝伟
2024-11-13 19:23:49 +08:00
commit 7f3db2ed48
461 changed files with 276684 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
<?php
namespace App\Http\Controllers;
abstract class Controller {}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class CreateClientTokenMiddlewire
{
public function handle(Request $request, \Closure $next): Response
{
$token = $this->createGuestToken($request);
$request->merge(['clientToken' => $token]);
return $next($request);
}
public function createGuestToken(Request $request)
{
return sha1($request->ip() . $request->header('User-Agent'));
}
}