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
d7d60fc6
Commit
d7d60fc6
authored
1 year ago
by
杨思琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 站点获取修改
parent
4f07d3f9
Pipeline
#78708
passed with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
15 deletions
+9
-15
BasicLayout.js
src/layouts/BasicLayout.js
+6
-3
Site.js
src/layouts/Site.js
+3
-12
No files found.
src/layouts/BasicLayout.js
View file @
d7d60fc6
...
...
@@ -326,6 +326,7 @@ const Layout = props => {
const
[
cityData
,
setCityData
]
=
useState
({});
const
[
siteLoading
,
setSiteLoading
]
=
useState
(
false
);
const
[
siteAction
,
setSiteAction
]
=
useState
(()
=>
new
Site
(
props
,
setSiteLoading
));
const
[
cityLoading
,
setCityLoading
]
=
useState
(
false
);
const
[
menuLoading
,
setMenuLoading
]
=
useState
(
true
);
const
[
subLoading
,
setSubLoading
]
=
useState
(
true
);
const
[
initWebContent
,
setInitWebContent
]
=
useState
(
false
);
...
...
@@ -387,13 +388,15 @@ const Layout = props => {
props
.
global
.
userInfo
&&
props
.
global
.
userInfo
.
token
!==
null
&&
props
.
global
.
userInfo
.
loginName
&&
Object
.
keys
(
cityData
).
length
===
0
Object
.
keys
(
cityData
).
length
===
0
&&
!
cityLoading
)
{
siteAction
.
getCityStationsForUser
().
then
(
res
=>
{
setCityLoading
(
true
);
siteAction
.
getCityStationsForUser
(
props
.
global
.
userInfo
?.
Groups
).
then
(
res
=>
{
setCityData
(
res
);
});
}
},
[
cityData
,
props
.
global
,
props
.
global
.
userInfo
,
siteAction
]);
},
[
cityData
,
cityLoading
,
props
.
global
,
props
.
global
.
userInfo
,
siteAction
]);
useEffect
(()
=>
{
if
(
window
?.
globalConfig
?.
isIntegration
>=
1
)
{
...
...
This diff is collapsed.
Click to expand it.
src/layouts/Site.js
View file @
d7d60fc6
...
...
@@ -53,20 +53,12 @@ class Site {
}
}
getCityStationsForUser
()
{
const
{
token
}
=
this
.
globalConfig
.
userInfo
;
getCityStationsForUser
(
response
)
{
const
self
=
this
;
return
new
Promise
((
resolve
,
reject
)
=>
{
// eslint-disable-next-line no-undef
appService
.
getAllGroupsInfoForUser
({
token
,
'request.preventCache'
:
new
Date
().
getTime
(),
ignoreSite
:
true
,
})
.
then
(
res
=>
{
if
(
res
&&
res
.
code
===
0
)
{
const
result
=
res
.
data
||
[];
if
(
response
)
{
const
result
=
response
||
[];
let
city
=
self
.
weatherCity
;
let
arr
=
[];
self
.
globalConfig
.
userInfo
.
groupType
=
''
;
...
...
@@ -225,7 +217,6 @@ class Site {
}
}
});
});
}
insertYSStation
()
{
...
...
This diff is collapsed.
Click to expand it.
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