Vue
Vue 相关专题
奶茶37.2℃
海纳百川有容乃大
展开
-
fetch post 下载文件
一.简介fetch 请求获取文件,然后利用 Blob 对象来接收处理,在接收到后端返回的文件后,把其转化一下,放入a标签的href中,并触发下载行为。二.流程fetch(url, { method: 'POST', body: JSON.stringify(this.dataForm), headers: { 'Content-Type': 'applica...原创 2020-02-24 22:05:33 · 968 阅读 · 0 评论 -
axios网络请求封装
import axios from 'axios';const http = axios.create({ headers: { 'content-type': 'application/json;charset=UTF-8', }, withCredentials: true});// 添加请求拦截器http.interceptors.req...原创 2020-01-06 00:05:18 · 605 阅读 · 0 评论 -
Vue proxy 代理解决开发跨域
Vue 框架开发时会遇到跨域的问题,可在config/index.js 里配置proxyTable内容,使用proxy 代理。proxyTable: { '/apiProxy':{ target:'http://localhost:9000', //设置调用的接口域名和端口号 changeOrigin:true, p...原创 2020-01-03 10:41:49 · 1201 阅读 · 0 评论