You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
730 B
37 lines
730 B
|
1 year ago
|
package values
|
||
|
|
|
||
|
|
import (
|
||
|
|
"time"
|
||
|
|
)
|
||
|
|
|
||
|
|
// 用户身份
|
||
|
|
const (
|
||
|
|
UserRoleAdmin = iota + 1 // 管理员
|
||
|
|
UserRole1 // 1级
|
||
|
|
UserRole2 // 2级
|
||
|
|
UserRole3 // 3级
|
||
|
|
)
|
||
|
|
|
||
|
|
const (
|
||
|
|
RedisTokenEx = 60 * time.Minute
|
||
|
|
AdminToken = "lrmfe2hFQOSqvv4Z" // 常驻调用token
|
||
|
|
)
|
||
|
|
|
||
|
|
// LoginReq 登录请求
|
||
|
|
type LoginReq struct {
|
||
|
|
Account string `json:"Account" binding:"required"`
|
||
|
|
Pass string `json:"Pass" binding:"required"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// LoginResp 登录返回
|
||
|
|
// Power:权限
|
||
|
|
// Role:账户等级,1管理员
|
||
|
|
// Token:身份码,登录成功后的所有请求需在header里加入token字段以进行后续请求
|
||
|
|
// 账户id
|
||
|
|
type LoginResp struct {
|
||
|
|
Power interface{}
|
||
|
|
Token string
|
||
|
|
Role int
|
||
|
|
Id int
|
||
|
|
}
|