Browse Source

提示登录返回code=-1

dev
李可松 4 years ago
parent
commit
1d2b47834c
  1. 8
      app/Http/Middleware/AuthApi.php

8
app/Http/Middleware/AuthApi.php

@ -24,16 +24,16 @@ class AuthApi
'code' => -1, 'code' => -1,
'msg' => 'header参数缺失', 'msg' => 'header参数缺失',
'data' => [], 'data' => [],
'status' => '500',
'status' => 500,
]); ]);
} }
// TODO 登录部分待优化 // TODO 登录部分待优化
if (!Cache::get($auth)) { if (!Cache::get($auth)) {
return response()->json([ return response()->json([
'code' => -1,
'code' => -2,
'msg' => '请先登录', 'msg' => '请先登录',
'data' => [], 'data' => [],
'status' => '500',
'status' => 500,
]); ]);
} }
if (!Cache::get($appid)) { if (!Cache::get($appid)) {
@ -41,7 +41,7 @@ class AuthApi
'code' => -1, 'code' => -1,
'msg' => 'lose appid', 'msg' => 'lose appid',
'data' => [], 'data' => [],
'status' => '500',
'status' => 500,
]); ]);
} }
return $next($request); return $next($request);

Loading…
Cancel
Save