30 lines
631 B
Go
30 lines
631 B
Go
|
package config
|
||
|
|
||
|
import (
|
||
|
"github.com/zeromicro/go-zero/core/stores/cache"
|
||
|
"github.com/zeromicro/go-zero/rest"
|
||
|
)
|
||
|
|
||
|
type Config struct {
|
||
|
rest.RestConf
|
||
|
DataSource string
|
||
|
CacheRedis cache.CacheConf
|
||
|
JwtAuth JwtAuth // JWT 鉴权相关配置
|
||
|
VerifyCode VerifyCode
|
||
|
}
|
||
|
|
||
|
// JwtAuth 用于 JWT 鉴权配置
|
||
|
type JwtAuth struct {
|
||
|
AccessSecret string // JWT 密钥,用于签发 Token
|
||
|
AccessExpire int64 // Token 过期时间,单位为秒
|
||
|
RefreshAfter int64
|
||
|
}
|
||
|
type VerifyCode struct {
|
||
|
AccessKeyID string
|
||
|
AccessKeySecret string
|
||
|
EndpointURL string
|
||
|
SignName string
|
||
|
TemplateCode string
|
||
|
ValidTime int
|
||
|
}
|