sub_competitions

This commit is contained in:
caishi 2022-04-12 10:00:46 +08:00
parent 772b736ad6
commit 7eee378218
3 changed files with 16 additions and 14 deletions

View File

@ -124,13 +124,12 @@ const CustomOperateModel: FC<PageProps> = ({ dispatch, user, globalSetting }) =>
key: 7, key: 7,
path: '/users' path: '/users'
}] }]
useEffect(() => { // useEffect(() => {
console.log(globalSetting?.operateModelPath, user?.userInfo?.login, 11444) // console.log(globalSetting?.operateModelPath, user?.userInfo?.login, 11444)
if (!!globalSetting?.operateModelPath && user?.userInfo?.login) { // if (!!globalSetting?.operateModelPath && user?.userInfo?.login) {
getData(); // getData();
} // }
// }, [globalSetting?.operateModelPath, user?.userInfo?.login])
}, [globalSetting?.operateModelPath, user?.userInfo?.login])
useEffect(() => { useEffect(() => {
return () => { return () => {

View File

@ -57,7 +57,6 @@ const SimpleLayouts: FC<PageProps> = ({ loading, globalSetting, children, user,
useEffect(()=>{ useEffect(()=>{
delCookie("logintrustie"); delCookie("logintrustie");
console.log("清除了");
if(user?.userInfo?.profile_completed){ if(user?.userInfo?.profile_completed){
getEducoderUserInfo(); getEducoderUserInfo();
} }
@ -88,7 +87,6 @@ const SimpleLayouts: FC<PageProps> = ({ loading, globalSetting, children, user,
useEffect(() => { useEffect(() => {
delCookie("logintrustie"); delCookie("logintrustie");
console.log("清除了");
getData(); getData();
}, [location.pathname]) }, [location.pathname])
useEffect(() => { useEffect(() => {

View File

@ -171,11 +171,16 @@ const competitionDetails: FC<PageProps> = ({
let subArr = globalSetting?.setting?.sub_competitions; let subArr = globalSetting?.setting?.sub_competitions;
if(subArr.length>0){ if(subArr.length>0){
let filterArr = subArr.filter((i:any)=>i.identifier === item.identifier); let filterArr = subArr.filter((i:any)=>i.identifier === item.identifier);
console.log(filterArr);
if(filterArr && filterArr.length >0 ){ let filterlist = filterArr && filterArr.length >0 && filterArr[0].list;
if(filterArr && filterArr.length >0 && (filterlist && filterlist.length>1)){
setSubComShow(true); setSubComShow(true);
setSubComList(filterArr[0]); setSubComList(filterArr[0]);
return; return;
}else if(filterArr && filterArr.length >0 && (filterlist && filterlist.length===1)){
window.location.href=filterArr[0].list[0].url;
return;
} }
} }
} }
@ -189,9 +194,9 @@ const competitionDetails: FC<PageProps> = ({
}) })
return return
} }
// if(item.identifier === "gcc_2022_projects_type2" || item.identifier === "gcc_2022_projects_type1"){ // if(item.identifier === "gcc-courses-2022"){
// let arr = HeaderDetail.competition_modules?.filter((item:any)=>item.name === "赛事发布"); // let arr = HeaderDetail.competition_modules?.filter((item:any)=>item.name === "赛事发布");
// arr && arr.length > 0 && getrightdatas(arr[0]); // arr && arr.length > 0 && getrightdatas(arr[0]);
// return; // return;
// } // }
if (url === "ismodel") { if (url === "ismodel") {