Mike 7 年之前
父節點
當前提交
eff8112bd1
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      server/app/Http/Middleware/Authenticate.php

+ 4 - 4
server/app/Http/Middleware/Authenticate.php

xqd
@@ -18,10 +18,10 @@ class Authenticate
     public function handle($request, Closure $next, $guard = null)
     {
         if(Auth::guard($guard)->guest()) {
-            \Log::info($guard);
-            if($request->ajax()||$guard=="api") {
-                \Log::info('Unauthorized Unauthorized ');
-                return response('Unauthorized .', 401);
+//            \Log::info($guard);
+            if($request->ajax()||$request->wantsJson()||$guard=="api") {
+//                \Log::info('Unauthorized Unauthorized ');
+                return response('Unauthorized.', 401);
             } else {
                 if($guard == 'admin') {
                     return redirect()->guest('admin/login');