fix(qa-prevention-xgf-app): 修复考试二维码方式进入时的权限判断

- 在进入考试前增加学生入班签到状态检查
- 增加考试次数检查,防止无考试次数的用户进入考试
- 统一考试权限判断逻辑,提高系统安全性
hyx_2025-01-13_xgf2.0
wangyan 2025-03-21 17:38:40 +08:00
parent ad600e05c7
commit 2293ebfe88
2 changed files with 26 additions and 6 deletions

View File

@ -39,12 +39,12 @@
<script>
import updateVersion from '../../utils/updateVersion'
import {
setEntry,
getIsUploadFace,
getClassInfoByParams,
getClassList
} from '../../api'
import {
setEntry,
getIsUploadFace,
getClassInfoByParams,
getClassList, getExamExercises
} from '../../api'
import {
getStudentInfoApi,
setEntryV1
@ -217,6 +217,22 @@
// [type: 3 --> ]
if (store.getters.getVerification === '1') {
if (this.classInfo) {
if (this.classInfo.studystate !== "3") {
uni.$u.toast("您还未入班签到,无法考试!")
return;
}
if (this.classInfo.stageexamstate === "3") {
uni.$u.toast("您已经考试通过,无需再次考试!")
return;
}
const resData = await getExamExercises({
stageexampaperinputId,
classId,
})
if (resData.numberofexams <= 0) {
uni.$u.toast("您的考试次数已用尽,无法再次考试!")
return;
}
uni.$u.route({
url: '/pages/train_management/face_authentication',
params: {

View File

@ -145,6 +145,10 @@ export default {
// [type: 3 --> ]
if (classInfo) {
console.log('classInfo :>> ', classInfo);
if (classInfo.studystate !== "3") {
uni.$u.toast("您还未入班签到,无法考试!")
return;
}
if (classInfo.stageexamstate === "3") {
uni.$u.toast("您已经考试通过,无需再次考试!")
return;