
import { ElMessageBox  } from 'element-plus';

import  configInfo  from '@/stores/modules/config';
const configInfoStore = configInfo();
export function useCheckInfo() {

        if(localStorage.getItem('check') === 'false'){
            ShowError()
        }
        window.addEventListener('storage',(e)=>{
            if(e.key === 'check' && e.newValue === 'false' && e.oldValue === 'true'){
                ShowError()
            }
        })
        function ShowError(){
            if(configInfoStore.appModel === 2)  return;
            ElMessageBox({
                title:"连接出错！",
                message:'设备连接出错，请在主窗口中重新连接设备后，在重新打开此窗口后进行操作',
                showCancelButton:false,
                showConfirmButton:false,
                closeOnClickModal:false,
                closeOnPressEscape:false,
                closeOnHashChange:false
            })
        }


}
