/* * @Author: your name * @Date: 2022-03-03 18:04:40 * @LastEditTime: 2022-03-04 11:18:43 * @LastEditors: Please set LastEditors * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/reports/index.tsx */ import { useEffect, useState } from 'react'; import { useModel } from 'umi'; import { Skeleton } from 'antd'; export default () => { const { initialState, setInitialState } = useModel('@@initialState'); const [specialPageUrl, setspecialPageUrl] = useState(undefined); const [loading, setloading] = useState(false); const onLoadhandle = () => { setloading(false); }; useEffect(() => { setloading(true); if (initialState && initialState.spacicalPageParamsType && initialState.userData) { const { spacicalPageParamsType, userData: { youshuToken }, } = initialState; const { pathname } = location; const spacialPage = spacicalPageParamsType.filter((t) => t.path == pathname); // console.log({pathname,spacialPage,spacicalPageParamsType,initialState}); if (spacialPage.length > 0) { //当前页面属于有数数据展示页面 console.log(`${spacialPage[0].url}&token=${youshuToken}`); const url = `${spacialPage[0].url}&token=${youshuToken}`; setspecialPageUrl(url); } } }, [initialState]); return ( <> ); };