import store from '@/store'

export function needRule(...val) {
    const userRoles = store.state.user.info.roles
    if (userRoles.includes(1)) {
        return true;
    }
    for (let i = 0; i < val.length; i++) {
        if (userRoles.includes(val[i])) {
            return true;
        }
    }
    return false;
}

export function noNeedRule(...val) {
    return !needRule(val)
}

export let isDev = import.meta.env.VITE_BASE_URL !== 'http://172.16.32.160:8706'
