1、npm install axios 后 在main.js中import
import Axios from ‘axios‘Vue.prototype.$http = Axios
2、请求配置
this.$http.get( { ‘url‘:‘http://sss.com/getSysTime.do‘, ‘crossDomain‘: true, //跨域的配置项 ‘params‘: { firstName: ‘Fred‘, lastName: ‘Flintstone‘ } } ).then(function(response) { console.log(response)});
大哥,能用的话记得点推荐!
原文地址:https://www.cnblogs.com/1rookie/p/10792525.html
时间: 2024-11-06 09:59:24