🐛 修复 BUG

This commit is contained in:
Wisp X
2022-02-08 15:49:22 +08:00
parent 175e3fe56a
commit 267cd948bf
4 changed files with 25 additions and 15 deletions
+7 -5
View File
@@ -21,11 +21,13 @@ class StrategyRequest extends FormRequest
'intro' => 'max:2000',
'key' => 'required|integer',
'configs.root' => ['max:1000', function ($attribute, $value, $fail) {
if (! is_dir($value)) {
return $fail('储存路径不存在');
}
if (! is_writeable($value)) {
return $fail('储存路径没有写入权限');
if ($value) {
if (! is_dir($value)) {
return $fail('储存路径不存在');
}
if (! is_writeable($value)) {
return $fail('储存路径没有写入权限');
}
}
}],
'configs.url' => ['required', 'url', function ($attribute, $value, $fail) {