Commit 376ebc1e by 杨昕

设置媒资名称验证规则

parent 355d4049
Pipeline #10546 passed with stages
in 40 seconds
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api; namespace App\Http\Controllers\Api;
use App\Exceptions\FormException;
use App\Model\MediaModel; use App\Model\MediaModel;
use App\Model\QiniuModel; use App\Model\QiniuModel;
use App\Tool\SrsHookValidate; use App\Tool\SrsHookValidate;
...@@ -117,7 +118,15 @@ class MediaController extends Controller ...@@ -117,7 +118,15 @@ class MediaController extends Controller
'secret_key' => 'required', 'secret_key' => 'required',
'media_url' => 'required', 'media_url' => 'required',
'description' => '', 'description' => '',
])); ]),function (...$params){
$request = $params[0];
if (!strstr($request->media_name,'.')){
throw new FormException('媒资名字格式有误');
}
});
$data_time = date('Y-m-d H:i:s',time()); $data_time = date('Y-m-d H:i:s',time());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment