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

缓存接口去掉网络提示错误

上级 3b9bcfd1
......@@ -84,7 +84,7 @@ export default class API {
_reqFail(res) {
let err = null
if (res.code === 'ECONNABORTED') {
err = new Error('网络超时,请稍后重试')
// err = new Error('网络超时,请稍后重试')
} else if (res.response) {
if (res.response.data) {
if (res.response.data.code === 0) {
......
......@@ -289,24 +289,24 @@ export default {
}
action.Exam.setCache(this.$route.params.examId, param).then(res => {
}).catch(err => {
if (err.message.indexOf('error') !== -1) {
this.$confirm('网络异常,请保持网络通畅', '提示', {
confirmButtonText: '退出考试',
cancelButtonText: '重新提交',
type: 'warning'
}).then(() => {
this.$router.replace({
path: `/login/${JSON.parse(window.localStorage.getItem('examInfo')).exam_id}`
})
}).catch(() => {
this.endExamRequest()
})
} else {
// this.$alert(err.message, {
// callback: action => {}
// })
console.log(err.message)
}
// if (err.message.indexOf('error') !== -1) {
// this.$confirm('网络异常,请保持网络通畅', '提示', {
// confirmButtonText: '退出考试',
// cancelButtonText: '重新提交',
// type: 'warning'
// }).then(() => {
// this.$router.replace({
// path: `/login/${JSON.parse(window.localStorage.getItem('examInfo')).exam_id}`
// })
// }).catch(() => {
// this.endExamRequest()
// })
// } else {
// // this.$alert(err.message, {
// // callback: action => {}
// // })
// console.log(err.message)
// }
})
},
// 标记
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论