package com.tiesheng.core.config.web;

import com.tiesheng.core.config.web.bean.CurrentWebUser;
import com.tiesheng.login.config.token.TsTokenConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Configuration;


/**
 * @author hao
 */
@Configuration
@ConditionalOnMissingBean(value = TieshengWebConfigurer.class, ignored = DefaultWebConfigurer.class)
public class DefaultWebConfigurer implements TieshengWebConfigurer {

    @Override
    public CurrentWebUser getCurrentUserName() {
        CurrentWebUser webUser = new CurrentWebUser();
        webUser.setId(TsTokenConfig.getWithoutThr().getId());
        webUser.setName(webUser.getId());
        return webUser;
    }

}
