调整文章录入限制

This commit is contained in:
luofei 2023-06-14 11:24:24 +08:00
parent c7a7130495
commit 7cfad29399
2 changed files with 6 additions and 2 deletions

View File

@ -57,7 +57,11 @@ class Upload extends BaseController
$uploader = UploadService::create();
if (!empty($images)) {
foreach ($images as $k => $image) {
$imageLink = $domain . $image;
if (!preg_match('/^http/', $image)) {
$imageLink = $domain . $image;
} else {
$imageLink = $image;
}
$stream = file_get_contents($imageLink);
if (!$stream) {
return app('json')->fail('图片获取出错');

View File

@ -21,7 +21,7 @@ class ArticleValidate extends Validate
protected $rule = [
'cid|选择分类' => 'require|integer',
'title|标题' => 'require|max:32',
'title|标题' => 'require|max:50',
'content|内容' => 'require',
'author|作者' => 'require|max:32',
'image_input|图片' => 'require|max:128',