fix: 修复取消上一次请求中存在的问题
This commit is contained in:
parent
c5d8f3aed5
commit
59678df335
|
@ -525,7 +525,10 @@ export default {
|
|||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
this.isLoading = false
|
||||
const isCancel = axios.isCancel(error)
|
||||
if(!isCancel) {
|
||||
this.isLoading = false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -561,6 +564,7 @@ export default {
|
|||
cancelLastRequest() {
|
||||
if (this._cancelToken && typeof this._cancelToken == 'function') {
|
||||
this._cancelToken()
|
||||
this._cancelToken = undefined
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -2058,6 +2062,8 @@ export default {
|
|||
this.handleResetState()
|
||||
const sampleData = await this.$store.dispatch('GET_SAMPLE_DATA', newVal.inputFileName)
|
||||
if (sampleData) {
|
||||
this.cancelLastRequest()
|
||||
this.isLoading = false
|
||||
this.dataProcess(sampleData.data, sampleData.from)
|
||||
} else {
|
||||
if (newVal.sampleId) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user