1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-06-28 06:40:28 +08:00

finish reset password

This commit is contained in:
源文雨
2023-03-19 22:39:41 +08:00
parent f3757deecf
commit 7d9b1456c4
6 changed files with 98 additions and 9 deletions

View File

@@ -11,13 +11,13 @@ import (
var registerlimit = ttl.NewCache[string, bool](time.Minute * 10)
var (
errRegisterTooFast = errors.New("register too fast")
errInvalidIP = errors.New("invalid IP")
errRequestTooFast = errors.New("request too fast")
errInvalidIP = errors.New("invalid IP")
)
func register(ip, name, mobile, npwd string) error {
if registerlimit.Get(ip) {
return errRegisterTooFast
return errRequestTooFast
}
if ip == "" {
return errInvalidIP