未登录状态下导师url访问跳转登录

This commit is contained in:
谢思 2022-08-12 11:28:35 +08:00
parent 0992c716b7
commit 67f743ef0c
3 changed files with 22 additions and 15 deletions

View File

@ -86,9 +86,9 @@ const Glcc = (propsF) => {
const isStudentApplyDate = new Date().getTime() > new Date('2022-05-26').getTime() && new Date().getTime() < new Date('2022-06-25 0:0').getTime();
const secondStudentApplyDate = new Date().getTime() > new Date('2022-06-29 1:0').getTime() && new Date().getTime() < new Date('2022-06-30 0:0').getTime();
//
const checkTime1 = new Date().getTime() > new Date('2022-08-1 8:0').getTime() && new Date().getTime() < new Date('2022-08-25 24:0').getTime();
const checkTime1 = new Date().getTime() > new Date('2022-08-12 8:0').getTime() && new Date().getTime() < new Date('2022-08-25 24:0').getTime();
//
const checkTime2 = new Date().getTime() > new Date('2022-08-1 10:0').getTime() && new Date().getTime() < new Date('2022-08-25 24:0').getTime();
const checkTime2 = new Date().getTime() > new Date('2022-08-12 10:0').getTime() && new Date().getTime() < new Date('2022-08-25 24:0').getTime();
// 8260
const checkTime3 = new Date().getTime() > new Date('2022-08-26 0:0').getTime();

View File

@ -9,7 +9,7 @@ import {getMediumTermExamineInfo, submitMedium, getBriefMediumTermExamineMateria
import './index.scss';
function StudentSubmit(props){
const {form, checkedTaskId, checkTime1, studentRegId} = props;
const {form, checkedTaskId, checkTime1, studentRegId, history} = props;
const {getFieldDecorator, validateFieldsAndScroll } = form;
const [detail, setDetail] = useState(undefined);
const [reload, setReload] = useState(undefined);
@ -21,7 +21,7 @@ function StudentSubmit(props){
useEffect(()=>{
if(!checkTime1){
window.location.href="/glcc";
history.push("/glcc");
}
}, [])
@ -83,7 +83,7 @@ function StudentSubmit(props){
<div>1请各位学生<a href={`${httpUrl}/busiAttachments/download/169`} className="blueSpan">下载PPT模板</a> 根据课题开发进展按照PPT模板要求填写课题学习调研方案开发进度及开发成果下半阶段工作计划等考核材料</div>
<div>2欢迎各位学生录制本课题答辩视频将视频链接填写至下方视频介绍填写栏</div>
<div>3学生提交考核材料的时间为<span className="spanBox">2022年8月12日8点至2022年8月21日24点</span>请在截止时间前提交若在截止时间未提交中期考核表则默认自动放弃该课题将自动终止</div>
<div>4学生在<span className="spanBox">2022年8月25日0点至2022年8月25日24点</span>可在此页面查看自己考核成绩若对考核成绩有异议请及时联系导师进行更改</div>
<div>4学生在<span className="spanBox">2022年8月25日</span>可在此页面查看自己考核成绩若对考核成绩有异议请及时联系导师进行更改</div>
</div>
<div className="titleBox mt25 font-18">
<img src={img1} alt="" width={24} className="mr5"/>

View File

@ -2,7 +2,7 @@ import React, {useState, useEffect, useCallback} from "react";
import { Form, Input, Icon, Button, Tabs, Radio, message } from "antd";
import { Link } from "react-router-dom";
import bg from '../img/bgPng.png';
import { getAuditList, getMediumTermExamineInfo, submitTutorEvaluation, updateTutorEvaluation } from '../api';
import { getAuditList, getMediumTermExamineInfo, submitTutorEvaluation, updateTutorEvaluation, hasAuditRole } from '../api';
import './index.scss';
import '../check/index.scss'
import Nodata from "../../forge/Nodata";
@ -11,7 +11,7 @@ const { TabPane } = Tabs;
const { TextArea } = Input;
function TutorReview(props){
const {form, current_user, showNotification, checkTime2} = props;
const {form, current_user, showNotification, checkTime2, history} = props;
const {getFieldDecorator, setFieldsValue, validateFieldsAndScroll, resetFields } = form;
const [taskId, setTaskId] = useState();
const [taskList, setTaskList] = useState([]);
@ -23,18 +23,25 @@ function TutorReview(props){
useEffect(() => {
if(!checkTime2){
window.location.href="/glcc";
history.push("/glcc");
}else if (!current_user.login) {
history.push('/login?go_page=/glcc/middle/examination');
}else{
getAuditList({ userId: current_user.user_id, pass: 1 }).then(res => {
if (res.message === 'success') {
const filterStuNull = res.data.rows.filter(item=>{return item.studentName !== null})
setTaskList(filterStuNull);
filterStuNull.length && setTaskId(filterStuNull[0].id);
} else {
res && showNotification(res.message || '查询课题列表失败');
hasAuditRole({ userId: current_user.user_id }).then(res => {
if (!(res && res.message == 'success' && res.data.hasRole)) {
history.push('/glcc');
}
})
}
getAuditList({ userId: current_user.user_id, pass: 1 }).then(res => {
if (res.message === 'success') {
const filterStuNull = res.data.rows.filter(item=>{return item.studentName !== null})
setTaskList(filterStuNull);
filterStuNull.length && setTaskId(filterStuNull[0].id);
} else {
res && showNotification(res.message || '查询课题列表失败');
}
})
}, [])
useEffect(()=>{