20 lines
369 B
Go
20 lines
369 B
Go
package auth
|
|
|
|
import "time"
|
|
|
|
type RefreshTokenRecord struct {
|
|
UserID int32 `json:"user_id"`
|
|
TokenVersion int32 `json:"token_version"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
ExpiresAt time.Time `json:"expires_at"`
|
|
}
|
|
|
|
// IsAdmin 判断用户是否是超级管理员
|
|
func IsAdmin(uid int32) bool {
|
|
if uid == 1 {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|