添加jwt配置

This commit is contained in:
zhangwenjian committed 2020-04-13 00:11:29 +08:00
1 parent 958c2d332f
commit 531cc6926d
4 files changed
+615 -999

No files matched your search

+19
View File
@@ -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)