diff --git a/config/webpack.prod.ts b/config/webpack.prod.ts index 43bee73ae..9f0e1ddb9 100644 --- a/config/webpack.prod.ts +++ b/config/webpack.prod.ts @@ -1,8 +1,7 @@ import { CleanWebpackPlugin } from "clean-webpack-plugin"; import * as webpack from 'webpack'; import { merge } from 'webpack-merge'; -import { VersionPlugin } from '../utils/VersionPlugin'; -import common, { buildVersion } from './webpack.common'; +import common from './webpack.common'; import TerserPlugin = require('terser-webpack-plugin'); const config: webpack.Configuration = merge( @@ -28,8 +27,6 @@ const config: webpack.Configuration = merge( new CleanWebpackPlugin({ cleanOnceBeforeBuildPatterns: ["*.main.js*", "*.worker.js*", "*.LICENSE.txt"] }), - //@ts-ignore - new VersionPlugin(common.output.path, buildVersion), ] } ); diff --git a/src/index.tsx b/src/index.tsx index 789d0935e..5df7c7f45 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -4,7 +4,6 @@ import { Cache, Layers, Object3D } from 'three'; import { ErrorMonitoring, ReportError } from './Common/ErrorMonitoring'; import { LogEnable, ReportErrorWrap } from './Common/Log'; import { copyTextToClipboard } from './Common/Utils'; -import { ExtrudeConfig } from './DatabaseServices/Entity/ExtrudeConfig'; import { AppToaster } from './UI/Components/Toaster'; import './UI/Css/blue.less'; import './UI/Css/golden.less'; @@ -12,45 +11,6 @@ import './UI/Css/style.less'; import './UI/Css/switchTheme.less'; import { WebCAD } from './UI/Layout/ApplicationLayout'; -declare const version: string; - -console.log(`当前版本:${version}`); -if (location.hostname !== "localhost") -{ - let headers = new Headers(); - headers.append('pragma', 'no-cache'); - headers.append('cache-control', 'no-cache'); - - let init = { - method: 'GET', - headers: headers, - }; - - let request = new Request('ver.json'); - - fetch(request, init).then(res => - { - if (!res.ok) return; - res.text().then(serverVersion => - { - if (res.status && serverVersion && version !== serverVersion) - { - document.body.style.cssText = ` - text-align: center; - display: flex; - align-items: center; - justify-content: center; - font-size: 30px; - flex-direction: column; - `; - document.body.textContent = "发现新版本,升级中!"; - location.reload(); - } - }); - }); -} - - Cache.enabled = true; //禁止用户选中 @@ -191,8 +151,7 @@ window.onload = function () ReportErrorWrap.ReportError = ReportError; - let cad = new WebCAD(); - cad.app.Editor.Prompt(`当前版本编译时间:${version}`); + new WebCAD(); }; globalThis["copy"] = (text: string) =>