123456789101112131415161718192021222324252627 |
- // Copyright 2019 github.com. All rights reserved.
- // Use of this source code is governed by github.com.
- package parser
- import (
- "smart-supplier-management-gateway/config"
- "github.com/jaryhe/gopkgs/jwtwrapper"
- )
- var jwtConfig config.JwtConfig
- func JwtHandler(conf *config.Configure) {
- // jwtConfig 不为空表示已经初始化
- if jwtConfig.Secret != "" {
- // 无变化,直接返回
- if jwtConfig.Secret == conf.Jwt.Secret {
- return
- }
- }
- // 重置设置jwt secret
- jwtwrapper.SetSecret(conf.Jwt.Secret)
- jwtConfig = conf.Jwt
- }
|