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

io.github.ye17186.myhelper.token.customizer.SaTokenCustomize Maven / Gradle / Ivy

There is a newer version: 0.0.6
Show newest version
package io.github.ye17186.myhelper.token.customizer;

import cn.dev33.satoken.config.SaTokenConfig;
import io.github.ye17186.myhelper.token.properties.TokenProperties;

/**
 * @author ye17186
 * @since 2023-03-03
 */
public class SaTokenCustomize {

    private final SaTokenConfig config;
    private final TokenProperties properties;

    public SaTokenCustomize(SaTokenConfig config, TokenProperties properties) {

        this.config = config;
        this.properties = properties;
        customize();
    }

    private void customize() {

        config.setTokenName(properties.getTokenName());
        config.setTokenStyle(properties.getStyle().getCode());
        config.setTimeout(properties.getTimeout());
        config.setActivityTimeout(properties.getActivityTimeout());
        config.setIsReadBody(false);
        config.setIsReadCookie(false);
        config.setIsPrint(false);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy