Explorar el Código

添加uuid判断

visuddhinanda hace 2 años
padre
commit
90a3ddbd3d
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      app/Http/Api/ChannelApi.php

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

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