Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d11134d9
authored
May 12, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: now supports custom smtp port
parent
b14b4005
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
58 additions
and
38 deletions
+58
-38
common/constants.go
+1
-0
common/email.go
+1
-1
model/option.go
+4
-0
web/src/components/SystemSetting.js
+29
-14
web/src/pages/Channel/AddChannel.js
+4
-4
web/src/pages/Channel/EditChannel.js
+4
-4
web/src/pages/Redemption/EditRedemption.js
+4
-4
web/src/pages/Token/EditToken.js
+4
-4
web/src/pages/User/EditUser.js
+7
-7
No files found.
common/constants.go
View file @
d11134d9
...
@@ -34,6 +34,7 @@ var TurnstileCheckEnabled = false
...
@@ -34,6 +34,7 @@ var TurnstileCheckEnabled = false
var
RegisterEnabled
=
true
var
RegisterEnabled
=
true
var
SMTPServer
=
""
var
SMTPServer
=
""
var
SMTPPort
=
587
var
SMTPAccount
=
""
var
SMTPAccount
=
""
var
SMTPToken
=
""
var
SMTPToken
=
""
...
...
common/email.go
View file @
d11134d9
...
@@ -8,7 +8,7 @@ func SendEmail(subject string, receiver string, content string) error {
...
@@ -8,7 +8,7 @@ func SendEmail(subject string, receiver string, content string) error {
m
.
SetHeader
(
"To"
,
receiver
)
m
.
SetHeader
(
"To"
,
receiver
)
m
.
SetHeader
(
"Subject"
,
subject
)
m
.
SetHeader
(
"Subject"
,
subject
)
m
.
SetBody
(
"text/html"
,
content
)
m
.
SetBody
(
"text/html"
,
content
)
d
:=
gomail
.
NewDialer
(
SMTPServer
,
587
,
SMTPAccount
,
SMTPToken
)
d
:=
gomail
.
NewDialer
(
SMTPServer
,
SMTPPort
,
SMTPAccount
,
SMTPToken
)
err
:=
d
.
DialAndSend
(
m
)
err
:=
d
.
DialAndSend
(
m
)
return
err
return
err
}
}
model/option.go
View file @
d11134d9
...
@@ -33,6 +33,7 @@ func InitOptionMap() {
...
@@ -33,6 +33,7 @@ func InitOptionMap() {
common
.
OptionMap
[
"TurnstileCheckEnabled"
]
=
strconv
.
FormatBool
(
common
.
TurnstileCheckEnabled
)
common
.
OptionMap
[
"TurnstileCheckEnabled"
]
=
strconv
.
FormatBool
(
common
.
TurnstileCheckEnabled
)
common
.
OptionMap
[
"RegisterEnabled"
]
=
strconv
.
FormatBool
(
common
.
RegisterEnabled
)
common
.
OptionMap
[
"RegisterEnabled"
]
=
strconv
.
FormatBool
(
common
.
RegisterEnabled
)
common
.
OptionMap
[
"SMTPServer"
]
=
""
common
.
OptionMap
[
"SMTPServer"
]
=
""
common
.
OptionMap
[
"SMTPPort"
]
=
strconv
.
Itoa
(
common
.
SMTPPort
)
common
.
OptionMap
[
"SMTPAccount"
]
=
""
common
.
OptionMap
[
"SMTPAccount"
]
=
""
common
.
OptionMap
[
"SMTPToken"
]
=
""
common
.
OptionMap
[
"SMTPToken"
]
=
""
common
.
OptionMap
[
"Notice"
]
=
""
common
.
OptionMap
[
"Notice"
]
=
""
...
@@ -112,6 +113,9 @@ func updateOptionMap(key string, value string) (err error) {
...
@@ -112,6 +113,9 @@ func updateOptionMap(key string, value string) (err error) {
switch
key
{
switch
key
{
case
"SMTPServer"
:
case
"SMTPServer"
:
common
.
SMTPServer
=
value
common
.
SMTPServer
=
value
case
"SMTPPort"
:
intValue
,
_
:=
strconv
.
Atoi
(
value
)
common
.
SMTPPort
=
intValue
case
"SMTPAccount"
:
case
"SMTPAccount"
:
common
.
SMTPAccount
=
value
common
.
SMTPAccount
=
value
case
"SMTPToken"
:
case
"SMTPToken"
:
...
...
web/src/components/SystemSetting.js
View file @
d11134d9
...
@@ -12,6 +12,7 @@ const SystemSetting = () => {
...
@@ -12,6 +12,7 @@ const SystemSetting = () => {
GitHubClientSecret
:
''
,
GitHubClientSecret
:
''
,
Notice
:
''
,
Notice
:
''
,
SMTPServer
:
''
,
SMTPServer
:
''
,
SMTPPort
:
''
,
SMTPAccount
:
''
,
SMTPAccount
:
''
,
SMTPToken
:
''
,
SMTPToken
:
''
,
ServerAddress
:
''
,
ServerAddress
:
''
,
...
@@ -129,6 +130,12 @@ const SystemSetting = () => {
...
@@ -129,6 +130,12 @@ const SystemSetting = () => {
await
updateOption
(
'SMTPAccount'
,
inputs
.
SMTPAccount
);
await
updateOption
(
'SMTPAccount'
,
inputs
.
SMTPAccount
);
}
}
if
(
if
(
originInputs
[
'SMTPPort'
]
!==
inputs
.
SMTPPort
&&
inputs
.
SMTPPort
!==
''
)
{
await
updateOption
(
'SMTPPort'
,
inputs
.
SMTPPort
);
}
if
(
originInputs
[
'SMTPToken'
]
!==
inputs
.
SMTPToken
&&
originInputs
[
'SMTPToken'
]
!==
inputs
.
SMTPToken
&&
inputs
.
SMTPToken
!==
''
inputs
.
SMTPToken
!==
''
)
{
)
{
...
@@ -258,7 +265,7 @@ const SystemSetting = () => {
...
@@ -258,7 +265,7 @@ const SystemSetting = () => {
label
=
'新用户初始配额'
label
=
'新用户初始配额'
name
=
'QuotaForNewUser'
name
=
'QuotaForNewUser'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
QuotaForNewUser
}
value
=
{
inputs
.
QuotaForNewUser
}
type
=
'number'
type
=
'number'
min
=
'0'
min
=
'0'
...
@@ -268,7 +275,7 @@ const SystemSetting = () => {
...
@@ -268,7 +275,7 @@ const SystemSetting = () => {
label
=
'充值链接'
label
=
'充值链接'
name
=
'TopUpLink'
name
=
'TopUpLink'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
TopUpLink
}
value
=
{
inputs
.
TopUpLink
}
type
=
'link'
type
=
'link'
placeholder
=
'例如发卡网站的购买链接'
placeholder
=
'例如发卡网站的购买链接'
...
@@ -280,7 +287,7 @@ const SystemSetting = () => {
...
@@ -280,7 +287,7 @@ const SystemSetting = () => {
name
=
'ModelRatio'
name
=
'ModelRatio'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
style
=
{{
minHeight
:
250
,
fontFamily
:
'JetBrains Mono, Consolas'
}}
style
=
{{
minHeight
:
250
,
fontFamily
:
'JetBrains Mono, Consolas'
}}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
ModelRatio
}
value
=
{
inputs
.
ModelRatio
}
placeholder
=
'为一个 JSON 文本,键为模型名称,值为倍率'
placeholder
=
'为一个 JSON 文本,键为模型名称,值为倍率'
/>
/>
...
@@ -291,20 +298,28 @@ const SystemSetting = () => {
...
@@ -291,20 +298,28 @@ const SystemSetting = () => {
配置
SMTP
配置
SMTP
<
Header
.
Subheader
>
用以支持系统的邮件发送
<
/Header.Subheader
>
<
Header
.
Subheader
>
用以支持系统的邮件发送
<
/Header.Subheader
>
<
/Header
>
<
/Header
>
<
Form
.
Group
widths
=
{
3
}
>
<
Form
.
Group
widths
=
{
4
}
>
<
Form
.
Input
<
Form
.
Input
label
=
'SMTP 服务器地址'
label
=
'SMTP 服务器地址'
name
=
'SMTPServer'
name
=
'SMTPServer'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
SMTPServer
}
value
=
{
inputs
.
SMTPServer
}
placeholder
=
'例如:smtp.qq.com'
placeholder
=
'例如:smtp.qq.com'
/>
/>
<
Form
.
Input
<
Form
.
Input
label
=
'SMTP 端口'
name
=
'SMTPPort'
onChange
=
{
handleInputChange
}
autoComplete
=
'new-password'
value
=
{
inputs
.
SMTPPort
}
placeholder
=
'默认: 587'
/>
<
Form
.
Input
label
=
'SMTP 账户'
label
=
'SMTP 账户'
name
=
'SMTPAccount'
name
=
'SMTPAccount'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
SMTPAccount
}
value
=
{
inputs
.
SMTPAccount
}
placeholder
=
'通常是邮箱地址'
placeholder
=
'通常是邮箱地址'
/>
/>
...
@@ -313,7 +328,7 @@ const SystemSetting = () => {
...
@@ -313,7 +328,7 @@ const SystemSetting = () => {
name
=
'SMTPToken'
name
=
'SMTPToken'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
type
=
'password'
type
=
'password'
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
SMTPToken
}
value
=
{
inputs
.
SMTPToken
}
placeholder
=
'敏感信息不会发送到前端显示'
placeholder
=
'敏感信息不会发送到前端显示'
/>
/>
...
@@ -340,7 +355,7 @@ const SystemSetting = () => {
...
@@ -340,7 +355,7 @@ const SystemSetting = () => {
label
=
'GitHub Client ID'
label
=
'GitHub Client ID'
name
=
'GitHubClientId'
name
=
'GitHubClientId'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
GitHubClientId
}
value
=
{
inputs
.
GitHubClientId
}
placeholder
=
'输入你注册的 GitHub OAuth APP 的 ID'
placeholder
=
'输入你注册的 GitHub OAuth APP 的 ID'
/>
/>
...
@@ -349,7 +364,7 @@ const SystemSetting = () => {
...
@@ -349,7 +364,7 @@ const SystemSetting = () => {
name
=
'GitHubClientSecret'
name
=
'GitHubClientSecret'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
type
=
'password'
type
=
'password'
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
GitHubClientSecret
}
value
=
{
inputs
.
GitHubClientSecret
}
placeholder
=
'敏感信息不会发送到前端显示'
placeholder
=
'敏感信息不会发送到前端显示'
/>
/>
...
@@ -377,7 +392,7 @@ const SystemSetting = () => {
...
@@ -377,7 +392,7 @@ const SystemSetting = () => {
name
=
'WeChatServerAddress'
name
=
'WeChatServerAddress'
placeholder
=
'例如:https://yourdomain.com'
placeholder
=
'例如:https://yourdomain.com'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
WeChatServerAddress
}
value
=
{
inputs
.
WeChatServerAddress
}
/
>
/
>
<
Form
.
Input
<
Form
.
Input
...
@@ -385,7 +400,7 @@ const SystemSetting = () => {
...
@@ -385,7 +400,7 @@ const SystemSetting = () => {
name
=
'WeChatServerToken'
name
=
'WeChatServerToken'
type
=
'password'
type
=
'password'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
WeChatServerToken
}
value
=
{
inputs
.
WeChatServerToken
}
placeholder
=
'敏感信息不会发送到前端显示'
placeholder
=
'敏感信息不会发送到前端显示'
/>
/>
...
@@ -393,7 +408,7 @@ const SystemSetting = () => {
...
@@ -393,7 +408,7 @@ const SystemSetting = () => {
label
=
'微信公众号二维码图片链接'
label
=
'微信公众号二维码图片链接'
name
=
'WeChatAccountQRCodeImageURL'
name
=
'WeChatAccountQRCodeImageURL'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
WeChatAccountQRCodeImageURL
}
value
=
{
inputs
.
WeChatAccountQRCodeImageURL
}
placeholder
=
'输入一个图片链接'
placeholder
=
'输入一个图片链接'
/>
/>
...
@@ -417,7 +432,7 @@ const SystemSetting = () => {
...
@@ -417,7 +432,7 @@ const SystemSetting = () => {
label
=
'Turnstile Site Key'
label
=
'Turnstile Site Key'
name
=
'TurnstileSiteKey'
name
=
'TurnstileSiteKey'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
TurnstileSiteKey
}
value
=
{
inputs
.
TurnstileSiteKey
}
placeholder
=
'输入你注册的 Turnstile Site Key'
placeholder
=
'输入你注册的 Turnstile Site Key'
/>
/>
...
@@ -426,7 +441,7 @@ const SystemSetting = () => {
...
@@ -426,7 +441,7 @@ const SystemSetting = () => {
name
=
'TurnstileSecretKey'
name
=
'TurnstileSecretKey'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
type
=
'password'
type
=
'password'
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
value
=
{
inputs
.
TurnstileSecretKey
}
value
=
{
inputs
.
TurnstileSecretKey
}
placeholder
=
'敏感信息不会发送到前端显示'
placeholder
=
'敏感信息不会发送到前端显示'
/>
/>
...
...
web/src/pages/Channel/AddChannel.js
View file @
d11134d9
...
@@ -36,7 +36,7 @@ const AddChannel = () => {
...
@@ -36,7 +36,7 @@ const AddChannel = () => {
<>
<>
<
Segment
>
<
Segment
>
<
Header
as
=
'h3'
>
创建新的渠道
<
/Header
>
<
Header
as
=
'h3'
>
创建新的渠道
<
/Header
>
<
Form
autoComplete
=
'
off
'
>
<
Form
autoComplete
=
'
new-password
'
>
<
Form
.
Field
>
<
Form
.
Field
>
<
Form
.
Select
<
Form
.
Select
label
=
'类型'
label
=
'类型'
...
@@ -55,7 +55,7 @@ const AddChannel = () => {
...
@@ -55,7 +55,7 @@ const AddChannel = () => {
placeholder
=
{
'请输入自定义渠道的 Base URL,例如:https://openai.justsong.cn'
}
placeholder
=
{
'请输入自定义渠道的 Base URL,例如:https://openai.justsong.cn'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
inputs
.
base_url
}
value
=
{
inputs
.
base_url
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
/>
/>
<
/Form.Field
>
<
/Form.Field
>
)
)
...
@@ -67,7 +67,7 @@ const AddChannel = () => {
...
@@ -67,7 +67,7 @@ const AddChannel = () => {
placeholder
=
{
'请输入名称'
}
placeholder
=
{
'请输入名称'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
name
}
value
=
{
name
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
required
required
/>
/>
<
/Form.Field
>
<
/Form.Field
>
...
@@ -79,7 +79,7 @@ const AddChannel = () => {
...
@@ -79,7 +79,7 @@ const AddChannel = () => {
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
key
}
value
=
{
key
}
// type='password'
// type='password'
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
required
required
/>
/>
<
/Form.Field
>
<
/Form.Field
>
...
...
web/src/pages/Channel/EditChannel.js
View file @
d11134d9
...
@@ -50,7 +50,7 @@ const EditChannel = () => {
...
@@ -50,7 +50,7 @@ const EditChannel = () => {
<>
<>
<
Segment
loading
=
{
loading
}
>
<
Segment
loading
=
{
loading
}
>
<
Header
as
=
'h3'
>
更新渠道信息
<
/Header
>
<
Header
as
=
'h3'
>
更新渠道信息
<
/Header
>
<
Form
autoComplete
=
'
off
'
>
<
Form
autoComplete
=
'
new-password
'
>
<
Form
.
Field
>
<
Form
.
Field
>
<
Form
.
Select
<
Form
.
Select
label
=
'类型'
label
=
'类型'
...
@@ -69,7 +69,7 @@ const EditChannel = () => {
...
@@ -69,7 +69,7 @@ const EditChannel = () => {
placeholder
=
{
'请输入新的自定义渠道的 Base URL,例如:https://openai.justsong.cn'
}
placeholder
=
{
'请输入新的自定义渠道的 Base URL,例如:https://openai.justsong.cn'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
inputs
.
base_url
}
value
=
{
inputs
.
base_url
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
/>
/>
<
/Form.Field
>
<
/Form.Field
>
)
)
...
@@ -81,7 +81,7 @@ const EditChannel = () => {
...
@@ -81,7 +81,7 @@ const EditChannel = () => {
placeholder
=
{
'请输入新的名称'
}
placeholder
=
{
'请输入新的名称'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
inputs
.
name
}
value
=
{
inputs
.
name
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
/>
/>
<
/Form.Field
>
<
/Form.Field
>
<
Form
.
Field
>
<
Form
.
Field
>
...
@@ -92,7 +92,7 @@ const EditChannel = () => {
...
@@ -92,7 +92,7 @@ const EditChannel = () => {
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
inputs
.
key
}
value
=
{
inputs
.
key
}
// type='password'
// type='password'
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
/>
/>
<
/Form.Field
>
<
/Form.Field
>
<
Button
onClick
=
{
submit
}
>
提交
<
/Button
>
<
Button
onClick
=
{
submit
}
>
提交
<
/Button
>
...
...
web/src/pages/Redemption/EditRedemption.js
View file @
d11134d9
...
@@ -73,7 +73,7 @@ const EditRedemption = () => {
...
@@ -73,7 +73,7 @@ const EditRedemption = () => {
<>
<>
<
Segment
loading
=
{
loading
}
>
<
Segment
loading
=
{
loading
}
>
<
Header
as
=
'h3'
>
{
isEdit
?
'更新兑换码信息'
:
'创建新的兑换码'
}
<
/Header
>
<
Header
as
=
'h3'
>
{
isEdit
?
'更新兑换码信息'
:
'创建新的兑换码'
}
<
/Header
>
<
Form
autoComplete
=
'
off
'
>
<
Form
autoComplete
=
'
new-password
'
>
<
Form
.
Field
>
<
Form
.
Field
>
<
Form
.
Input
<
Form
.
Input
label
=
'名称'
label
=
'名称'
...
@@ -81,7 +81,7 @@ const EditRedemption = () => {
...
@@ -81,7 +81,7 @@ const EditRedemption = () => {
placeholder
=
{
'请输入名称'
}
placeholder
=
{
'请输入名称'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
name
}
value
=
{
name
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
required
=
{
!
isEdit
}
required
=
{
!
isEdit
}
/
>
/
>
<
/Form.Field
>
<
/Form.Field
>
...
@@ -92,7 +92,7 @@ const EditRedemption = () => {
...
@@ -92,7 +92,7 @@ const EditRedemption = () => {
placeholder
=
{
'请输入单个兑换码中包含的额度'
}
placeholder
=
{
'请输入单个兑换码中包含的额度'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
quota
}
value
=
{
quota
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
type
=
'number'
type
=
'number'
/>
/>
<
/Form.Field
>
<
/Form.Field
>
...
@@ -105,7 +105,7 @@ const EditRedemption = () => {
...
@@ -105,7 +105,7 @@ const EditRedemption = () => {
placeholder
=
{
'请输入生成数量'
}
placeholder
=
{
'请输入生成数量'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
count
}
value
=
{
count
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
type
=
'number'
type
=
'number'
/>
/>
<
/Form.Field
>
<
/Form.Field
>
...
...
web/src/pages/Token/EditToken.js
View file @
d11134d9
...
@@ -95,7 +95,7 @@ const EditToken = () => {
...
@@ -95,7 +95,7 @@ const EditToken = () => {
<>
<>
<
Segment
loading
=
{
loading
}
>
<
Segment
loading
=
{
loading
}
>
<
Header
as
=
'h3'
>
{
isEdit
?
'更新令牌信息'
:
'创建新的令牌'
}
<
/Header
>
<
Header
as
=
'h3'
>
{
isEdit
?
'更新令牌信息'
:
'创建新的令牌'
}
<
/Header
>
<
Form
autoComplete
=
'
off
'
>
<
Form
autoComplete
=
'
new-password
'
>
<
Form
.
Field
>
<
Form
.
Field
>
<
Form
.
Input
<
Form
.
Input
label
=
'名称'
label
=
'名称'
...
@@ -103,7 +103,7 @@ const EditToken = () => {
...
@@ -103,7 +103,7 @@ const EditToken = () => {
placeholder
=
{
'请输入名称'
}
placeholder
=
{
'请输入名称'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
name
}
value
=
{
name
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
required
=
{
!
isEdit
}
required
=
{
!
isEdit
}
/
>
/
>
<
/Form.Field
>
<
/Form.Field
>
...
@@ -116,7 +116,7 @@ const EditToken = () => {
...
@@ -116,7 +116,7 @@ const EditToken = () => {
placeholder
=
{
'请输入额度'
}
placeholder
=
{
'请输入额度'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
remain_quota
}
value
=
{
remain_quota
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
type
=
'number'
type
=
'number'
disabled
=
{
unlimited_quota
}
disabled
=
{
unlimited_quota
}
/
>
/
>
...
@@ -133,7 +133,7 @@ const EditToken = () => {
...
@@ -133,7 +133,7 @@ const EditToken = () => {
placeholder
=
{
'请输入过期时间,格式为 yyyy-MM-dd HH:mm:ss,-1 表示无限制'
}
placeholder
=
{
'请输入过期时间,格式为 yyyy-MM-dd HH:mm:ss,-1 表示无限制'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
expired_time
}
value
=
{
expired_time
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
type
=
'datetime-local'
type
=
'datetime-local'
/>
/>
<
/Form.Field
>
<
/Form.Field
>
...
...
web/src/pages/User/EditUser.js
View file @
d11134d9
...
@@ -60,7 +60,7 @@ const EditUser = () => {
...
@@ -60,7 +60,7 @@ const EditUser = () => {
<>
<>
<
Segment
loading
=
{
loading
}
>
<
Segment
loading
=
{
loading
}
>
<
Header
as
=
'h3'
>
更新用户信息
<
/Header
>
<
Header
as
=
'h3'
>
更新用户信息
<
/Header
>
<
Form
autoComplete
=
'
off
'
>
<
Form
autoComplete
=
'
new-password
'
>
<
Form
.
Field
>
<
Form
.
Field
>
<
Form
.
Input
<
Form
.
Input
label
=
'用户名'
label
=
'用户名'
...
@@ -68,7 +68,7 @@ const EditUser = () => {
...
@@ -68,7 +68,7 @@ const EditUser = () => {
placeholder
=
{
'请输入新的用户名'
}
placeholder
=
{
'请输入新的用户名'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
username
}
value
=
{
username
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
/>
/>
<
/Form.Field
>
<
/Form.Field
>
<
Form
.
Field
>
<
Form
.
Field
>
...
@@ -79,7 +79,7 @@ const EditUser = () => {
...
@@ -79,7 +79,7 @@ const EditUser = () => {
placeholder
=
{
'请输入新的密码'
}
placeholder
=
{
'请输入新的密码'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
password
}
value
=
{
password
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
/>
/>
<
/Form.Field
>
<
/Form.Field
>
<
Form
.
Field
>
<
Form
.
Field
>
...
@@ -89,7 +89,7 @@ const EditUser = () => {
...
@@ -89,7 +89,7 @@ const EditUser = () => {
placeholder
=
{
'请输入新的显示名称'
}
placeholder
=
{
'请输入新的显示名称'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
display_name
}
value
=
{
display_name
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
/>
/>
<
/Form.Field
>
<
/Form.Field
>
<
Form
.
Field
>
<
Form
.
Field
>
...
@@ -97,7 +97,7 @@ const EditUser = () => {
...
@@ -97,7 +97,7 @@ const EditUser = () => {
label
=
'已绑定的 GitHub 账户'
label
=
'已绑定的 GitHub 账户'
name
=
'github_id'
name
=
'github_id'
value
=
{
github_id
}
value
=
{
github_id
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
readOnly
readOnly
/>
/>
...
@@ -107,7 +107,7 @@ const EditUser = () => {
...
@@ -107,7 +107,7 @@ const EditUser = () => {
label
=
'已绑定的微信账户'
label
=
'已绑定的微信账户'
name
=
'wechat_id'
name
=
'wechat_id'
value
=
{
wechat_id
}
value
=
{
wechat_id
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
readOnly
readOnly
/>
/>
...
@@ -117,7 +117,7 @@ const EditUser = () => {
...
@@ -117,7 +117,7 @@ const EditUser = () => {
label
=
'已绑定的邮箱账户'
label
=
'已绑定的邮箱账户'
name
=
'email'
name
=
'email'
value
=
{
email
}
value
=
{
email
}
autoComplete
=
'
off
'
autoComplete
=
'
new-password
'
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
readOnly
readOnly
/>
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment