From d335837f34fc41bcf407fc1b23004e84db489b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=89?= <940119273@qq.com> Date: Wed, 3 Jul 2024 08:12:16 +0000 Subject: [PATCH] =?UTF-8?q?!2853=20=E5=BC=80=E5=8F=91:=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E7=89=88=E6=9C=AC=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- src/index.tsx | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) 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;