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

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

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