|
@@ -3,7 +3,8 @@ import { GET_UUIONID_TOKEN,GET_TOKEN,GetInfo,InfoWatch,InfoWatchDay,
|
|
|
TeacherAllot,UnallotHomeworkList,GetTeacherDetail,
|
|
|
GetStudentDetail,GetManagerDetail,Downgrade,SuperManagerList,
|
|
|
SuperApplyTeacherList,ApplyOperate,GetTeacherSalaryList,DealCorrectTeacher,
|
|
|
- GetAllotManagerList,AllotTeacherToManager,HomeworkRecoveryList,errorWarning,errorDetail,logout
|
|
|
+ GetAllotManagerList,AllotTeacherToManager,HomeworkRecoveryList,errorWarning,errorDetail,logout,
|
|
|
+ CheckHomeworkStatus
|
|
|
} from '@/api'
|
|
|
import { APPOR_BASE_URL } from '@/ImgConfig'
|
|
|
import { getToken, setToken, removeToken } from '@/utils/auth'
|
|
@@ -39,7 +40,8 @@ const user = {
|
|
|
pictureIndex:0,
|
|
|
InfoTeacherstatues:"",
|
|
|
GetTeacherstatues:"",
|
|
|
- ApporingTeacherstatues:""
|
|
|
+ ApporingTeacherstatues:"",
|
|
|
+ currtHomeworkStatus:""
|
|
|
},
|
|
|
|
|
|
mutations: {
|
|
@@ -135,6 +137,9 @@ const user = {
|
|
|
console.log(pictureIndex)
|
|
|
state.pictureIndex = pictureIndex
|
|
|
},
|
|
|
+ SET_CURRT_HOMEWORK_STATUS:(state,currtHomeworkStatus) => {
|
|
|
+ state.currtHomeworkStatus = currtHomeworkStatus
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
actions: {
|
|
@@ -157,10 +162,12 @@ const user = {
|
|
|
localStorage.setItem("userId",userId)
|
|
|
if (isBanned == 0) {
|
|
|
if (roles == 0) {
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
Message.error('无用户角色')
|
|
|
}
|
|
|
if (roles == 1) {
|
|
|
Message.success('在线批改老师角色登录成功')
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
window.open(APPOR_BASE_URL + '?unionid=' + unionid);
|
|
|
}
|
|
|
if (roles == 2) {
|
|
@@ -174,10 +181,12 @@ const user = {
|
|
|
// router.push({path: '/super', replace: true})
|
|
|
}
|
|
|
} if (isBanned == 1) {
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
Message.error('您已被封号')
|
|
|
router.push("/");
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
Message.error('用户信息验证失败,请重新登录')
|
|
|
})
|
|
|
} else {
|
|
@@ -209,9 +218,11 @@ const user = {
|
|
|
if (isBanned == 0) {
|
|
|
if (roles == 0) {
|
|
|
Message.error('无用户角色')
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
}
|
|
|
if (roles == 1) {
|
|
|
Message.success('在线批改老师角色登录成功')
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
window.open(APPOR_BASE_URL + '?unionid=' + unionid);
|
|
|
}
|
|
|
if (roles == 2) {
|
|
@@ -227,10 +238,12 @@ const user = {
|
|
|
|
|
|
}
|
|
|
} if (isBanned == 1) {
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
Message.error('您已被封号')
|
|
|
router.push("/");
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
Message.error('用户信息验证失败,请重新登录')
|
|
|
})
|
|
|
} else {
|
|
@@ -302,6 +315,34 @@ const user = {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 质检当前作业状态
|
|
|
+ CheckCurrHomeworkStatus({ commit, state }, data) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ axios.post(CheckHomeworkStatus, data).then(response => {
|
|
|
+ const data = response.data || {}
|
|
|
+ if (response.code === '999'){
|
|
|
+ if (data.status == 3){
|
|
|
+ commit('SET_CURRT_HOMEWORK_STATUS',new Date());
|
|
|
+ resolve(response)
|
|
|
+ }
|
|
|
+ if (data.status == 1){
|
|
|
+ Message.error("当前作业还未批改,请手动刷新当前作业列表!")
|
|
|
+ resolve(response)
|
|
|
+ }
|
|
|
+ if (data.status == 2){
|
|
|
+ Message.error("当前作业正在批改中,请手动刷新当前作业列表!")
|
|
|
+ resolve(response)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (response.code === '000'){
|
|
|
+ Message.error(response.msg)
|
|
|
+ resolve(response)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ reject(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// 查看可分配老师列表
|
|
|
TeacherAllotList({ commit, state }, data) {
|
|
|
return new Promise((resolve, reject) => {
|