添加jwt配置
This commit is contained in:
1 parent
958c2d332f
commit
531cc6926d
4 files changed
+615
-999
No files matched your search
@@ -0,0 +1,19 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
type Jwt struct {
|
||||
Secret string
|
||||
Timeout int64
|
||||
}
|
||||
|
||||
func InitJwt(cfg *viper.Viper) *Jwt {
|
||||
return &Jwt{
|
||||
Secret: cfg.GetString("secret"),
|
||||
Timeout: cfg.GetInt64("timeout"),
|
||||
}
|
||||
}
|
||||
|
||||
var JwtConfig = new(Jwt)
|
||||
Reference in new issue
Block a user