From 1b42d045e092064e2524c023a28b05b67ffc1a51 Mon Sep 17 00:00:00 2001 From: John <2236313680@qq.com> Date: Mon, 20 May 2024 13:56:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=BF=87=E9=95=BF=E4=BD=93=E9=AA=8C=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Initial/components/orgInit.tsx | 1 + src/pages/Initial/index.tsx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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