使用数据库存储管理员和用户登录SESSION

This commit is contained in:
刘祥超
2023-02-04 15:17:02 +08:00
parent 8dbfa96149
commit a1ac7b176b
9 changed files with 410 additions and 7 deletions

View File

@@ -0,0 +1,7 @@
package models
import "time"
func (this *LoginSession) IsAvailable() bool {
return this.ExpiresAt == 0 || int64(this.ExpiresAt) > time.Now().Unix()
}