The backend returns the file download address. The front end must be marked to download how to do it.

the excel address returned by the backend needs to be verified with the user ID before opening this address

then how can I put a logo on my front end when requesting this address

Mar.30,2021

can carry the authentication identity in the Http request Header.


isn't it OK to request the interface of "backend return excel address" with user ID?


Authentication can be done directly at the back end. You don't need to do anything, do you? Unless cross-server, you may need to send a key or something, just discuss the interface.


do not give the address of the file directly. First, Ajax triggers the download event, authenticates the background, and then returns a URL address with a time limit (refer to the link generated by Qiniuyun downloading files in private space), and then use JS simulation to open a new window to download.
that is, the download address of this file is generated after successful authentication when the user requests to download, and there is a time limit (for example, 1 hour).


I guess what you want to say is how to download resources through xhr . Return with the blob object, and then create a download link.
is similar to this question as https://codeshelper.com/q/10.

.
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-1b43c00-2c6be.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-1b43c00-2c6be.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?