Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
ed789439
Commit
ed789439
authored
Dec 24, 2020
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: delete webpack build chunkhash
parent
785cade3
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
95 additions
and
61 deletions
+95
-61
proxy.dev.js
config/dist/proxy.dev.js
+6
-6
proxy.js
config/proxy.js
+6
-6
webpack.base.babel.dev.js
internals/webpack/dist/webpack.base.babel.dev.js
+3
-1
webpack.prod.babel.dev.js
internals/webpack/dist/webpack.prod.babel.dev.js
+2
-2
webpack.base.babel.js
internals/webpack/webpack.base.babel.js
+2
-0
webpack.prod.babel.js
internals/webpack/webpack.prod.babel.js
+2
-2
index.js
src/components/NoticeIcon/Templates/Alarm/index.js
+1
-0
index.js
src/components/NoticeIcon/Templates/Case/index.js
+1
-0
index.js
src/components/NoticeIcon/Templates/Notice/index.js
+1
-0
index.less
src/components/SliderPanel/index.less
+1
-1
micro.dev.js
src/dist/micro.dev.js
+10
-1
UserLayout.less
src/layouts/UserLayout.less
+1
-1
micro.js
src/micro.js
+8
-1
login.dev.js
src/pages/user/login/dist/login.dev.js
+50
-40
login.js
src/pages/user/login/login.js
+1
-0
No files found.
config/dist/proxy.dev.js
View file @
ed789439
...
@@ -4,9 +4,9 @@ module.exports = {
...
@@ -4,9 +4,9 @@ module.exports = {
dev
:
{
dev
:
{
'/CityInterface'
:
{
'/CityInterface'
:
{
// target: 'http://192.168.10.151:8055',
// 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: '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.10.150:8050',
// target: 'http://192.168.19.103:8112',
// target: 'http://192.168.19.103:8112',
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.12.8:8098',
...
@@ -21,9 +21,9 @@ module.exports = {
...
@@ -21,9 +21,9 @@ module.exports = {
},
},
'/cityinterface'
:
{
'/cityinterface'
:
{
// target: 'http://192.168.10.150:8050',
// 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: '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.12.8:8098',
// target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.20:8888',
changeOrigin
:
true
,
changeOrigin
:
true
,
...
@@ -38,9 +38,9 @@ module.exports = {
...
@@ -38,9 +38,9 @@ module.exports = {
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.151:8055',
// 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: '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.10.150:8050',
changeOrigin
:
true
,
changeOrigin
:
true
,
headers
:
{
headers
:
{
...
...
config/proxy.js
View file @
ed789439
...
@@ -2,10 +2,10 @@ module.exports = {
...
@@ -2,10 +2,10 @@ module.exports = {
dev
:
{
dev
:
{
'/CityInterface'
:
{
'/CityInterface'
:
{
// target: 'http://192.168.10.151:8055',
// 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: '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.10.150:8050',
// target: 'http://192.168.19.103:8112',
// target: 'http://192.168.19.103:8112',
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.12.8:8098',
...
@@ -20,9 +20,9 @@ module.exports = {
...
@@ -20,9 +20,9 @@ module.exports = {
},
},
'/cityinterface'
:
{
'/cityinterface'
:
{
// target: 'http://192.168.10.150:8050',
// 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: '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.12.8:8098',
// target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.20:8888',
changeOrigin
:
true
,
changeOrigin
:
true
,
...
@@ -37,9 +37,9 @@ module.exports = {
...
@@ -37,9 +37,9 @@ module.exports = {
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.151:8055',
// 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: '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.10.150:8050',
changeOrigin
:
true
,
changeOrigin
:
true
,
headers
:
{
headers
:
{
...
...
internals/webpack/dist/webpack.base.babel.dev.js
View file @
ed789439
...
@@ -97,7 +97,9 @@ module.exports = function (options) {
...
@@ -97,7 +97,9 @@ module.exports = function (options) {
loader
:
'url-loader'
,
loader
:
'url-loader'
,
options
:
{
options
:
{
// Inline files smaller than 10 kB
// Inline files smaller than 10 kB
limit
:
10
*
1024
limit
:
10
*
1024
,
name
:
'[name].[ext]'
,
outputPath
:
'images/'
}
}
}
// {
}
// {
// loader: 'image-webpack-loader',
// loader: 'image-webpack-loader',
...
...
internals/webpack/dist/webpack.prod.babel.dev.js
View file @
ed789439
...
@@ -22,8 +22,8 @@ module.exports = require('./webpack.base.babel')({
...
@@ -22,8 +22,8 @@ module.exports = require('./webpack.base.babel')({
entry
:
[
require
.
resolve
(
'react-app-polyfill/ie11'
),
path
.
join
(
process
.
cwd
(),
'src/app.js'
)],
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
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
output
:
{
output
:
{
filename
:
'[name].
[chunkhash].
js'
,
filename
:
'[name].js'
,
chunkFilename
:
'[name].
[chunkhash].
chunk.js'
chunkFilename
:
'[name].chunk.js'
},
},
optimization
:
{
optimization
:
{
minimize
:
true
,
minimize
:
true
,
...
...
internals/webpack/webpack.base.babel.js
View file @
ed789439
...
@@ -113,6 +113,8 @@ module.exports = options => ({
...
@@ -113,6 +113,8 @@ module.exports = options => ({
options
:
{
options
:
{
// Inline files smaller than 10 kB
// Inline files smaller than 10 kB
limit
:
10
*
1024
,
limit
:
10
*
1024
,
name
:
'[name].[ext]'
,
outputPath
:
'images/'
},
},
},
},
// {
// {
...
...
internals/webpack/webpack.prod.babel.js
View file @
ed789439
...
@@ -18,8 +18,8 @@ module.exports = require('./webpack.base.babel')({
...
@@ -18,8 +18,8 @@ module.exports = require('./webpack.base.babel')({
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
output
:
{
output
:
{
filename
:
'[name].
[chunkhash].
js'
,
filename
:
'[name].js'
,
chunkFilename
:
'[name].
[chunkhash].
chunk.js'
,
chunkFilename
:
'[name].chunk.js'
,
},
},
optimization
:
{
optimization
:
{
...
...
src/components/NoticeIcon/Templates/Alarm/index.js
View file @
ed789439
...
@@ -28,6 +28,7 @@ export class AlarmContent {
...
@@ -28,6 +28,7 @@ export class AlarmContent {
const
Alarm
=
({
message
,
confirmRead
})
=>
{
const
Alarm
=
({
message
,
confirmRead
})
=>
{
let
alarmContent
=
message
.
infoContent
;
let
alarmContent
=
message
.
infoContent
;
const
goPath
=
item
=>
{
const
goPath
=
item
=>
{
debugger
confirmRead
(
false
,
[
message
.
id
]);
confirmRead
(
false
,
[
message
.
id
]);
const
widgetID
=
"widget_city_综合运营_管网监控_实时监控_报警监控"
;
const
widgetID
=
"widget_city_综合运营_管网监控_实时监控_报警监控"
;
const
webPath
=
item
.
webPath
||
"product/scada/AlertMonitoring/AlertMonitoring"
;
const
webPath
=
item
.
webPath
||
"product/scada/AlertMonitoring/AlertMonitoring"
;
...
...
src/components/NoticeIcon/Templates/Case/index.js
View file @
ed789439
...
@@ -25,6 +25,7 @@ export class CaseContent {
...
@@ -25,6 +25,7 @@ export class CaseContent {
const
Case
=
({
message
,
confirmRead
})
=>
{
const
Case
=
({
message
,
confirmRead
})
=>
{
let
caseContent
=
message
.
infoContent
;
let
caseContent
=
message
.
infoContent
;
const
goPath
=
(
item
)
=>
{
const
goPath
=
(
item
)
=>
{
debugger
confirmRead
(
false
,[
message
.
id
]);
confirmRead
(
false
,[
message
.
id
]);
const
messageType
=
item
.
messType
;
const
messageType
=
item
.
messType
;
let
label
=
''
,
widgetID
=
''
;
let
label
=
''
,
widgetID
=
''
;
...
...
src/components/NoticeIcon/Templates/Notice/index.js
View file @
ed789439
...
@@ -22,6 +22,7 @@ export class NoticeContent {
...
@@ -22,6 +22,7 @@ export class NoticeContent {
const
Notice
=
({
message
,
confirmRead
})
=>
{
const
Notice
=
({
message
,
confirmRead
})
=>
{
let
noticeContent
=
message
.
infoContent
;
let
noticeContent
=
message
.
infoContent
;
const
goPath
=
(
item
)
=>
{
const
goPath
=
(
item
)
=>
{
debugger
confirmRead
(
false
,[
message
.
id
]);
confirmRead
(
false
,[
message
.
id
]);
let
webPath
=
item
.
webPath
||
"product/notification/HistoryNotice/HistoryNotice"
;
let
webPath
=
item
.
webPath
||
"product/notification/HistoryNotice/HistoryNotice"
;
window
.
share
.
event
.
emit
(
"listenerMointer"
,
{
window
.
share
.
event
.
emit
(
"listenerMointer"
,
{
...
...
src/components/SliderPanel/index.less
View file @
ed789439
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
display: block;
display: block;
flex: 1 1 0%;
flex: 1 1 0%;
position: absolute;
position: absolute;
z-index:
15
;
z-index:
30
;
background-color: rgba(0,21,41, 0.94);
background-color: rgba(0,21,41, 0.94);
min-width: 500px;
min-width: 500px;
max-width: 640px;
max-width: 640px;
...
...
src/dist/micro.dev.js
View file @
ed789439
...
@@ -37,7 +37,7 @@ var initMicroApps = function initMicroApps(loader) {
...
@@ -37,7 +37,7 @@ var initMicroApps = function initMicroApps(loader) {
item
.
props
=
{
item
.
props
=
{
emitter
:
window
.
share
.
event
,
emitter
:
window
.
share
.
event
,
baseRoot
:
item
.
name
,
baseRoot
:
item
.
name
,
globalConfig
:
JSON
.
stringify
(
createStoreage
.
get
(
'globalConfig'
)
||
{}
),
globalConfig
:
createStoreage
.
get
(
'globalConfig'
),
XMLHttpRequest
:
window
.
XMLHttpRequest
XMLHttpRequest
:
window
.
XMLHttpRequest
};
};
return
item
;
return
item
;
...
@@ -67,6 +67,15 @@ var initMicroApps = function initMicroApps(loader) {
...
@@ -67,6 +67,15 @@ var initMicroApps = function initMicroApps(loader) {
}],
}],
afterUnmount
:
[
function
(
app
)
{}]
afterUnmount
:
[
function
(
app
)
{}]
});
});
var
_initGlobalState
=
(
0
,
_qiankun
.
initGlobalState
)({
globalConfig
:
createStoreage
.
get
(
'globalConfig'
)
}),
setGlobalState
=
_initGlobalState
.
setGlobalState
;
setGlobalState
({
globalConfig
:
createStoreage
.
get
(
'globalConfig'
)
});
(
0
,
_qiankun
.
start
)({
(
0
,
_qiankun
.
start
)({
sandbox
:
{
sandbox
:
{
experimentalStyleIsolation
:
true
,
experimentalStyleIsolation
:
true
,
...
...
src/layouts/UserLayout.less
View file @
ed789439
...
@@ -438,7 +438,7 @@
...
@@ -438,7 +438,7 @@
position: absolute;
position: absolute;
top: calc(50% - 32px);
top: calc(50% - 32px);
right: -27px;
right: -27px;
z-index:
99
;
z-index:
20
;
line-height: 46px;
line-height: 46px;
border-width: 9px 9px 9px 20px;
border-width: 9px 9px 9px 20px;
border-style: solid;
border-style: solid;
...
...
src/micro.js
View file @
ed789439
import
{
import
{
addGlobalUncaughtErrorHandler
,
addGlobalUncaughtErrorHandler
,
initGlobalState
,
registerMicroApps
,
registerMicroApps
,
runAfterFirstMounted
,
runAfterFirstMounted
,
setDefaultMountApp
,
setDefaultMountApp
,
...
@@ -34,7 +35,7 @@ export const initMicroApps = loader => {
...
@@ -34,7 +35,7 @@ export const initMicroApps = loader => {
item
.
props
=
{
item
.
props
=
{
emitter
:
window
.
share
.
event
,
emitter
:
window
.
share
.
event
,
baseRoot
:
item
.
name
,
baseRoot
:
item
.
name
,
globalConfig
:
JSON
.
stringify
(
createStoreage
.
get
(
'globalConfig'
)
||
{}
),
globalConfig
:
createStoreage
.
get
(
'globalConfig'
),
XMLHttpRequest
:
window
.
XMLHttpRequest
,
XMLHttpRequest
:
window
.
XMLHttpRequest
,
};
};
return
item
;
return
item
;
...
@@ -94,6 +95,12 @@ export const initMicroApps = loader => {
...
@@ -94,6 +95,12 @@ export const initMicroApps = loader => {
],
],
},
},
);
);
const
{
setGlobalState
}
=
initGlobalState
({
globalConfig
:
createStoreage
.
get
(
'globalConfig'
)
});
setGlobalState
({
globalConfig
:
createStoreage
.
get
(
'globalConfig'
)
})
start
({
start
({
sandbox
:
{
sandbox
:
{
experimentalStyleIsolation
:
true
,
experimentalStyleIsolation
:
true
,
...
...
src/pages/user/login/dist/login.dev.js
View file @
ed789439
...
@@ -30,7 +30,7 @@ var REDIRECT_URI = "https://panda-water.com/civbase/user/login";
...
@@ -30,7 +30,7 @@ var REDIRECT_URI = "https://panda-water.com/civbase/user/login";
var
Login
=
var
Login
=
/*#__PURE__*/
/*#__PURE__*/
function
()
{
function
()
{
function
Login
(
props
,
callback
)
{
function
Login
(
props
,
callback
,
isInit
)
{
_classCallCheck
(
this
,
Login
);
_classCallCheck
(
this
,
Login
);
this
.
events
=
window
.
share
.
event
;
this
.
events
=
window
.
share
.
event
;
...
@@ -40,7 +40,11 @@ function () {
...
@@ -40,7 +40,11 @@ function () {
this
.
history
=
props
.
history
;
this
.
history
=
props
.
history
;
this
.
callback
=
callback
;
this
.
callback
=
callback
;
this
.
hasTry
=
false
;
this
.
hasTry
=
false
;
if
(
isInit
)
{
this
.
init
();
this
.
init
();
}
//
}
}
_createClass
(
Login
,
[{
_createClass
(
Login
,
[{
...
@@ -75,6 +79,7 @@ function () {
...
@@ -75,6 +79,7 @@ function () {
},
{
},
{
key
:
"getToweb"
,
key
:
"getToweb"
,
value
:
function
getToweb
(
token
)
{
value
:
function
getToweb
(
token
)
{
debugger
;
this
.
globalConfig
.
token
=
token
;
this
.
globalConfig
.
token
=
token
;
var
self
=
this
;
var
self
=
this
;
Http
.
getUserInfo
({
Http
.
getUserInfo
({
...
@@ -85,6 +90,8 @@ function () {
...
@@ -85,6 +90,8 @@ function () {
},
{
},
{
ignoreSite
:
true
ignoreSite
:
true
}).
then
(
function
(
response
)
{
}).
then
(
function
(
response
)
{
debugger
;
if
(
response
&&
!
response
.
errMsg
)
{
if
(
response
&&
!
response
.
errMsg
)
{
self
.
globalConfig
.
userInfo
=
{};
self
.
globalConfig
.
userInfo
=
{};
...
@@ -126,7 +133,9 @@ function () {
...
@@ -126,7 +133,9 @@ function () {
if
(
this
.
globalConfig
.
userInfo
.
Groups
&&
this
.
globalConfig
.
userInfo
.
Groups
.
length
)
{
if
(
this
.
globalConfig
.
userInfo
.
Groups
&&
this
.
globalConfig
.
userInfo
.
Groups
.
length
)
{
this
.
globalConfig
.
userInfo
.
Groups
.
forEach
(
function
(
group
)
{
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 () {
...
@@ -160,7 +169,7 @@ function () {
style
:
self
.
globalConfig
.
style
style
:
self
.
globalConfig
.
style
});
});
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
self
.
getProjectItems
().
then
(
function
(
res
)
{
self
.
getProjectItems
().
then
(
function
()
{
window
.
subSysCfg
=
{};
window
.
subSysCfg
=
{};
response
.
forEach
(
function
(
item
)
{
response
.
forEach
(
function
(
item
)
{
window
.
subSysCfg
[
item
.
client
]
=
item
;
window
.
subSysCfg
[
item
.
client
]
=
item
;
...
@@ -179,14 +188,15 @@ function () {
...
@@ -179,14 +188,15 @@ function () {
if
(
self
.
globalConfig
.
userInfo
.
site
&&
self
.
globalConfig
.
userInfo
.
site
.
length
>
0
)
{
if
(
self
.
globalConfig
.
userInfo
.
site
&&
self
.
globalConfig
.
userInfo
.
site
.
length
>
0
)
{
Http
.
getWebSiteConfig
({
Http
.
getWebSiteConfig
({
client
:
self
.
globalConfig
.
client
,
client
:
self
.
globalConfig
.
client
,
token
:
token
,
token
:
token
'request.preventCache'
:
Date
.
now
()
},
{
},
{
ignoreSite
:
true
ignoreSite
:
true
,
'request.preventCache'
:
Date
.
now
()
}).
then
(
function
(
response
)
{
}).
then
(
function
(
response
)
{
debugger
;
debugger
;
if
(
response
&&
response
.
length
>
0
)
{
if
(
response
&&
response
.
length
>
0
)
{
debugger
;
var
mainConf
=
response
.
shift
();
var
mainConf
=
response
.
shift
();
if
(
mainConf
.
homepage
)
self
.
globalConfig
.
homepage
=
mainConf
.
homepage
;
if
(
mainConf
.
homepage
)
self
.
globalConfig
.
homepage
=
mainConf
.
homepage
;
if
(
mainConf
.
bannerLogo
)
self
.
globalConfig
.
bannerLogo
=
mainConf
.
bannerLogo
;
if
(
mainConf
.
bannerLogo
)
self
.
globalConfig
.
bannerLogo
=
mainConf
.
bannerLogo
;
...
@@ -196,16 +206,16 @@ function () {
...
@@ -196,16 +206,16 @@ function () {
if
(
mainConf
.
shortcutIcon
)
self
.
globalConfig
.
shortcutIcon
=
mainConf
.
shortcutIcon
;
if
(
mainConf
.
shortcutIcon
)
self
.
globalConfig
.
shortcutIcon
=
mainConf
.
shortcutIcon
;
}
}
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
// console.log("===loginSuccess===")
console
.
log
(
"===loginSuccess==="
);
getIndustry
?
self
.
events
.
emit
(
'toggleIndustry'
)
:
self
.
events
.
emit
(
'loginSuccess'
);
getIndustry
?
self
.
events
.
emit
(
'toggleIndustry'
)
:
self
.
events
.
emit
(
'loginSuccess'
);
window
.
share
.
event
=
self
.
events
;
window
.
share
.
event
=
self
.
events
;
self
.
callback
&&
self
.
callback
();
self
.
callback
&&
self
.
callback
();
});
});
}
else
{
}
else
{
//loginSuccess
//loginSuccess
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
// console.log("===loginSuccess===")
console
.
log
(
"===loginSuccess==="
);
getIndustry
?
self
.
events
.
emit
(
'toggleIndustry'
)
:
self
.
events
.
emit
(
'loginSuccess'
);
getIndustry
?
self
.
events
.
emit
(
'toggleIndustry'
)
:
self
.
events
.
emit
(
'loginSuccess'
);
window
.
share
.
event
=
self
.
events
;
window
.
share
.
event
=
self
.
events
;
self
.
callback
&&
self
.
callback
();
self
.
callback
&&
self
.
callback
();
...
@@ -474,6 +484,8 @@ function () {
...
@@ -474,6 +484,8 @@ function () {
cacheBust
:
true
,
cacheBust
:
true
,
ignoreSite
:
true
ignoreSite
:
true
}).
then
(
function
(
response
)
{
}).
then
(
function
(
response
)
{
debugger
;
if
(
response
&&
response
.
errMsg
)
{
if
(
response
&&
response
.
errMsg
)
{
this
.
globalConfig
.
userInfo
=
{};
this
.
globalConfig
.
userInfo
=
{};
...
@@ -503,8 +515,6 @@ function () {
...
@@ -503,8 +515,6 @@ function () {
},
{
},
{
key
:
"getUserInfoAndConfig"
,
key
:
"getUserInfoAndConfig"
,
value
:
function
getUserInfoAndConfig
(
failCallback
,
flag
,
industry
)
{
value
:
function
getUserInfoAndConfig
(
failCallback
,
flag
,
industry
)
{
var
_this7
=
this
;
debugger
;
debugger
;
var
token
=
this
.
globalConfig
.
token
;
var
token
=
this
.
globalConfig
.
token
;
...
@@ -512,53 +522,53 @@ function () {
...
@@ -512,53 +522,53 @@ function () {
var
self
=
this
;
var
self
=
this
;
var
_industrySite
=
null
;
var
_industrySite
=
null
;
debugger
;
if
(
industry
)
{
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
)
{
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
;
return
enter
.
industry
===
industry
;
})
:
null
;
})
:
null
;
if
(
userInfo
)
{
if
(
userInfo
)
{
self
.
globalConfig
.
userInfo
=
{
self
.
globalConfig
.
userInfo
=
{
site
:
userInfo
.
site
?
userInfo
.
site
:
""
,
site
:
userInfo
.
site
?
userInfo
.
site
:
null
,
Groups
:
self
.
globalConfig
.
userInfo
.
Groups
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
)
{
}
else
if
(
!!
site
&&
self
.
isSignIn
)
{
self
.
globalConfig
.
userInfo
=
{
self
.
globalConfig
.
userInfo
=
{
site
:
decodeURIComponent
((
0
,
_jsBase
.
decode
)(
site
)),
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
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
);
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
}
if
(
this
.
isSignIn
||
!!
industry
)
{
if
(
self
.
isSignIn
||
!!
industry
)
{
debugger
;
Http
.
getUserInfo
({
Http
.
getUserInfo
({
token
:
token
,
token
:
token
,
subOID
:
'subOID'
,
subOID
:
'subOID'
,
industry
:
industry
,
industry
:
industry
,
site
:
_industrySite
?
_industrySite
:
this
.
getLocalSiteBytoken
(
token
),
site
:
_industrySite
?
_industrySite
:
this
.
getLocalSiteBytoken
(
token
)
//self.globalConfig.userInfo.site ? self.globalConfig.userInfo.site: this.getLocalSiteBytoken(token),
'request.preventCache'
:
Date
.
now
()
//industrySite ? _industrySite : this.getLocalSiteBytoken(token),
},
{
},
{
ignoreSite
:
true
ignoreSite
:
true
,
'request.preventCache'
:
Date
.
now
()
}).
then
(
function
(
response
)
{
}).
then
(
function
(
response
)
{
try
{
try
{
if
(
response
&&
!
response
.
errMsg
)
{
debugger
;
self
.
globalConfig
.
userInfo
=
response
;
// Object.assign(
// {},
// response,
// self.globalConfig.userInfo,
// {
// site: response.site === "" ? "": self.globalConfig.userInfo.site
// }
// );
if
(
response
&&
!
response
.
errMsg
)
{
self
.
globalConfig
.
userInfo
=
Object
.
assign
({},
response
,
self
.
globalConfig
.
userInfo
);
var
date
=
new
Date
();
var
date
=
new
Date
();
date
.
setTime
(
date
.
getTime
()
+
24
*
60
*
60
*
1000
);
// date = date.toGMTString();
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
,
{
_jsCookie
[
"default"
].
set
(
"site"
,
encodeSite
,
{
expires
:
date
,
expires
:
date
,
...
@@ -567,10 +577,8 @@ function () {
...
@@ -567,10 +577,8 @@ function () {
self
.
globalConfig
.
Industry
=
industry
;
self
.
globalConfig
.
Industry
=
industry
;
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
var
loginSite
=
{};
var
loginSite
=
_this7
.
getLocalSites
();
loginSite
[
token
]
=
response
.
site
;
// Cookie.set()
loginSite
[
token
]
=
self
.
globalConfig
.
userInfo
.
site
;
// Cookie.set()
localStorage
.
setItem
(
"loginSite"
,
JSON
.
stringify
(
loginSite
));
localStorage
.
setItem
(
"loginSite"
,
JSON
.
stringify
(
loginSite
));
self
.
writeLogs
();
self
.
writeLogs
();
...
@@ -617,7 +625,7 @@ function () {
...
@@ -617,7 +625,7 @@ function () {
},
{
},
{
key
:
"login"
,
key
:
"login"
,
value
:
function
login
(
usr
,
pwd
,
userPhone
,
isRememberPWD
)
{
value
:
function
login
(
usr
,
pwd
,
userPhone
,
isRememberPWD
)
{
var
_this
8
=
this
;
var
_this
7
=
this
;
this
.
events
.
removeAllListeners
(
'loginError'
);
this
.
events
.
removeAllListeners
(
'loginError'
);
var
self
=
this
;
var
self
=
this
;
...
@@ -635,6 +643,8 @@ function () {
...
@@ -635,6 +643,8 @@ function () {
},
{
},
{
ignoreSite
:
true
ignoreSite
:
true
}).
then
(
function
(
response
)
{
}).
then
(
function
(
response
)
{
debugger
;
if
(
response
&&
response
.
token
)
{
if
(
response
&&
response
.
token
)
{
debugger
;
debugger
;
var
token
=
response
.
token
;
var
token
=
response
.
token
;
...
@@ -642,10 +652,10 @@ function () {
...
@@ -642,10 +652,10 @@ function () {
_jsCookie
[
"default"
].
set
(
'token'
,
token
);
_jsCookie
[
"default"
].
set
(
'token'
,
token
);
var
exp
=
86400000
;
var
exp
=
86400000
;
_this
8
.
globalConfig
.
token
=
token
;
_this
7
.
globalConfig
.
token
=
token
;
if
(
isRememberPWD
)
{
if
(
isRememberPWD
)
{
_jsCookie
[
"default"
].
set
(
_this
8
.
globalConfig
.
client
,
token
,
{
_jsCookie
[
"default"
].
set
(
_this
7
.
globalConfig
.
client
,
token
,
{
expires
:
exp
/
(
24
*
60
*
60
*
1000
),
expires
:
exp
/
(
24
*
60
*
60
*
1000
),
path
:
'/'
path
:
'/'
});
});
...
@@ -656,10 +666,10 @@ function () {
...
@@ -656,10 +666,10 @@ function () {
});
});
}
}
_this
8
.
isSignIn
=
true
;
_this
7
.
isSignIn
=
true
;
_this
8
.
updateConfig
&&
_this8
.
updateConfig
(
_this8
.
globalConfig
);
_this
7
.
updateConfig
&&
_this7
.
updateConfig
(
_this7
.
globalConfig
);
_this
8
.
getUserInfoAndConfig
();
_this
7
.
getUserInfoAndConfig
();
}
else
{
}
else
{
self
.
hasTry
=
true
;
self
.
hasTry
=
true
;
self
.
events
.
emit
(
'loginError'
,
response
);
self
.
events
.
emit
(
'loginError'
,
response
);
...
...
src/pages/user/login/login.js
View file @
ed789439
...
@@ -190,6 +190,7 @@ class Login {
...
@@ -190,6 +190,7 @@ class Login {
}).
then
(
response
=>
{
}).
then
(
response
=>
{
debugger
debugger
if
(
response
&&
response
.
length
>
0
)
{
if
(
response
&&
response
.
length
>
0
)
{
debugger
var
mainConf
=
response
.
shift
();
var
mainConf
=
response
.
shift
();
if
(
mainConf
.
homepage
)
if
(
mainConf
.
homepage
)
self
.
globalConfig
.
homepage
=
mainConf
.
homepage
;
self
.
globalConfig
.
homepage
=
mainConf
.
homepage
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment