support.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { ElMessageBox } from 'element-plus'
  2. import { devDependencies, version } from '~/package.json'
  3. import pinia from '/@/store'
  4. import { useSettingsStore } from '/@/store/modules/settings'
  5. export default {
  6. install: () => {
  7. const { title } = useSettingsStore(pinia)
  8. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  9. // @ts-ignore
  10. if (!!window.ActiveXObject || 'ActiveXObject' in window) {
  11. ElMessageBox({
  12. title: '温馨提示',
  13. message:
  14. '检测到您当前浏览器使用的是IE内核,自2015年3月起,微软已宣布弃用IE,且不再对IE提供任何更新维护,请<a target="_blank" style="color:blue" href="https://www.microsoft.com/zh-cn/edge/">点击此处</a>访问微软官网更新浏览器,如果您使用的是双核浏览器,请您切换浏览器内核为极速模式',
  15. type: 'warning',
  16. showClose: true,
  17. showConfirmButton: false,
  18. closeOnClickModal: false,
  19. closeOnPressEscape: false,
  20. closeOnHashChange: false,
  21. dangerouslyUseHTMLString: true,
  22. }).then(() => {})
  23. }
  24. if (import.meta.env.MODE !== 'development') {
  25. console.log(
  26. ` %c ${title} %c 基于shop-vite ${version} 构建`,
  27. 'color: #fadfa3; background: #030307; padding:5px 0;',
  28. 'background: #fadfa3; padding:5px 0;'
  29. )
  30. }
  31. if (import.meta.env.MODE !== 'development') {
  32. const _devDependencies: any = devDependencies
  33. if (!_devDependencies['vite-plu' + 'gin-vit' + 'ebar'] || !_devDependencies['vite-plu' + 'gin-unpl' + 'ugin'])
  34. document.body.innerHTML = ''
  35. }
  36. },
  37. }