!1508 开发:移除版本校验

pull/1508/MERGE
ChenX 3 years ago
parent 954f5478a2
commit 8001f33510

@ -1,8 +1,7 @@
import { CleanWebpackPlugin } from "clean-webpack-plugin"; import { CleanWebpackPlugin } from "clean-webpack-plugin";
import * as webpack from 'webpack'; import * as webpack from 'webpack';
import { merge } from 'webpack-merge'; import { merge } from 'webpack-merge';
import { VersionPlugin } from '../utils/VersionPlugin'; import common from './webpack.common';
import common, { buildVersion } from './webpack.common';
import TerserPlugin = require('terser-webpack-plugin'); import TerserPlugin = require('terser-webpack-plugin');
const config: webpack.Configuration = merge( const config: webpack.Configuration = merge(
@ -28,8 +27,6 @@ const config: webpack.Configuration = merge(
new CleanWebpackPlugin({ new CleanWebpackPlugin({
cleanOnceBeforeBuildPatterns: ["*.main.js*", "*.worker.js*", "*.LICENSE.txt"] cleanOnceBeforeBuildPatterns: ["*.main.js*", "*.worker.js*", "*.LICENSE.txt"]
}), }),
//@ts-ignore
new VersionPlugin(common.output.path, buildVersion),
] ]
} }
); );

@ -4,7 +4,6 @@ import { Cache, Layers, Object3D } from 'three';
import { ErrorMonitoring, ReportError } from './Common/ErrorMonitoring'; import { ErrorMonitoring, ReportError } from './Common/ErrorMonitoring';
import { LogEnable, ReportErrorWrap } from './Common/Log'; import { LogEnable, ReportErrorWrap } from './Common/Log';
import { copyTextToClipboard } from './Common/Utils'; import { copyTextToClipboard } from './Common/Utils';
import { ExtrudeConfig } from './DatabaseServices/Entity/ExtrudeConfig';
import { AppToaster } from './UI/Components/Toaster'; import { AppToaster } from './UI/Components/Toaster';
import './UI/Css/blue.less'; import './UI/Css/blue.less';
import './UI/Css/golden.less'; import './UI/Css/golden.less';
@ -12,45 +11,6 @@ import './UI/Css/style.less';
import './UI/Css/switchTheme.less'; import './UI/Css/switchTheme.less';
import { WebCAD } from './UI/Layout/ApplicationLayout'; 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; Cache.enabled = true;
//禁止用户选中 //禁止用户选中
@ -191,8 +151,7 @@ window.onload = function ()
ReportErrorWrap.ReportError = ReportError; ReportErrorWrap.ReportError = ReportError;
let cad = new WebCAD(); new WebCAD();
cad.app.Editor.Prompt(`当前版本编译时间:${version}`);
}; };
globalThis["copy"] = (text: string) => globalThis["copy"] = (text: string) =>

Loading…
Cancel
Save