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

fix: 修改bug

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