🚀 202405重置版

This commit is contained in:
wolfcode
2024-05-13 11:16:20 +08:00
parent 504ab4c4cf
commit a6fd81b0ed
242 changed files with 1169 additions and 2698 deletions

View File

@@ -64,7 +64,7 @@ abstract class BaseController
* @return array|string|true
* @throws ValidateException
*/
protected function validate(array $data, $validate, array $message = [], bool $batch = false)
protected function validate(array $data, string|array $validate, array $message = [], bool $batch = false)
{
if (is_array($validate)) {
$v = new Validate();
@@ -72,7 +72,7 @@ abstract class BaseController
} else {
if (strpos($validate, '.')) {
// 支持场景
list($validate, $scene) = explode('.', $validate);
[$validate, $scene] = explode('.', $validate);
}
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
$v = new $class();