package com.ylx.common.component;

import cn.hutool.core.util.ObjectUtil;
import com.ylx.common.utils.SecurityUtils;
import org.springframework.stereotype.Component;

/**
 * 自定义商家权限校验类
 */
@Component("merchantAuth")
public class MerchantAuth {

    private static final Integer MERCHANT = 1;

    public boolean isMerchant() {
        Integer role = SecurityUtils.getWxLoginUser().getRole();
        return ObjectUtil.equals(MERCHANT, role);
    }

}
