Commit d7d60fc6 authored by 杨思琦's avatar 杨思琦

fix: 站点获取修改

parent 4f07d3f9
Pipeline #78708 passed with stages
......@@ -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.
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