Merge pull request #60 from Promix953/main

修复auth check间隔
This commit is contained in:
johlanse 2022-08-16 08:39:54 +08:00 committed by GitHub
commit 36101e9d62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ func Query() ([]*User, error) {
users = append(users, u) users = append(users, u)
} else { } else {
log.Infoln("用户" + u.Nick + "cookie已失效") log.Infoln("用户" + u.Nick + "cookie已失效")
//_ = push.PushMessage("", "用户"+u.UID+"已失效,请登录", "login", u.PushId) // _ = push.PushMessage("", "用户"+u.UID+"已失效,请登录", "login", u.PushId)
if conf.GetConfig().Wechat.PushLoginWarn { if conf.GetConfig().Wechat.PushLoginWarn {
wechatPush(u.PushId, fmt.Sprintf("用户%v已失效", u.Nick)) wechatPush(u.PushId, fmt.Sprintf("用户%v已失效", u.Nick))
} }
@ -110,7 +110,7 @@ func QueryByPushID(pushID string) ([]*User, error) {
users = append(users, u) users = append(users, u)
} else { } else {
log.Infoln("用户" + u.Nick + "cookie已失效") log.Infoln("用户" + u.Nick + "cookie已失效")
//_ = push.PushMessage("", "用户"+u.UID+"已失效,请登录", "login", u.PushId) // _ = push.PushMessage("", "用户"+u.UID+"已失效,请登录", "login", u.PushId)
_ = DeleteUser(u.UID) _ = DeleteUser(u.UID)
} }
} }
@ -296,6 +296,6 @@ func check() {
_ = UpdateUser(user) _ = UpdateUser(user)
} }
} }
time.Sleep(time.Hour * time.Duration(rand.Intn(2))) time.Sleep(time.Hour * time.Duration(rand.Intn(2)+1))
} }
} }