美文网首页
2022-06-15(导出如果格式错误 检查responseTy

2022-06-15(导出如果格式错误 检查responseTy

作者: 依然_bc87 | 来源:发表于2022-06-20 16:24 被阅读0次

const serviceManageMent1 = interceptor({

  baseURL: `${process.env.VUE_APP_API_MANAGEMENT}`,

  responseType: 'blob'

})

/**

  * @description:监考导出

  */

  invigilatorExport: (params) => {

    return serviceManageMent1.post(`/excel/export/exam/user`,

      params

    )

  },

Study.invigilatorExport(params).then((res) => {

        const filename = '监考考生查询_' + moment().format('YYYYMMDD')

        const blob = new Blob([res], { type: 'application/vnd.ms-excel' })

        const url = window.URL.createObjectURL(blob)

        const a = document.createElement('a')

        a.download = filename + '.xlsx'

        a.href = url

        a.click()

      })

相关文章

网友评论

      本文标题:2022-06-15(导出如果格式错误 检查responseTy

      本文链接:https://www.haomeiwen.com/subject/gcjxvrtx.html