diff --git a/src/pages/Initial/components/orgInit.tsx b/src/pages/Initial/components/orgInit.tsx index 440665c..3c1a39c 100644 --- a/src/pages/Initial/components/orgInit.tsx +++ b/src/pages/Initial/components/orgInit.tsx @@ -33,6 +33,7 @@ const Index = () => { size, keyword, }, + silent: false, loadingNeedMask: true, }) .then((res) => { diff --git a/src/pages/Initial/index.tsx b/src/pages/Initial/index.tsx index 007bf51..9ac4695 100644 --- a/src/pages/Initial/index.tsx +++ b/src/pages/Initial/index.tsx @@ -12,6 +12,7 @@ import { TBizStudentGetInfo, } from 'src/utils' import useUpdateEffect from 'src/hooks/useUpdateEffect' +import Loading from 'src/components/baseBuiltComp/Loading' import OrgInit from './components/orgInit' import { getStudentInfoUrl, loginInterUrl } from './common' import GradeInit from './components/gradeInit' @@ -25,6 +26,7 @@ const Index = () => { const userState = useSelector((root: RootState) => root.userinfoModel) const orgCacheState = useSelector((root: RootState) => root.runtimeModel.organizationCache) const [isLogin, setLogin] = useState() + const [isLoading, setLoading] = useState(true) /** 用户信息 拿到token 组织 年级 班级 */ const { orgId: _orgId, @@ -87,7 +89,6 @@ const Index = () => { // 有token获取用户信息 const result = await Get({ url: getStudentInfoUrl, - loadingNeedMask: true, silent: true, }) const { code, data } = result @@ -149,6 +150,7 @@ const Index = () => { const eventMap = { back } const fn = eventMap[action] fn && fn() + setLoading(false) }) /** END */ @@ -160,8 +162,10 @@ const Index = () => { }, [isLogin]) // 未完善,跳转到组织初始化页面 + const notHaveOrg = !hasOrg const onlyHasOrg = hasOrg && !hasGrade + if (isLoading) return if (notHaveOrg) return if (onlyHasOrg || !hasClass) return return