mirror of
https://github.com/jeessy2/ddns-go.git
synced 2025-10-20 15:33:46 +08:00
chore: the time limit is set to 10 minutes (#1191)
* chore: the time limit is set to 10 minutes * docs: set up username and password immediately after logging in
This commit is contained in:
@ -129,11 +129,11 @@
|
||||
if ('{{.EmptyUser}}' === 'true') {
|
||||
showMessage({
|
||||
content: i18n({
|
||||
"en": "You have not set up a user yet, just click the Login button directly",
|
||||
"zh-cn": "尚未设置用户, 请直接点击登录",
|
||||
"en": "You have not set up a user yet. Please click Login button directly and be sure to set up your username and password immediately after logging in.",
|
||||
"zh-cn": "尚未设置用户, 请直接点击登录,登录后请立即设置用户名和密码",
|
||||
}),
|
||||
type: "info",
|
||||
duration: 60000,
|
||||
duration: 300000,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
10
web/save.go
10
web/save.go
@ -53,15 +53,15 @@ func checkAndSave(request *http.Request) string {
|
||||
accept := request.Header.Get("Accept-Language")
|
||||
conf.Lang = util.InitLogLang(accept)
|
||||
|
||||
// 首次设置 && 必须在服务启动的 5 分钟内
|
||||
if time.Now().Unix()-startTime > 5*60 {
|
||||
// 首次设置 && 必须在服务启动的 10 分钟内
|
||||
if time.Now().Unix()-startTime > 10*60 {
|
||||
if firstTime {
|
||||
return util.LogStr("请在ddns-go启动后 5 分钟内完成初始化配置")
|
||||
return util.LogStr("请在ddns-go启动后 10 分钟内完成初始化配置")
|
||||
}
|
||||
// 之前未设置帐号密码 && 本次设置了帐号或密码 必须在5分钟内
|
||||
// 之前未设置帐号密码 && 本次设置了帐号或密码 必须在10分钟内
|
||||
if (conf.Username == "" && conf.Password == "") &&
|
||||
(usernameNew != "" || passwordNew != "") {
|
||||
return util.LogStr("之前未设置帐号密码, 仅允许在ddns-go启动后 5 分钟内设置, 请重启ddns-go")
|
||||
return util.LogStr("之前未设置帐号密码, 仅允许在ddns-go启动后 10 分钟内设置, 请重启ddns-go")
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user