标签:class res 请求 from 响应 type data ons use
附代码
//引入axios
import axios from "axios"
let http = axios.create()
//请求拦截
http.interceptors.request.use((config)=>{
return config
})
//响应拦截
http.interceptors.response.use((res)=>{
return res
})
export default http
// 引入http
import http from "./config"
let getData ={}
//封装基础地址
let baseUrl = "基础地址"
// 封装接口
getData.FindTypes = (data)=>{
return http.get(`${baseUrl}/types`,data)
}
export default getData
标签:class res 请求 from 响应 type data ons use
原文地址:https://www.cnblogs.com/AngelTp/p/13028117.html