Revert "V0.4.0 imporve error response"

This commit is contained in:
Marvin Zhang
2019-09-03 15:24:26 +08:00
committed by GitHub
parent e591986275
commit acccdb65bd
51 changed files with 414 additions and 1371 deletions

View File

@@ -120,22 +120,6 @@ const actions = {
commit('SET_TASK_RESULTS_TOTAL_COUNT', response.data.total)
})
},
async getTaskResultExcel ({ state, commit }, id) {
const { data } = await request.request('GET', '/tasks/' + id + '/results/download', {}, {
responseType: 'blob' // important
})
const downloadUrl = window.URL.createObjectURL(new Blob([data]))
const link = document.createElement('a')
link.href = downloadUrl
link.setAttribute('download', 'data.csv') // any other extension
document.body.appendChild(link)
link.click()
link.remove()
},
cancelTask ({ state, dispatch }, id) {
return request.post(`/tasks/${id}/cancel`)
.then(() => {