let jessibucaPlayer = {};
//const host = location.protocol + '//' + window.location.host;
window.detail_token = Cookies.get('ELADMIN-TOEKN');
console.log('axios',axios)
window.detail_axios = axios.create({
    headers: { 'Authorization': window.detail_token }
});
window.detail_axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';

console.log('window.detail_axios',window.detail_axios)
window.detail_axios.interceptors.response.use(
    response => {
        return response
    }, error => {
        console.error(error)
        let code = 0
        try {
            code = error.response.data.status
        } catch (e) {
            if (error.toString().indexOf('Error: timeout') !== -1) {
                console.error('当前网络不佳')
                return
            }
        }
        if (!code) {
            console.error('当前网络不佳')
            return
        }
        if (code === 401) {
            alert('登录信息失效，请重新登录')
            window.open(host + '/#/login', '_self')
            return
        }
        if (code === 400 && message === '不允许访问') {
            alert('您没有权限使用此功能，请联系管理员开通')
            return
        }
    }
);

const host = location.protocol + '//' + (location.hostname === '192.168.3.38' ? '192.168.3.37' : '192.168.13.200') + ':8013';

const selfHost = location.hostname === '192.168.3.38' ? 'http://192.168.3.226:8057' : location.protocol + '//' + window.location.host;



if (!window.detail_token) {
    window.open(host + '/#/login', '_self')
    return
}

// if (this.selectedMine.mineType != 2) {
//     alert('您当前选择的不是露天矿山，请先选择露天矿山，再查看此大屏')
//     window.history.go(-1)
//     return
// }