Comments (6)
你好,如果后端返回来一个 URL 地址,里面存储了文本内容,那怎么获取 URL 内存储的内容呢?
from blog.
你好,如果后端返回来一个 URL 地址,里面存储了文本内容,那怎么获取 URL 内存储的内容呢?
@gaoyajiang 你好,你的问题我并不是很明白,具体看你这个URL是用来做什么的。一般我们工作分几种情况:
- 后端返回文件流,可以用base64或者Blob实现下载
- 后端返回下载链接,你只需要直接将这个链接给a标签,并给一个download即可
- 后端返回文本数据,你从response内直接拿到文本数据然后处理即可,比如拿到文本然后给一个富文本编辑器渲染成HTML
不知道你是哪种情况。
from blog.
你好,我是第二种情况,但是我不下载文件,就只是想获取到文件里的内容
现在的一个新的问题是,文件链接是七牛云的,后端配置了允许跨域,但是在项目中请求七牛云的链接还是 CORS 的问题,但是在postman 就可以请求成功
from blog.
@gaoyajiang 七牛云需要配置cors,项目中需要配置proxy代理。
from blog.
项目中要怎么配置啊😭
from blog.
@gaoyajiang 18888628835 加我v,我帮你看看
from blog.
Related Issues (20)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.