Commit ed789439 authored by 邓晓峰's avatar 邓晓峰

feat: delete webpack build chunkhash

parent 785cade3
......@@ -4,9 +4,9 @@ module.exports = {
dev: {
'/CityInterface': {
// target: 'http://192.168.10.151:8055',
target: 'https://panda-water.cn',
// target: 'https://panda-water.cn',
// target: 'http://192.168.19.102:8055',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.10.150:8050',
// target: 'http://192.168.19.103:8112',
// target: 'http://192.168.12.8:8098',
......@@ -21,9 +21,9 @@ module.exports = {
},
'/cityinterface': {
// target: 'http://192.168.10.150:8050',
target: 'https://panda-water.cn',
// target: 'https://panda-water.cn',
// target: 'http://192.168.19.102:8055',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.10.20:8888',
changeOrigin: true,
......@@ -38,9 +38,9 @@ module.exports = {
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.151:8055',
target: 'https://panda-water.cn',
// target: 'https://panda-water.cn',
// target: 'http://192.168.19.102:8055',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.10.150:8050',
changeOrigin: true,
headers: {
......
......@@ -2,10 +2,10 @@ module.exports = {
dev: {
'/CityInterface': {
// target: 'http://192.168.10.151:8055',
target: 'https://panda-water.cn',
// target: 'https://panda-water.cn',
// target: 'http://192.168.19.102:8055',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.10.150:8050',
// target: 'http://192.168.19.103:8112',
// target: 'http://192.168.12.8:8098',
......@@ -20,9 +20,9 @@ module.exports = {
},
'/cityinterface': {
// target: 'http://192.168.10.150:8050',
target: 'https://panda-water.cn',
// target: 'https://panda-water.cn',
// target: 'http://192.168.19.102:8055',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.10.20:8888',
changeOrigin: true,
......@@ -37,9 +37,9 @@ module.exports = {
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.151:8055',
target: 'https://panda-water.cn',
// target: 'https://panda-water.cn',
// target: 'http://192.168.19.102:8055',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.10.150:8050',
changeOrigin: true,
headers: {
......
......@@ -97,7 +97,9 @@ module.exports = function (options) {
loader: 'url-loader',
options: {
// Inline files smaller than 10 kB
limit: 10 * 1024
limit: 10 * 1024,
name: '[name].[ext]',
outputPath: 'images/'
}
} // {
// loader: 'image-webpack-loader',
......
......@@ -22,8 +22,8 @@ module.exports = require('./webpack.base.babel')({
entry: [require.resolve('react-app-polyfill/ie11'), path.join(process.cwd(), 'src/app.js')],
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
output: {
filename: '[name].[chunkhash].js',
chunkFilename: '[name].[chunkhash].chunk.js'
filename: '[name].js',
chunkFilename: '[name].chunk.js'
},
optimization: {
minimize: true,
......
......@@ -113,6 +113,8 @@ module.exports = options => ({
options: {
// Inline files smaller than 10 kB
limit: 10 * 1024,
name: '[name].[ext]',
outputPath: 'images/'
},
},
// {
......
......@@ -18,8 +18,8 @@ module.exports = require('./webpack.base.babel')({
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
output: {
filename: '[name].[chunkhash].js',
chunkFilename: '[name].[chunkhash].chunk.js',
filename: '[name].js',
chunkFilename: '[name].chunk.js',
},
optimization: {
......
......@@ -28,6 +28,7 @@ export class AlarmContent {
const Alarm = ({ message, confirmRead }) => {
let alarmContent = message.infoContent;
const goPath = item => {
debugger
confirmRead(false, [message.id]);
const widgetID = "widget_city_综合运营_管网监控_实时监控_报警监控";
const webPath = item.webPath || "product/scada/AlertMonitoring/AlertMonitoring";
......
......@@ -25,6 +25,7 @@ export class CaseContent {
const Case = ({ message, confirmRead }) => {
let caseContent = message.infoContent;
const goPath = (item) => {
debugger
confirmRead(false,[message.id]);
const messageType = item.messType;
let label = '', widgetID = '';
......
......@@ -22,6 +22,7 @@ export class NoticeContent {
const Notice = ({ message, confirmRead }) => {
let noticeContent = message.infoContent;
const goPath = (item) => {
debugger
confirmRead(false,[message.id]);
let webPath = item.webPath || "product/notification/HistoryNotice/HistoryNotice";
window.share.event.emit("listenerMointer", {
......
......@@ -19,7 +19,7 @@
display: block;
flex: 1 1 0%;
position: absolute;
z-index: 15;
z-index: 30;
background-color: rgba(0,21,41, 0.94);
min-width: 500px;
max-width: 640px;
......
......@@ -37,7 +37,7 @@ var initMicroApps = function initMicroApps(loader) {
item.props = {
emitter: window.share.event,
baseRoot: item.name,
globalConfig: JSON.stringify(createStoreage.get('globalConfig') || {}),
globalConfig: createStoreage.get('globalConfig'),
XMLHttpRequest: window.XMLHttpRequest
};
return item;
......@@ -67,6 +67,15 @@ var initMicroApps = function initMicroApps(loader) {
}],
afterUnmount: [function (app) {}]
});
var _initGlobalState = (0, _qiankun.initGlobalState)({
globalConfig: createStoreage.get('globalConfig')
}),
setGlobalState = _initGlobalState.setGlobalState;
setGlobalState({
globalConfig: createStoreage.get('globalConfig')
});
(0, _qiankun.start)({
sandbox: {
experimentalStyleIsolation: true,
......
......@@ -438,7 +438,7 @@
position: absolute;
top: calc(50% - 32px);
right: -27px;
z-index: 99;
z-index: 20;
line-height: 46px;
border-width: 9px 9px 9px 20px;
border-style: solid;
......
import {
addGlobalUncaughtErrorHandler,
initGlobalState,
registerMicroApps,
runAfterFirstMounted,
setDefaultMountApp,
......@@ -34,7 +35,7 @@ export const initMicroApps = loader => {
item.props = {
emitter: window.share.event,
baseRoot: item.name,
globalConfig: JSON.stringify(createStoreage.get('globalConfig') || {}),
globalConfig: createStoreage.get('globalConfig'),
XMLHttpRequest: window.XMLHttpRequest,
};
return item;
......@@ -94,6 +95,12 @@ export const initMicroApps = loader => {
],
},
);
const { setGlobalState } = initGlobalState({
globalConfig: createStoreage.get('globalConfig')
});
setGlobalState({
globalConfig: createStoreage.get('globalConfig')
})
start({
sandbox: {
experimentalStyleIsolation: true,
......
......@@ -30,7 +30,7 @@ var REDIRECT_URI = "https://panda-water.com/civbase/user/login";
var Login =
/*#__PURE__*/
function () {
function Login(props, callback) {
function Login(props, callback, isInit) {
_classCallCheck(this, Login);
this.events = window.share.event;
......@@ -40,7 +40,11 @@ function () {
this.history = props.history;
this.callback = callback;
this.hasTry = false;
if (isInit) {
this.init();
} //
}
_createClass(Login, [{
......@@ -75,6 +79,7 @@ function () {
}, {
key: "getToweb",
value: function getToweb(token) {
debugger;
this.globalConfig.token = token;
var self = this;
Http.getUserInfo({
......@@ -85,6 +90,8 @@ function () {
}, {
ignoreSite: true
}).then(function (response) {
debugger;
if (response && !response.errMsg) {
self.globalConfig.userInfo = {};
......@@ -126,7 +133,9 @@ function () {
if (this.globalConfig.userInfo.Groups && this.globalConfig.userInfo.Groups.length) {
this.globalConfig.userInfo.Groups.forEach(function (group) {
if (group.industry && _this2.globalConfig.userInfo.Industries.indexOf(group.industry) < 0) _this2.globalConfig.userInfo.Industries.push(group.industry);
if (group.industry && _this2.globalConfig.userInfo.Industries.indexOf(group.industry) < 0) {
_this2.globalConfig.userInfo.Industries.push(group.industry);
}
});
}
......@@ -160,7 +169,7 @@ function () {
style: self.globalConfig.style
});
self.updateConfig && self.updateConfig(self.globalConfig);
self.getProjectItems().then(function (res) {
self.getProjectItems().then(function () {
window.subSysCfg = {};
response.forEach(function (item) {
window.subSysCfg[item.client] = item;
......@@ -179,14 +188,15 @@ function () {
if (self.globalConfig.userInfo.site && self.globalConfig.userInfo.site.length > 0) {
Http.getWebSiteConfig({
client: self.globalConfig.client,
token: token,
'request.preventCache': Date.now()
token: token
}, {
ignoreSite: true
ignoreSite: true,
'request.preventCache': Date.now()
}).then(function (response) {
debugger;
if (response && response.length > 0) {
debugger;
var mainConf = response.shift();
if (mainConf.homepage) self.globalConfig.homepage = mainConf.homepage;
if (mainConf.bannerLogo) self.globalConfig.bannerLogo = mainConf.bannerLogo;
......@@ -196,16 +206,16 @@ function () {
if (mainConf.shortcutIcon) self.globalConfig.shortcutIcon = mainConf.shortcutIcon;
}
self.updateConfig && self.updateConfig(self.globalConfig);
console.log("===loginSuccess===");
self.updateConfig && self.updateConfig(self.globalConfig); // console.log("===loginSuccess===")
getIndustry ? self.events.emit('toggleIndustry') : self.events.emit('loginSuccess');
window.share.event = self.events;
self.callback && self.callback();
});
} else {
//loginSuccess
self.updateConfig && self.updateConfig(self.globalConfig);
console.log("===loginSuccess===");
self.updateConfig && self.updateConfig(self.globalConfig); // console.log("===loginSuccess===")
getIndustry ? self.events.emit('toggleIndustry') : self.events.emit('loginSuccess');
window.share.event = self.events;
self.callback && self.callback();
......@@ -474,6 +484,8 @@ function () {
cacheBust: true,
ignoreSite: true
}).then(function (response) {
debugger;
if (response && response.errMsg) {
this.globalConfig.userInfo = {};
......@@ -503,8 +515,6 @@ function () {
}, {
key: "getUserInfoAndConfig",
value: function getUserInfoAndConfig(failCallback, flag, industry) {
var _this7 = this;
debugger;
var token = this.globalConfig.token;
......@@ -512,53 +522,53 @@ function () {
var self = this;
var _industrySite = null;
debugger;
if (industry) {
debugger;
var userInfo = self.globalConfig.userInfo && self.globalConfig.userInfo.Groups && self.globalConfig.userInfo.Groups instanceof Array ? self.globalConfig.userInfo.Groups.find(function (enter) {
return enter.industry === industry;
}) : null;
if (userInfo) {
self.globalConfig.userInfo = {
site: userInfo.site ? userInfo.site : "",
site: userInfo.site ? userInfo.site : null,
Groups: self.globalConfig.userInfo.Groups
};
_industrySite = userInfo.site ? userInfo.site : null;
_industrySite = userInfo.site ? userInfo.site : null; // self.globalConfig.Industry = industry
self.updateConfig && self.updateConfig(self.globalConfig);
}
} else if (!!site && self.isSignIn) {
self.globalConfig.userInfo = {
site: decodeURIComponent((0, _jsBase.decode)(site)),
Groups: self.globalConfig.userInfo && self.globalConfig.userInfo.Groups && self.globalConfig.userInfo.Groups instanceof Array ? self.globalConfig.userInfo.Groups : null
};
}
self.updateConfig && self.updateConfig(self.globalConfig);
}
if (this.isSignIn || !!industry) {
if (self.isSignIn || !!industry) {
debugger;
Http.getUserInfo({
token: token,
subOID: 'subOID',
industry: industry,
site: _industrySite ? _industrySite : this.getLocalSiteBytoken(token),
'request.preventCache': Date.now()
site: _industrySite ? _industrySite : this.getLocalSiteBytoken(token) //self.globalConfig.userInfo.site ? self.globalConfig.userInfo.site: this.getLocalSiteBytoken(token),
//industrySite ? _industrySite : this.getLocalSiteBytoken(token),
}, {
ignoreSite: true
ignoreSite: true,
'request.preventCache': Date.now()
}).then(function (response) {
try {
if (response && !response.errMsg) {
self.globalConfig.userInfo = response; // Object.assign(
// {},
// response,
// self.globalConfig.userInfo,
// {
// site: response.site === "" ? "": self.globalConfig.userInfo.site
// }
// );
debugger;
if (response && !response.errMsg) {
self.globalConfig.userInfo = Object.assign({}, response, self.globalConfig.userInfo);
var date = new Date();
date.setTime(date.getTime() + 24 * 60 * 60 * 1000); // date = date.toGMTString();
var encodeSite = (0, _jsBase.encode)(encodeURIComponent(self.globalConfig.userInfo.site));
var encodeSite = (0, _jsBase.encode)(encodeURIComponent(response.site));
_jsCookie["default"].set("site", encodeSite, {
expires: date,
......@@ -567,10 +577,8 @@ function () {
self.globalConfig.Industry = industry;
self.updateConfig && self.updateConfig(self.globalConfig);
var loginSite = _this7.getLocalSites();
loginSite[token] = self.globalConfig.userInfo.site; // Cookie.set()
var loginSite = {};
loginSite[token] = response.site; // Cookie.set()
localStorage.setItem("loginSite", JSON.stringify(loginSite));
self.writeLogs();
......@@ -617,7 +625,7 @@ function () {
}, {
key: "login",
value: function login(usr, pwd, userPhone, isRememberPWD) {
var _this8 = this;
var _this7 = this;
this.events.removeAllListeners('loginError');
var self = this;
......@@ -635,6 +643,8 @@ function () {
}, {
ignoreSite: true
}).then(function (response) {
debugger;
if (response && response.token) {
debugger;
var token = response.token;
......@@ -642,10 +652,10 @@ function () {
_jsCookie["default"].set('token', token);
var exp = 86400000;
_this8.globalConfig.token = token;
_this7.globalConfig.token = token;
if (isRememberPWD) {
_jsCookie["default"].set(_this8.globalConfig.client, token, {
_jsCookie["default"].set(_this7.globalConfig.client, token, {
expires: exp / (24 * 60 * 60 * 1000),
path: '/'
});
......@@ -656,10 +666,10 @@ function () {
});
}
_this8.isSignIn = true;
_this8.updateConfig && _this8.updateConfig(_this8.globalConfig);
_this7.isSignIn = true;
_this7.updateConfig && _this7.updateConfig(_this7.globalConfig);
_this8.getUserInfoAndConfig();
_this7.getUserInfoAndConfig();
} else {
self.hasTry = true;
self.events.emit('loginError', response);
......
......@@ -190,6 +190,7 @@ class Login {
}).then(response => {
debugger
if (response && response.length > 0) {
debugger
var mainConf = response.shift();
if (mainConf.homepage)
self.globalConfig.homepage = mainConf.homepage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment