// Copyright 2019 github.com. All rights reserved. // Use of this source code is governed by github.com. package parser import ( "cp-system-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 }