|
@@ -1,12 +1,12 @@
|
|
|
-import axios from "axios"; //引入axios
|
|
|
-import sysConfig from '@/config' //引入配置文件
|
|
|
+import axios from "axios"; //引入axios
|
|
|
+import sysConfig from '@/config' //引入配置文件
|
|
|
import store from "../store/index"
|
|
|
import qs from "qs"
|
|
|
|
|
|
// console.log(process.env.NODE_ENV)
|
|
|
|
|
|
axios.defaults.baseURL = sysConfig.baseURL //设置请求时间
|
|
|
-axios.defaults.timeout = sysConfig.timeout //设置请求超时时间
|
|
|
+axios.defaults.timeout = sysConfig.timeout //设置请求超时时间
|
|
|
const ContentType = sysConfig.ContentType
|
|
|
|
|
|
//axios.defaults.headers["Content-Type"] = "application/json";
|
|
@@ -84,7 +84,7 @@ var http = {
|
|
|
* @param {*} config 请求的config相关配置
|
|
|
* @returns
|
|
|
*/
|
|
|
- get: function(url, params = {}, config = {}) {
|
|
|
+ get: function (url, params = {}, config = {}) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
axios({
|
|
|
url: url+"?"+params,
|
|
@@ -109,7 +109,7 @@ var http = {
|
|
|
* @param {*} config 请求的config相关配置
|
|
|
* @returns
|
|
|
*/
|
|
|
- post: function(url, data = {}, params = {}, config = {}) {
|
|
|
+ post: function (url, data = {}, params = {}, config = {}) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
axios({
|
|
|
url: url,
|
|
@@ -133,4 +133,5 @@ var http = {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-export default http;
|
|
|
+export default http;
|
|
|
+
|