diff --git a/package.json b/package.json index 6172a3066..e47f910c9 100644 --- a/package.json +++ b/package.json @@ -135,8 +135,8 @@ "stats.js": "^0.17.0", "swiper": "6.8.4", "three": "npm:three-cf@0.122.6", - "swiper": "6.8.4", - "xaop": "^2.1.0" + "xaop": "^2.1.0", + "core-js": "3.37.1" }, "resolutions": { "acorn": "8.8.1", diff --git a/src/index.tsx b/src/index.tsx index 1e7759c70..2e3f0abda 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,4 +1,6 @@ import { Intent } from '@blueprintjs/core'; +import 'core-js/features/object/has-own'; +import React from 'react'; import { Cache, Layers, Object3D } from 'three'; import { HostApplicationServices } from './ApplicationServices/HostApplicationServices'; import { ColorPalette } from './Common/ColorPalette'; @@ -142,6 +144,31 @@ window.onload = function () return false; } + function CheckChromeVer93(): string + { + try + { + const browser = detect(); + if (browser.name === "chrome" || browser.name === "edge-chromium") + { + let ver = parseInt(browser.version.split(".")[0]); + + if (browser.os === "Windows 7") + { + if (ver < 93) + return "https://dl.google.com/release2/chrome/czao2hrvpk5wgqrkz4kks5r734_109.0.5414.120/109.0.5414.120_chrome_installer.exe"; + } + else if (ver < 93) + return "https://www.google.cn/chrome/"; + } + return "";//其他浏览器?? + } + catch (error) + { + } + return ""; + } + let isWebGlSupport = isWebGLAvailable(); let isChromeVerSupport = CheckChromeVer(); if (!isWebGlSupport || !isChromeVerSupport) @@ -182,8 +209,27 @@ window.onload = function () else if (window.location.hostname === "localhost") ReportErrorWrap.IsProduction = false; else + { ReportErrorWrap.IsProduction = true; + let linkUrl = CheckChromeVer93(); + if (linkUrl) + { + let logVer = AppToaster.show({ + message: <> + 当前浏览器版本较低,为了更好的体验产品,点击 + + 最新浏览器 + , + timeout: 30000, + }, "logVer"); + } + } + Object3D.DefaultMatrixAutoUpdate = false; Layers.prototype.test = (layers) => true;