Commit e7ce9e08 authored by 秦俊坤's avatar 秦俊坤

鉴权优化

parent 0f983e99
...@@ -36,7 +36,11 @@ class AuthorizeMiddleware implements MiddlewareInterface ...@@ -36,7 +36,11 @@ class AuthorizeMiddleware implements MiddlewareInterface
return $handler->handle($request); return $handler->handle($request);
} }
return response()->withStatus(403)->json(['msg' => "您没有访问接口的权限,请检查后再操作"]); //鉴权失败,错误码 403 forbidden return response()->withStatus(403)->json(
[
'code' => 403,
'msg' => "您没有访问接口的权限,请检查后再操作"
]); //鉴权失败,错误码 403 forbidden
//path 是需要登录鉴权的,判断当前用户是佛有对应 path 的权限 //path 是需要登录鉴权的,判断当前用户是佛有对应 path 的权限
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment