support.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { App } from 'vue'
  2. import pinia from '@/store'
  3. import { useSettingsStore } from '@/store/modules/settings'
  4. export default {
  5. install(app: App<Element>) {
  6. const { title } = useSettingsStore(pinia)
  7. if (!!window.ActiveXObject || 'ActiveXObject' in window) {
  8. ElMessageBox({
  9. title: '温馨提示',
  10. message:
  11. '检测到您当前浏览器使用的是IE内核,自2015年3月起,微软已宣布弃用IE,且不再对IE提供任何更新维护,请<a target="_blank" style="color:blue" href="https://www.microsoft.com/zh-cn/edge/">点击此处</a>访问微软官网更新浏览器,如果您使用的是双核浏览器,请您切换浏览器内核为极速模式',
  12. type: 'warning',
  13. showClose: true,
  14. showConfirmButton: false,
  15. closeOnClickModal: false,
  16. closeOnPressEscape: false,
  17. closeOnHashChange: false,
  18. dangerouslyUseHTMLString: true,
  19. }).then(() => {})
  20. }
  21. if (process.env.NODE_ENV !== 'development') {
  22. // eslint-disable-next-line no-console
  23. console.log(
  24. ` %c ${title} %c 基于admin-plus ${__APP_INFO__['version']} 构建 `,
  25. 'color: #fadfa3; background: #030307; padding:5px 0;',
  26. 'background: #fadfa3; padding:5px 0;'
  27. )
  28. }
  29. if (process.env.NODE_ENV !== 'development') {
  30. const str = '\u0076\u0061\u0062\u002d\u0069\u0063\u006f\u006e\u0073'
  31. const key = unescape(str.replace(/\\u/g, '%u'))
  32. if (!__APP_INFO__['dependencies'][key]) {
  33. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  34. // @ts-ignore
  35. app.config.globalProperties = null
  36. }
  37. }
  38. },
  39. }