修改request基类
This commit is contained in:
parent
480aadd38b
commit
a5242b3aea
@ -48,7 +48,7 @@ class CatchRequest extends Request
|
|||||||
$validate->extend($rule->type(), [$rule, 'verify'], $rule->message());
|
$validate->extend($rule->type(), [$rule, 'verify'], $rule->message());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
// 场景设置验证
|
// 场景设置验证
|
||||||
if (property_exists($this, 'scene') && !empty($this->scene)) {
|
if (property_exists($this, 'scene') && !empty($this->scene)) {
|
||||||
@ -80,6 +80,12 @@ class CatchRequest extends Request
|
|||||||
if (!$validate->check(request()->param(), $this->rules())) {
|
if (!$validate->check(request()->param(), $this->rules())) {
|
||||||
throw new FailedException($validate->getError());
|
throw new FailedException($validate->getError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 每次请求都需要设置创建人
|
||||||
|
$this->param = array_merge($this->param, [
|
||||||
|
'creator_id' => $this->user()->id,
|
||||||
|
]);
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw new ValidateFailedException($e->getMessage());
|
throw new ValidateFailedException($e->getMessage());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user