eoss-mobiles 0.2.32 → 0.2.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,15 +4,7 @@ import $ from './util';
4
4
  import qs from 'qs';
5
5
  let apiUrl = $.getStorage('host');
6
6
 
7
- const ajax = (
8
- url,
9
- params = {},
10
- headers = {},
11
- format = true,
12
- type = 'get',
13
- isData = true,
14
- isParams = true
15
- ) => {
7
+ const ajax = (url, params = {}, headers = {}, format = true, type = 'get') => {
16
8
  let http = Axios.create({
17
9
  baseURL: apiUrl,
18
10
  timeout: 60000,
@@ -85,13 +77,6 @@ const ajax = (
85
77
  ) {
86
78
  delete config.headers.deviceId;
87
79
  }
88
- if (!isData) {
89
- delete config.data;
90
- }
91
- if (!isParams) {
92
- delete config.params;
93
- }
94
-
95
80
  return config;
96
81
  },
97
82
  error => {
@@ -176,14 +161,7 @@ const ajax = (
176
161
  // 响应拦截器
177
162
 
178
163
  const base = {
179
- get: (
180
- url,
181
- params = {},
182
- headers = {},
183
- format = false,
184
- isData = true,
185
- isParams = true
186
- ) => {
164
+ get: (url, params = {}, headers = {}, format = false) => {
187
165
  if (params.params && url.search('registerNew') === -1) {
188
166
  params.params.userId = params.params.userId
189
167
  ? params.params.userId
@@ -207,19 +185,17 @@ const base = {
207
185
  params
208
186
  },
209
187
  headers,
210
- format,
211
- 'get',
212
- isData,
213
- isParams
188
+ format
214
189
  );
215
190
  },
216
- post: (url, params, headers, format, isData = true, isParams = true) => {
191
+ post: (url, params, headers, format) => {
192
+ console.log(params, 'params');
217
193
  if (params.params) {
218
194
  params.params.userId = params.params.userId || $.getStorage('userId');
219
195
  } else {
220
196
  params.userId = params.userId || $.getStorage('userId');
221
197
  }
222
- return ajax(url, params, headers, format, 'post', isData, isParams);
198
+ return ajax(url, params, headers, format, 'post');
223
199
  }
224
200
  };
225
201
  export default base;