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
abbd2d83
Commit
abbd2d83
authored
Mar 08, 2022
by
崔佳豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 清除重复监听loginSuccess后,无法切换站点问题
parent
6b81c4d5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
28 deletions
+18
-28
Site.js
src/layouts/Site.js
+4
-0
index.js
src/pages/bootpage/index.js
+10
-21
index.less
src/pages/bootpage/index.less
+4
-6
login.js
src/pages/user/login/login.js
+0
-1
No files found.
src/layouts/Site.js
View file @
abbd2d83
...
@@ -14,6 +14,8 @@ import { appService } from '../api';
...
@@ -14,6 +14,8 @@ import { appService } from '../api';
import
CitySelector
from
'../components/CitySelector'
;
import
CitySelector
from
'../components/CitySelector'
;
import
Login
from
'../pages/user/login/login'
;
import
Login
from
'../pages/user/login/login'
;
import
styles
from
'./UserLayout.less'
;
import
styles
from
'./UserLayout.less'
;
import
{
initMicroApps
}
from
'@/micro'
;
const
{
Link
}
=
Anchor
;
const
{
Link
}
=
Anchor
;
...
@@ -343,6 +345,8 @@ class Site {
...
@@ -343,6 +345,8 @@ class Site {
// eslint-disable-next-line no-unused-expressions
// eslint-disable-next-line no-unused-expressions
self
.
props
.
updateCurrentIndex
&&
self
.
props
.
updateCurrentIndex
(
0
);
self
.
props
.
updateCurrentIndex
&&
self
.
props
.
updateCurrentIndex
(
0
);
initMicroApps
();
// 切换站点后,重置掉三级菜单
// 切换站点后,重置掉三级菜单
const
homeType
=
self
.
globalConfig
.
homeType
||
'civweb4'
;
const
homeType
=
self
.
globalConfig
.
homeType
||
'civweb4'
;
const
homePath
=
const
homePath
=
...
...
src/pages/bootpage/index.js
View file @
abbd2d83
...
@@ -58,11 +58,14 @@ const renderIndustries = (config, callback) =>
...
@@ -58,11 +58,14 @@ const renderIndustries = (config, callback) =>
}
}
});
});
let
loginAction
=
null
;
//
let loginAction = null;
const
BootPage
=
props
=>
{
const
BootPage
=
props
=>
{
const
[
loadding
,
setLoadding
]
=
useState
(
false
);
const
[
loadding
,
setLoadding
]
=
useState
(
false
);
const
[
hasRole
,
setHasRole
]
=
useState
(
false
);
const
[
hasRole
,
setHasRole
]
=
useState
(
false
);
const
[
scale
,
setScale
]
=
useState
(
1
);
const
[
scale
,
setScale
]
=
useState
(
1
);
const
[
loginAction
,
setAction
]
=
useState
(
()
=>
new
LoginAction
(
props
),
);
const
history
=
useHistory
();
const
history
=
useHistory
();
useDocumentTitle
(
useDocumentTitle
(
{
title
:
defaultSetting
.
title
,
id
:
''
,
pageName
:
'行业切换'
},
{
title
:
defaultSetting
.
title
,
id
:
''
,
pageName
:
'行业切换'
},
...
@@ -80,18 +83,6 @@ const BootPage = props => {
...
@@ -80,18 +83,6 @@ const BootPage = props => {
props
.
instance
&&
props
.
instance
.
updateConfig
(
config
);
props
.
instance
&&
props
.
instance
.
updateConfig
(
config
);
// props.instance && props.instance.getUserInfoAndConfig('', true, type);
// props.instance && props.instance.getUserInfoAndConfig('', true, type);
loginAction
&&
loginAction
.
getUserInfoAndConfig
(
''
,
true
,
type
);
loginAction
&&
loginAction
.
getUserInfoAndConfig
(
''
,
true
,
type
);
// eslint-disable-next-line no-shadow
// loginAction.events.on('toggleIndustry', event => {
// setLoadding(false);
// // props.history.push(`/?client=${props.global.client}`);
// debugger
// initMicroApps();
// // 加载首页
// history.push(props.global.homepage ?? `/?client=${props.global.client}`);
// window.share.event.emit('triggerMicro', props.global);
// props.updateCurrentIndex(0);
// // window.location.reload();
// });
},
[]);
},
[]);
useEffect
(()
=>
{
useEffect
(()
=>
{
// eslint-disable-next-line no-use-before-define
// eslint-disable-next-line no-use-before-define
...
@@ -106,22 +97,20 @@ const BootPage = props => {
...
@@ -106,22 +97,20 @@ const BootPage = props => {
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
window
.
addEventListener
(
'resize'
,
handleResize
);
window
.
addEventListener
(
'resize'
,
handleResize
);
loginAction
=
new
LoginAction
(
props
);
loginAction
.
events
.
on
(
'toggleIndustry'
,
event
=>
{
const
handleToggleIndustry
=
event
=>
{
setLoadding
(
false
);
setLoadding
(
false
);
props
.
history
.
push
(
`/?client=
${
props
.
global
.
client
}
`
);
props
.
history
.
push
(
`/?client=
${
props
.
global
.
client
}
`
);
initMicroApps
();
initMicroApps
();
// 加载首页
// history.push(props.global.homepage ?? `/?client=${props.global.client}`);
window
.
share
.
event
.
emit
(
'triggerMicro'
,
props
.
global
);
window
.
share
.
event
.
emit
(
'triggerMicro'
,
props
.
global
);
props
.
updateCurrentIndex
(
0
);
props
.
updateCurrentIndex
(
0
);
// window.location.reload();
}
}
);
loginAction
.
events
.
on
(
'toggleIndustry'
,
handleToggleIndustry
);
return
()
=>
{
return
()
=>
{
window
.
removeEventListener
(
'resize'
,
handleResize
);
window
.
removeEventListener
(
'resize'
,
handleResize
);
loginAction
.
events
.
remove
AllListeners
(
'toggleIndustry'
);
loginAction
.
events
.
remove
Listener
(
'toggleIndustry'
,
handleToggleIndustry
);
};
};
});
}
,
[]
);
const
renderIndustr
=
useMemo
(
const
renderIndustr
=
useMemo
(
()
=>
renderIndustries
(
props
.
global
,
handlePage
),
()
=>
renderIndustries
(
props
.
global
,
handlePage
),
[],
[],
...
...
src/pages/bootpage/index.less
View file @
abbd2d83
...
@@ -53,12 +53,10 @@
...
@@ -53,12 +53,10 @@
width: 2px;
width: 2px;
}
}
.bootPageUl {
.bootPageUl {
// display: flex;
display: flex;
// width: 1280px;
width: 1280px;
// flex-wrap: wrap;
flex-wrap: wrap;
// justify-content: center;
justify-content: center;
display: grid;
grid-template-columns: repeat(4, 25%);
list-style: none;
list-style: none;
transition: all .5s ease-out;
transition: all .5s ease-out;
overflow: hidden;
overflow: hidden;
...
...
src/pages/user/login/login.js
View file @
abbd2d83
...
@@ -857,7 +857,6 @@ class Login {
...
@@ -857,7 +857,6 @@ class Login {
}
}
login
(
usr
,
pwd
,
userPhone
,
isRememberPWD
,
mode
=
SERVICE_APP_LOGIN_MODE
.
password
)
{
login
(
usr
,
pwd
,
userPhone
,
isRememberPWD
,
mode
=
SERVICE_APP_LOGIN_MODE
.
password
)
{
this
.
events
.
removeAllListeners
(
'loginError'
);
const
self
=
this
;
const
self
=
this
;
if
(
window
.
globalConfig
&&
window
.
globalConfig
.
hasGateWay
)
{
if
(
window
.
globalConfig
&&
window
.
globalConfig
.
hasGateWay
)
{
usr
=
userPhone
?
userPhone
:
usr
;
usr
=
userPhone
?
userPhone
:
usr
;
...
...
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