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:
jeessy2
2024-07-18 18:24:35 -07:00
committed by GitHub
parent adfb42e783
commit d04149a905
3 changed files with 10 additions and 10 deletions

View File

@ -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>

View File

@ -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")
}
}