diff --git a/app/controller/admin/system/ConfigController.php b/app/controller/admin/system/ConfigController.php index fb5d871..f32344e 100644 --- a/app/controller/admin/system/ConfigController.php +++ b/app/controller/admin/system/ConfigController.php @@ -131,7 +131,7 @@ class ConfigController extends BaseController $config && $config->save(['value'=> (string)$value]); } } - return $this->writeSuccess('同步成功'); + return $this->writeSuccess('更新成功', $data); } public function info() diff --git a/z_ele/src/utils/sys-config.ts b/z_ele/src/utils/sys-config.ts index 42d2f47..87f54c9 100644 --- a/z_ele/src/utils/sys-config.ts +++ b/z_ele/src/utils/sys-config.ts @@ -20,10 +20,11 @@ export function strToValue(type: string, value: string): any { return value.split(","); case 'text': case 'textarea': + return value ? value.toString() : ''; case 'date': case 'datetime': case 'time': - return null; + return value ? value.toString() : null; case 'date_range': case 'time_range': case 'datetime_range': @@ -70,6 +71,7 @@ export function strToBind(type: string, bindStr: string): any { case 'text': case 'textarea': case 'checkbox': + return bind; case 'date': return {format: 'YYYY-MM-DD', ...bind} case 'datetime':