Refactor(Variable): Optimize variable name
This commit is contained in:
@@ -5,7 +5,7 @@ import SettingsCard from '@/components/system/SettingCard'
|
||||
const Base = () => {
|
||||
const [baseForm] = AntdForm.useForm<BaseSettingsParam>()
|
||||
const baseFormValues = AntdForm.useWatch([], baseForm)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
|
||||
const handleOnReset = () => {
|
||||
getBaseSettings()
|
||||
@@ -24,17 +24,17 @@ const Base = () => {
|
||||
}
|
||||
|
||||
const getBaseSettings = () => {
|
||||
if (loading) {
|
||||
if (isLoading) {
|
||||
return
|
||||
}
|
||||
setLoading(true)
|
||||
setIsLoading(true)
|
||||
|
||||
void r_sys_settings_base_get().then((res) => {
|
||||
const response = res.data
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
data && baseForm.setFieldsValue(data)
|
||||
setLoading(false)
|
||||
setIsLoading(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -48,7 +48,7 @@ const Base = () => {
|
||||
<SettingsCard
|
||||
icon={IconOxygenBase}
|
||||
title={'基础'}
|
||||
loading={loading}
|
||||
loading={isLoading}
|
||||
onReset={handleOnReset}
|
||||
onSave={handleOnSave}
|
||||
modifyOperationCode={['system:settings:modify:base']}
|
||||
|
||||
@@ -11,7 +11,7 @@ const Mail = () => {
|
||||
const [modal, contextHolder] = AntdModal.useModal()
|
||||
const [mailForm] = AntdForm.useForm<MailSettingsParam>()
|
||||
const mailFormValues = AntdForm.useWatch([], mailForm)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const [mailSendForm] = AntdForm.useForm<MailSendParam>()
|
||||
|
||||
const handleOnTest = () => {
|
||||
@@ -95,17 +95,17 @@ const Mail = () => {
|
||||
}
|
||||
|
||||
const getMailSettings = () => {
|
||||
if (loading) {
|
||||
if (isLoading) {
|
||||
return
|
||||
}
|
||||
|
||||
setLoading(true)
|
||||
setIsLoading(true)
|
||||
void r_sys_settings_mail_get().then((res) => {
|
||||
const response = res.data
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
data && mailForm.setFieldsValue(data)
|
||||
setLoading(false)
|
||||
setIsLoading(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -119,7 +119,7 @@ const Mail = () => {
|
||||
<SettingsCard
|
||||
icon={IconOxygenEmail}
|
||||
title={'邮件'}
|
||||
loading={loading}
|
||||
loading={isLoading}
|
||||
onReset={handleOnReset}
|
||||
onSave={handleOnSave}
|
||||
modifyOperationCode={['system:settings:modify:mail']}
|
||||
|
||||
@@ -13,7 +13,7 @@ const SensitiveWord = () => {
|
||||
const [dataSource, setDataSource] = useState<SensitiveWordVo[]>()
|
||||
const [targetKeys, setTargetKeys] = useState<string[]>([])
|
||||
const [selectedKeys, setSelectedKeys] = useState<string[]>([])
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const [isAdding, setIsAdding] = useState(false)
|
||||
const [newWord, setNewWord] = useState('')
|
||||
|
||||
@@ -47,10 +47,10 @@ const SensitiveWord = () => {
|
||||
}
|
||||
|
||||
const getSensitiveWordSettings = () => {
|
||||
if (loading) {
|
||||
if (isLoading) {
|
||||
return
|
||||
}
|
||||
setLoading(true)
|
||||
setIsLoading(true)
|
||||
|
||||
void r_sys_settings_sensitive_get().then((res) => {
|
||||
const response = res.data
|
||||
@@ -58,7 +58,7 @@ const SensitiveWord = () => {
|
||||
const data = response.data
|
||||
data && setDataSource(data)
|
||||
data && setTargetKeys(data.filter((value) => value.enable).map((value) => value.id))
|
||||
setLoading(false)
|
||||
setIsLoading(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -103,7 +103,7 @@ const SensitiveWord = () => {
|
||||
<SettingsCard
|
||||
icon={IconOxygenSensitive}
|
||||
title={'敏感词'}
|
||||
loading={loading}
|
||||
loading={isLoading}
|
||||
onReset={handleOnReset}
|
||||
onSave={handleOnSave}
|
||||
modifyOperationCode={['system:settings:modify:sensitive']}
|
||||
|
||||
@@ -5,7 +5,7 @@ import SettingsCard from '@/components/system/SettingCard'
|
||||
const TwoFactor = () => {
|
||||
const [twoFactorForm] = AntdForm.useForm<TwoFactorSettingsParam>()
|
||||
const twoFactorFormValues = AntdForm.useWatch([], twoFactorForm)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
|
||||
const handleOnReset = () => {
|
||||
getTwoFactorSettings()
|
||||
@@ -24,17 +24,17 @@ const TwoFactor = () => {
|
||||
}
|
||||
|
||||
const getTwoFactorSettings = () => {
|
||||
if (loading) {
|
||||
if (isLoading) {
|
||||
return
|
||||
}
|
||||
setLoading(true)
|
||||
setIsLoading(true)
|
||||
|
||||
void r_sys_settings_two_factor_get().then((res) => {
|
||||
const response = res.data
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
data && twoFactorForm.setFieldsValue(data)
|
||||
setLoading(false)
|
||||
setIsLoading(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -48,7 +48,7 @@ const TwoFactor = () => {
|
||||
<SettingsCard
|
||||
icon={IconOxygenSafe}
|
||||
title={'双因素'}
|
||||
loading={loading}
|
||||
loading={isLoading}
|
||||
onReset={handleOnReset}
|
||||
onSave={handleOnSave}
|
||||
modifyOperationCode={['system:settings:modify:two-factor']}
|
||||
|
||||
Reference in New Issue
Block a user