|
@@ -3,12 +3,9 @@ import { useRequest } from 'umi'
|
|
|
import { PageContainer } from '@ant-design/pro-layout'
|
|
|
import { Card, Form, Input, Button, Upload } from 'antd'
|
|
|
import { UploadOutlined } from '@ant-design/icons'
|
|
|
-import React, { useEffect, useState } from 'react'
|
|
|
+import React, { useEffect } from 'react'
|
|
|
|
|
|
const Setting = () => {
|
|
|
- const [state, setState] = useState({
|
|
|
- contentValue: ''
|
|
|
- })
|
|
|
const [form] = Form.useForm()
|
|
|
|
|
|
const { run: tryGetSetting } = useRequest(
|
|
@@ -18,15 +15,13 @@ const Setting = () => {
|
|
|
{
|
|
|
manual: true,
|
|
|
onSuccess: (result: API.GetSettingParams) => {
|
|
|
- setState({ ...state, contentVlue: result })
|
|
|
- form.current?.setFieldsValue({ name: result.name, backstageName: result.backstageName })
|
|
|
+ form?.setFieldsValue({ name: result.name, backstageName: result.backstageName })
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
|
|
|
useEffect(() => {
|
|
|
tryGetSetting()
|
|
|
- form.current?.setFieldsValue(...state.contentValue)
|
|
|
}, [])
|
|
|
|
|
|
return (
|