dever 4 år sedan
förälder
incheckning
659f355015
2 ändrade filer med 6 tillägg och 0 borttagningar
  1. 3 0
      app/collection/lib/Core.php
  2. 3 0
      app/user/src/Api.php

+ 3 - 0
app/collection/lib/Core.php

@@ -103,6 +103,9 @@ class Core
     # 检查是否可以查看
     protected function checkView()
     {
+        if (!$this->uid) {
+            return false;
+        }
         if (!$this->info) {
             $this->checkInfo();
         }

+ 3 - 0
app/user/src/Api.php

@@ -10,6 +10,9 @@ class Api extends Core
     public function __construct()
     {
         parent::__construct();
+        if ($this->uid <= 0) {
+            Dever::alert('请先登录');
+        }
     }
 
     # 获取用户基本信息