index.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  7. <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  8. <title>TODO</title>
  9. <script>
  10. function IEVersion() {
  11. var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
  12. var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
  13. var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
  14. var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
  15. if(isIE) {
  16. var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
  17. reIE.test(userAgent);
  18. var fIEVersion = parseFloat(RegExp["$1"]);
  19. if(fIEVersion == 7) {
  20. return 7;
  21. } else if(fIEVersion == 8) {
  22. return 8;
  23. } else if(fIEVersion == 9) {
  24. return 9;
  25. } else if(fIEVersion == 10) {
  26. return 10;
  27. } else {
  28. return 6;//IE版本<=7
  29. }
  30. } else if(isEdge) {
  31. return 12;//edge
  32. } else if(isIE11) {
  33. return 11; //IE11
  34. }else{
  35. return -1;//不是ie浏览器
  36. }
  37. }
  38. var version = IEVersion();
  39. if(version != -1 && version < 10) {
  40. if(window.confirm("您的浏览器版本过低,推荐使用IE10及以上浏览器或者chrome浏览器,点击确定下载chrome安装浏览器。若是360等浏览器,开启兼容模式")){
  41. window.open("/download/44.0.2403.89_chrome_installer.exe", "_blank");
  42. }
  43. }
  44. </script>
  45. </head>
  46. <body>
  47. <noscript>
  48. <strong>We're sorry but my-project doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  49. </noscript>
  50. <div id="app"></div>
  51. <!-- built files will be auto injected -->
  52. </body>
  53. </html>