Compare commits

..

No commits in common. "77932c84808575f916666cd8f625538ba73cea23" and "9fc94bcd9154acc50426ad95dfaad05901fe2b02" have entirely different histories.

2 changed files with 8 additions and 5 deletions

View File

@ -12,7 +12,12 @@ class IndexController
public function index(Request $request)
{
return response()->file(public_path() . '/index.html');
Log::channel('plugin.admin.default')->info('test');
static $readme;
if (!$readme) {
$readme = file_get_contents(base_path('README.md'));
}
return $readme;
}
public function view(Request $request)

View File

@ -50,8 +50,7 @@ class JwtAuthMiddleware implements MiddlewareInterface
}
// 检查 token 是否为空
if (empty($token)) {
// return ApiResponse::error(401, ['error' => '缺少令牌'], '未授权');
return response('',401,['error' => '缺少令牌']);
return ApiResponse::error(401, ['error' => '缺少令牌'], '未授权');
}
// var_dump($token);
@ -67,8 +66,7 @@ class JwtAuthMiddleware implements MiddlewareInterface
} catch (\Exception $e) {
var_dump($e);
// 解码失败,返回无效令牌错误
// return ApiResponse::error(401, ['error' => '无效的令牌'], '无效的令牌');
return response('',401,['error' => '无效的令牌']);
return ApiResponse::error(401, ['error' => '无效的令牌'], '无效的令牌');
}
// 将解码后的用户信息存储到请求对象的 user 属性中