改进 未实名的状态吗返回 401

This commit is contained in:
iVampireSP.com 2023-01-15 07:23:42 +08:00
parent b5a99ffbca
commit 1b0412b1ad
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -28,7 +28,7 @@ public function handle(Request $request, Closure $next, string $guard = 'web'):
if (auth($guard)->check()) {
if ($request->user($guard)->real_name_verified_at === null) {
if ($request->expectsJson()) {
return $this->error('您还没有实名认证。');
return $this->unauthorized('您还没有实名认证。');
}
return redirect()->route('real_name.create');