Compare commits
2 Commits
9fc94bcd91
...
77932c8480
Author | SHA1 | Date | |
---|---|---|---|
77932c8480 | |||
4b1cd997ea |
app
@ -12,12 +12,7 @@ class IndexController
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
Log::channel('plugin.admin.default')->info('test');
|
||||
static $readme;
|
||||
if (!$readme) {
|
||||
$readme = file_get_contents(base_path('README.md'));
|
||||
}
|
||||
return $readme;
|
||||
return response()->file(public_path() . '/index.html');
|
||||
}
|
||||
|
||||
public function view(Request $request)
|
||||
|
@ -50,7 +50,8 @@ class JwtAuthMiddleware implements MiddlewareInterface
|
||||
}
|
||||
// 检查 token 是否为空
|
||||
if (empty($token)) {
|
||||
return ApiResponse::error(401, ['error' => '缺少令牌'], '未授权');
|
||||
// return ApiResponse::error(401, ['error' => '缺少令牌'], '未授权');
|
||||
return response('',401,['error' => '缺少令牌']);
|
||||
}
|
||||
// var_dump($token);
|
||||
|
||||
@ -66,7 +67,8 @@ class JwtAuthMiddleware implements MiddlewareInterface
|
||||
} catch (\Exception $e) {
|
||||
var_dump($e);
|
||||
// 解码失败,返回无效令牌错误
|
||||
return ApiResponse::error(401, ['error' => '无效的令牌'], '无效的令牌');
|
||||
// return ApiResponse::error(401, ['error' => '无效的令牌'], '无效的令牌');
|
||||
return response('',401,['error' => '无效的令牌']);
|
||||
}
|
||||
|
||||
// 将解码后的用户信息存储到请求对象的 user 属性中
|
||||
|
Loading…
x
Reference in New Issue
Block a user