Update Authenticate.php
This commit is contained in:
parent
f9a7767e2a
commit
d5a64ef246
|
@ -42,7 +42,7 @@ class Authenticate
|
||||||
//登录状态检测
|
//登录状态检测
|
||||||
if ($this->auth->guard($guard)->guest()) {
|
if ($this->auth->guard($guard)->guest()) {
|
||||||
$redirect = $request->input('redirect', $request->header('referer'));
|
$redirect = $request->input('redirect', $request->header('referer'));
|
||||||
// if ($request->isXmlHttpRequest()) {
|
if ($request->isXmlHttpRequest()) {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'code' => config('pdauth.code.unauthorized', 401),
|
'code' => config('pdauth.code.unauthorized', 401),
|
||||||
'msg' => 'Unauthorized',
|
'msg' => 'Unauthorized',
|
||||||
|
@ -50,9 +50,9 @@ class Authenticate
|
||||||
'url' => app('pd.auth')->connect($redirect),
|
'url' => app('pd.auth')->connect($redirect),
|
||||||
],
|
],
|
||||||
],401);
|
],401);
|
||||||
// } else {
|
} else {
|
||||||
// return redirect(app('pd.auth')->connect($redirect));
|
return redirect(app('pd.auth')->connect($redirect));
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user