提交 c1ef4a70 authored 作者: lihuihui's avatar lihuihui

fix: 修改bug

上级 5e81c5d8
......@@ -30,7 +30,7 @@ export function getUser() {
}
// 修改用户信息
export function updateUser(data) {
return httpRequest.post('/api/usercenter/user/update-user', data)
return httpRequest.post('/api/lms-financial/user/update-info', data)
}
// 绑定游客
export function bindVisitor(data) {
......
......@@ -89,7 +89,7 @@ export default {
disabled: false, // 是否禁用输入框
hasResult: false, // 是否显示解析
duration: 0, // 答题所用时间
countdownTimer: null, // 倒计时计时器
countdownTimerClear: null, // 倒计时计时器
countdownText: '', // 倒计时显示时间
questionGroups: this.groups, // 所有试题分组,一组一页
currentGroupPage: this.groupPage, // 大题页码
......@@ -157,30 +157,35 @@ export default {
}
},
beforeDestroy() {
clearInterval(this.countdownTimer) // 停止倒计时
clearInterval(this.countdownTimerClear) // 停止倒计时
console.log('countdownTimer111')
// clearInterval(this.countdownTimerClear) // 停止倒计时
},
methods: {
// 倒计时
countDown(time) {
let sec = parseInt(time)
clearInterval(this.countdownTimer)
this.countdownTimer = setInterval(() => {
clearInterval(this.countdownTimerClear)
// clearInterval(this.countdownTimerClear)
this.countdownTimerClear = setInterval(() => {
sec--
if (sec === 0) {
clearInterval(this.countdownTimer)
clearInterval(this.countdownTimerClear)
this.isCountDownEnd = true
this.$alert('考试时间结束,自动提交试卷', '', {
confirmButtonText: '确定',
callback: action => {
this.submit()
}
}) // 是否显示解析
// this.$alert('考试时间结束,自动提交试卷', '', {
// confirmButtonText: '确定',
// callback: action => {
// this.submit()
// }
// }) // 是否显示解析
return false
}
this.countdownText = this.secondToDate(sec) // 倒计时显示时间
this.duration++
this.$emit('timeupdate', this.duration, this.questionGroups)
}, 1000)
// clearInterval(this.countdownTimerClear)
},
secondToDate(result) {
const h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600)
......
......@@ -30,7 +30,7 @@ export function getUser() {
}
// 修改用户信息
export function updateUser(data) {
return httpRequest.post('/api/usercenter/user/update-user', data)
return httpRequest.post('/api/lms-financial/user/update-info', data)
}
// 绑定游客
export function bindVisitor(data) {
......
......@@ -10,10 +10,10 @@
<countdown slot="suffix" size="mini" @start="handlePhoneCode" ref="countdown"></countdown>
</el-input>
</el-form-item>
<div style="margin-bottom: 10px; margin-top: 40px; text-align: right">
<!-- <div style="margin-bottom: 10px; margin-top: 40px; text-align: right">
<span>如手机无法收到验证码,请选择</span>
<el-button @click="handleEmailCode">注册邮箱接收验证码</el-button>
</div>
</div> -->
<template v-if="isEmail">
<!-- <p>请前往邮箱获取验证码后,</p> -->
<el-form-item label="输入验证码" prop="code">
......
......@@ -66,7 +66,8 @@ export default {
noticeTimes: null,
noticeText: '我已阅读,开始考试(20秒)',
isRead: false,
curExamId: ''
curExamId: '',
curExamTitle: ''
}
},
mounted() {
......@@ -75,11 +76,19 @@ export default {
})
},
methods: {
dataInit(callBack) {
api.getExamList().then(response => {
if (callBack) {
callBack(response)
}
})
},
goPage() {
this.$router.push({
path: '/exam/exam/exam',
query: {
id: this.curExamId
id: this.curExamId,
title: this.curExamTitle
}
})
},
......@@ -113,8 +122,28 @@ export default {
case 101:
this.dialogVisible = true
this.curExamId = data.id
this.curExamTitle = data.paper_title
break
case 102:
api.getExamList().then((res) => {
const findTimes = res.data.find(id => id.id === data.id).remaining_times_s
if (findTimes < 5) {
this.$alert('考试时间已到', {
confirmButtonText: '查看结果',
callback: action => {
if (action === 'confirm') {
this.$router.push({
path: '/exam/exam/result',
query: {
exam_id: data.id,
title: data.paper_title,
is_create: 1
}
})
}
}
})
} else {
this.$router.push({
path: '/exam/exam/exam',
query: {
......@@ -123,6 +152,8 @@ export default {
title: data.paper_title
}
})
}
})
break
case 103:
this.$router.push({
......
......@@ -10,7 +10,7 @@ VueRouter.prototype.push = function push(location, onResolve, onReject) {
}
const routes = [
{ path: '*', redirect: '/index' },
{ path: '/index', redirect: '/notice' },
{ path: '/', redirect: '/notice' }
]
......
......@@ -56,7 +56,7 @@ httpRequest.interceptors.response.use(
if (status === 403) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
} else if (status === 401) {
router.push('/index')
router.push('/notice')
} else {
Message.error(message || error.response.data)
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论