新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!

server_config.go 1.28 KB
package config

import "chainweaver.org.cn/chainweaver/servicecommon/encrypt"

type Service struct {
	Issuer         string `mapstructure:"issuer" json:"issuer"`
	Holder         string `mapstructure:"holder" json:"holder"`
	Did            string `mapstructure:"did" json:"did"`
	Authority      string `mapstructure:"authority" json:"authority"`           //机构路由
	Kms            string `mapstructure:"kms" json:"kms"`                       //kms服务路由
	Tdh            string `mapstructure:"tdh" json:"tdh"`                       //存证服务
	TdhProxy       string `mapstructure:"tdhProxy" json:"tdhProxy"`             //存证代理路由服务
	DidProxy       string `mapstructure:"didProxy" json:"didProxy"`             //did代理路由服务
	AuthorityProxy string `mapstructure:"authorityProxy" json:"authorityProxy"` //机构代理路由
}

// Jwt jwt相关配置
type Jwt struct {
	ExpiresTime int64  `mapstructure:"expires_time" json:"expiresTime"` // token过期时间
	Issuer      string `mapstructure:"issuer" json:"issuer"`            // 签名者
	Key         string `mapstructure:"key" json:"key"`                  // 密钥
}

func (j Jwt) GetKey() string {
	dkey, err := encrypt.DecryptString(j.Key)
	if err != nil {
		panic("decrypt Jwt key error:" + err.Error())
	}
	return dkey
}