feat: new xboard

This commit is contained in:
xboard
2025-01-21 14:57:54 +08:00
parent de18cfe596
commit 0f43fff242
373 changed files with 17923 additions and 20264 deletions
+4 -6
View File
@@ -3,10 +3,9 @@
namespace App\Http\Middleware;
use App\Exceptions\ApiException;
use App\Utils\CacheKey;
use Closure;
use App\Models\User;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Auth;
class Client
{
@@ -19,7 +18,7 @@ class Client
*/
public function handle($request, Closure $next)
{
$token = $request->input('token');
$token = $request->input('token', $request->route('token'));
if (empty($token)) {
throw new ApiException('token is null',403);
}
@@ -27,9 +26,8 @@ class Client
if (!$user) {
throw new ApiException('token is error',403);
}
$request->merge([
'user' => $user
]);
Auth::setUser($user);
return $next($request);
}
}