浏览代码

添加uuid判断

visuddhinanda 2 年之前
父节点
当前提交
90a3ddbd3d
共有 1 个文件被更改,包括 4 次插入0 次删除
  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 [