Ver Fonte

报错第二个参数用http status

visuddhinanda há 2 anos atrás
pai
commit
d8983c299c
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      app/Http/Controllers/SentenceController.php

+ 3 - 3
app/Http/Controllers/SentenceController.php

@@ -229,17 +229,17 @@ class SentenceController extends Controller
         $user = AuthApi::current($request);
         if(!$user ){
             //未登录用户
-            return $this->error(__('auth.failed'),[],401);
+            return $this->error(__('auth.failed'),401,401);
         }
         $channel = Channel::where('uid',$request->get('channel'))->first();
         if(!$channel){
-            return $this->error(__('auth.failed'));
+            return $this->error(__('auth.failed'),403,403);
         }
         if($channel->owner_uid !== $user["user_uid"]){
             //判断是否为协作
             $power = ShareApi::getResPower($user["user_uid"],$channel->uid,2);
             if($power < 20){
-                return $this->error(__('auth.failed'),[],403);
+                return $this->error(__('auth.failed'),403,403);
             }
         }
         $sentFirst=null;