Add two-factor #38

Merged
FatttSnake merged 2 commits from FatttSnake into dev 2024-03-01 15:39:33 +08:00
7 changed files with 56 additions and 9 deletions
Showing only changes of commit fb94ae6a52 - Show all commits

View File

@@ -46,7 +46,7 @@ const Base = () => {
return (
<>
<SettingsCard
icon={IconOxygenEmail}
icon={IconOxygenBase}
title={'基础'}
loading={loading}
onReset={handleOnReset}

View File

@@ -17,6 +17,8 @@ const Mail = () => {
const handleOnTest = () => {
void modal.confirm({
title: '发送测试邮件',
getContainer: false,
centered: true,
maskClosable: true,
content: (
<>
@@ -27,7 +29,11 @@ const Mail = () => {
style={{ marginTop: 10 }}
rules={[{ required: true, type: 'email' }]}
>
<AntdInput />
<AntdInput
ref={(input) => {
input?.focus()
}}
/>
</AntdForm.Item>
</AntdForm>
<AntdTag style={{ whiteSpace: 'normal' }}>
@@ -56,7 +62,7 @@ const Mail = () => {
},
() => {
return new Promise((_, reject) => {
reject('输入接收者')
reject('输入有误')
})
}
)

View File

@@ -232,6 +232,7 @@ const Base = () => {
compileForm.setFieldValue('entryFileName', undefined)
void modal.confirm({
title: '编译',
centered: true,
maskClosable: true,
content: (
<>
@@ -537,6 +538,8 @@ const Base = () => {
const handleOnAddFile = () => {
void modal.confirm({
title: '新建文件',
getContainer: false,
centered: true,
maskClosable: true,
content: (
<AntdForm form={addFileForm}>
@@ -565,7 +568,11 @@ const Base = () => {
})
]}
>
<AntdInput />
<AntdInput
ref={(input) => {
input?.focus()
}}
/>
</AntdForm.Item>
</AntdForm>
),
@@ -714,6 +721,8 @@ const Base = () => {
renameFileForm.setFieldValue('fileName', fileName)
void modal.confirm({
title: '重命名文件',
getContainer: false,
centered: true,
maskClosable: true,
content: (
<AntdForm form={renameFileForm}>
@@ -745,7 +754,11 @@ const Base = () => {
})
]}
>
<AntdInput />
<AntdInput
ref={(input) => {
input?.focus()
}}
/>
</AntdForm.Item>
</AntdForm>
),

View File

@@ -399,6 +399,8 @@ const Template = () => {
const handleOnAddFile = () => {
void modal.confirm({
title: '新建文件',
getContainer: false,
centered: true,
maskClosable: true,
content: (
<AntdForm form={addFileForm}>
@@ -427,7 +429,11 @@ const Template = () => {
})
]}
>
<AntdInput />
<AntdInput
ref={(input) => {
input?.focus()
}}
/>
</AntdForm.Item>
</AntdForm>
),
@@ -579,6 +585,8 @@ const Template = () => {
renameFileForm.setFieldValue('fileName', fileName)
void modal.confirm({
title: '重命名文件',
getContainer: false,
centered: true,
maskClosable: true,
content: (
<AntdForm form={renameFileForm}>
@@ -610,7 +618,11 @@ const Template = () => {
})
]}
>
<AntdInput />
<AntdInput
ref={(input) => {
input?.focus()
}}
/>
</AntdForm.Item>
</AntdForm>
),

View File

@@ -195,6 +195,7 @@ const Tools = () => {
form.setFieldValue('pass', undefined)
void modal.confirm({
title: '审核',
centered: true,
maskClosable: true,
content: (
<AntdForm form={form}>

View File

@@ -336,6 +336,8 @@ const User = () => {
{value.username}
</>
),
getContainer: false,
centered: true,
maskClosable: true,
content: (
<AntdForm
@@ -356,7 +358,11 @@ const User = () => {
}
]}
>
<AntdInput.Password />
<AntdInput.Password
ref={(input) => {
input?.focus()
}}
/>
</AntdForm.Item>
<AntdForm.Item
name={'passwordConfirm'}

View File

@@ -262,6 +262,8 @@ const Tools = () => {
const handleOnUpgradeTool = (tool: ToolVo) => {
void modal.confirm({
title: '更新工具',
getContainer: false,
centered: true,
maskClosable: true,
content: (
<>
@@ -285,7 +287,14 @@ const Tools = () => {
}
]}
>
<AntdInput maxLength={10} showCount placeholder={'请输入版本'} />
<AntdInput
maxLength={10}
showCount
placeholder={'请输入版本'}
ref={(input) => {
input?.focus()
}}
/>
</AntdForm.Item>
</AntdForm>
</>