Browse Source

添加uuid判断

visuddhinanda 2 năm trước cách đây
mục cha
commit
90a3ddbd3d
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      app/Http/Api/ChannelApi.php

+ 4 - 0
app/Http/Api/ChannelApi.php

@@ -1,9 +1,13 @@
 <?php
 namespace App\Http\Api;
 use App\Models\Channel;
+use Illuminate\Support\Str;
 
 class ChannelApi{
     public static function getById($id){
+        if(!Str::isUuid($id)){
+            return false;
+        }
         $channel = Channel::where("uid",$id)->first();
         if($channel){
             return [