Browse Source

Update Auth.php

邹景立 4 năm trước cách đây
mục cha
commit
c9c185f552
1 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 2 3
      app/data/controller/api/Auth.php

+ 2 - 3
app/data/controller/api/Auth.php

@@ -50,10 +50,9 @@ abstract class Auth extends Controller
         }
         // 获取用户数据
         $this->user = $this->getUser();
-        if (empty($this->user) || empty($this->user['id'])) {
+        $this->uuid = $this->user['id'] ?? '';
+        if (empty($this->uuid)) {
             $this->error('用户登录失败!', '{-null-}', 401);
-        } else {
-            $this->uuid = $this->user['id'];
         }
     }