All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.macrocloud.kernel.jwt.props.JwtProperties Maven / Gradle / Ivy

package org.macrocloud.kernel.jwt.props;

import lombok.Data;
import org.macrocloud.kernel.jwt.constant.JwtConstant;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * JWT配置
 *
 */
@Data
@ConfigurationProperties("kernel.token")
public class JwtProperties {

	/**
	 * token是否有状态
	 */
	private Boolean state = Boolean.FALSE;

	/**
	 * 是否只可同时在线一人
	 */
	private Boolean single = Boolean.FALSE;

	/**
	 * token签名
	 */
	private String signKey = JwtConstant.DEFAULT_SECRET_KEY;

	/**
	 * 获取签名规则
	 */
	public String getSignKey() {
		if (this.signKey.length() < JwtConstant.SECRET_KEY_LENGTH) {
			return JwtConstant.DEFAULT_SECRET_KEY;
		}
		return this.signKey;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy