Axios downloads pictures across domains

  1. use axios in vue projects to get file streams across domains. No matter how I set responseType, it always returns string

clipboard.png

e

clipboard.png

ask for advice on how to solve the problem

Mar.15,2021

it is useless for you to set it up. If a stream is returned in the background, and you are accessing a file with a physical path, it is not a stream file.


what is the purpose of obtaining a file stream at the front end?


Brother, what you want is the url address of a picture, and then the new Image object loads


to see the header header. It may be that when console is printing, transfer the binary to String, so don't be fooled by the naked eye.


because the project does not remove mockjs and converts the original stream to characters.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e42639-64fc7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e42639-64fc7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?