NetModular.UI icon indicating copy to clipboard operation
NetModular.UI copied to clipboard

bug汇报,文件下载问题

Open yuanyc-cityfun opened this issue 4 years ago • 3 comments

https://github.com/iamoldli/NetModular.UI/blob/767702185286c1dfe6b063b5290dd84f884a0f19/packages/utils/http.js#L130 json文件的响应头 格式为application/json,会导致json文件无法下载 image

yuanyc-cityfun avatar Mar 08 '21 05:03 yuanyc-cityfun

那就不能通过if (response.data.type === 'application/json') { 来判断了?

iamoldli avatar Mar 08 '21 08:03 iamoldli

是不是把这个判断去掉就行了,感觉这里多余了,外面已经通过if (config.responseType && config.responseType === 'blob') {做了判断

iamoldli avatar Mar 08 '21 08:03 iamoldli

是的,不过我觉得最好的处理方法和私有文件下载一样,使用ControllerBase自带的文件api,这样的话前端就不需要做处理了

yuanyc-cityfun avatar Mar 23 '21 03:03 yuanyc-cityfun