package com.dxhy.common.auth;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.stereotype.Component;

/**
 * @author Allen
 * @version 1.0.0
 * @ClassName AuthUtils.java
 * @Description TODO
 * @createTime 2024年06月04日 14:09:00
 */
@Component("authUtils")
@Slf4j
public class AuthUtils {
    @Autowired
    private AuthCheck authCheck;

    public boolean auth() {
        Result auth = authCheck.auth();
        if (!auth.isOk()) {
            log.error(auth.getMsg());
            log.error("系统授权失败...");
            return false;
        } else {
            return true;
        }
    }
}
