feat: support custom SMTP port setting (#45)

* feat: support custom SMTP port setting

* fix: send SMTPPort value to frontend

---------

Co-authored-by: JustSong <quanpengsong@gmail.com>
This commit is contained in:
snowmeow
2023-02-05 14:46:45 +08:00
committed by GitHub
co-authored by JustSong
parent ba25a15bca
commit 6b15b2080e
4 changed files with 21 additions and 1 deletions
+15
View File
@@ -12,6 +12,7 @@ const SystemSetting = () => {
GitHubClientSecret: '',
Notice: '',
SMTPServer: '',
SMTPPort: '',
SMTPAccount: '',
SMTPToken: '',
ServerAddress: '',
@@ -110,6 +111,12 @@ const SystemSetting = () => {
if (originInputs['SMTPAccount'] !== inputs.SMTPAccount) {
await updateOption('SMTPAccount', inputs.SMTPAccount);
}
if (
originInputs['SMTPPort'] !== inputs.SMTPPort &&
inputs.SMTPPort !== ''
) {
await updateOption('SMTPPort', inputs.SMTPPort);
}
if (
originInputs['SMTPToken'] !== inputs.SMTPToken &&
inputs.SMTPToken !== ''
@@ -259,6 +266,14 @@ const SystemSetting = () => {
value={inputs.SMTPServer}
placeholder='例如:smtp.qq.com'
/>
<Form.Input
label='SMTP 端口'
name='SMTPPort'
onChange={handleInputChange}
autoComplete='off'
value={inputs.SMTPPort}
placeholder='默认: 587'
/>
<Form.Input
label='SMTP 账户'
name='SMTPAccount'