|
@@ -52,7 +52,7 @@ class Config extends Controller
|
|
|
$id = request()->post('id', '');
|
|
$id = request()->post('id', '');
|
|
|
if ($id) {
|
|
if ($id) {
|
|
|
$validator = [
|
|
$validator = [
|
|
|
- 'field' => 'required|string|max:50|alpha_dash|unique:config,field,' . $id,
|
|
|
|
|
|
|
+ 'id' => ['required', 'integer', 'min:1'],
|
|
|
'val' => 'nullable|string',
|
|
'val' => 'nullable|string',
|
|
|
'remark' => 'required|nullable|string',
|
|
'remark' => 'required|nullable|string',
|
|
|
];
|
|
];
|
|
@@ -66,7 +66,7 @@ class Config extends Controller
|
|
|
//
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
- request()->validate($validator);
|
|
|
|
|
|
|
+ $params = request()->validate($validator);
|
|
|
$ret = ConfigService::submit($params);
|
|
$ret = ConfigService::submit($params);
|
|
|
if ($ret['code'] == ConfigService::NOT) {
|
|
if ($ret['code'] == ConfigService::NOT) {
|
|
|
return $this->error($ret['code'], $ret['msg']);
|
|
return $this->error($ret['code'], $ret['msg']);
|