1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-06-27 14:20:29 +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

@@ -146,3 +146,14 @@ func setUserInfo(id int, nick, desc, avtr *string) error {
}
return global.UserDB.UpdateUserInfo(id, n, a, d)
}
func resetPassword(ip, name, mobile string) error {
if registerlimit.Get(ip) {
return errRequestTooFast
}
if ip == "" {
return errInvalidIP
}
registerlimit.Set(ip, true)
return global.UserDB.NotifyResetPassword(ip, name, mobile)
}