浏览代码

update: middleware

tokumeikoi 3 年之前
父节点
当前提交
5fa7c534ff
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      app/Http/Middleware/User.php

+ 1 - 0
app/Http/Middleware/User.php

@@ -17,6 +17,7 @@ class User
     {
     {
         if ($request->input('auth_data')) {
         if ($request->input('auth_data')) {
             $authData = explode(':', base64_decode($request->input('auth_data')));
             $authData = explode(':', base64_decode($request->input('auth_data')));
+            if (!isset($authData[1]) || !isset($authData[0])) abort(500, '鉴权失败,请重新登入');
             $user = \App\Models\User::where('password', $authData[1])
             $user = \App\Models\User::where('password', $authData[1])
                 ->where('email', $authData[0])
                 ->where('email', $authData[0])
                 ->first();
                 ->first();