
vue+axios
文章平均质量分 59
axios的使用
有蝉
文章有用的话,请点个赞啊
展开
-
Axios发送请求时params和data的区别
在使用axios时,注意到配置选项中包含params和data两者,以为他们是相同的,实则不然。 params是添加到url的请求字符串中的,用于get请求。 data是添加到请求体(body)中的, 用于post请求。 比如对于下面的get请求: axios({ method: "get", url: "http://www.tuling123.com/open...原创 2019-04-18 11:42:10 · 1077 阅读 · 0 评论 -
axios封装全局loading
import axios from 'axios' import Cookies from 'js-cookie' import router from '@/router' import qs from 'qs' import { clearLoginInfo } from '@/utils' import isPlainObject from 'lodash/isPlainObject' const http = axios.create({ baseURL: window.SITE_CONF.原创 2021-11-11 17:37:05 · 4950 阅读 · 1 评论