eoss-mobiles 0.2.30 → 0.2.32

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.
package/lib/flow.js CHANGED
@@ -1740,6 +1740,8 @@ var axios_ajax = function ajax(url) {
1740
1740
  var headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1741
1741
  var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
1742
1742
  var type = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'get';
1743
+ var isData = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
1744
+ var isParams = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
1743
1745
 
1744
1746
  var http = external_axios_default.a.create({
1745
1747
  baseURL: apiUrl,
@@ -1803,6 +1805,13 @@ var axios_ajax = function ajax(url) {
1803
1805
  if (config.url.search('mecp/overtime') !== -1 || config.url.search('mecp/leave') !== -1 || config.url.search('contractext') !== -1 || config.url.search('getSysParam') !== -1) {
1804
1806
  delete config.headers.deviceId;
1805
1807
  }
1808
+ if (!isData) {
1809
+ delete config.data;
1810
+ }
1811
+ if (!isParams) {
1812
+ delete config.params;
1813
+ }
1814
+
1806
1815
  return config;
1807
1816
  }, function (error) {
1808
1817
  return Promise.error(error);
@@ -1886,6 +1895,8 @@ var base = {
1886
1895
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1887
1896
  var headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1888
1897
  var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
1898
+ var isData = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1899
+ var isParams = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
1889
1900
 
1890
1901
  if (params.params && url.search('registerNew') === -1) {
1891
1902
  params.params.userId = params.params.userId ? params.params.userId : util["a" /* default */].getStorage('userId');
@@ -1904,16 +1915,18 @@ var base = {
1904
1915
  }
1905
1916
  return axios_ajax(url, {
1906
1917
  params: params
1907
- }, headers, format);
1918
+ }, headers, format, 'get', isData, isParams);
1908
1919
  },
1909
1920
  post: function post(url, params, headers, format) {
1910
- console.log(params, 'params');
1921
+ var isData = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1922
+ var isParams = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
1923
+
1911
1924
  if (params.params) {
1912
1925
  params.params.userId = params.params.userId || util["a" /* default */].getStorage('userId');
1913
1926
  } else {
1914
1927
  params.userId = params.userId || util["a" /* default */].getStorage('userId');
1915
1928
  }
1916
- return axios_ajax(url, params, headers, format, 'post');
1929
+ return axios_ajax(url, params, headers, format, 'post', isData, isParams);
1917
1930
  }
1918
1931
  };
1919
1932
  /* harmony default export */ var axios = (base);
@@ -1921,21 +1934,22 @@ var base = {
1921
1934
 
1922
1935
  var http_request = function request(options) {
1923
1936
  var fn = void 0;
1937
+ console.log(options, 'sss');
1924
1938
  switch (options.type) {
1925
1939
  case 'post':
1926
- fn = axios.post(options.url, options.params, options.headers, options.format);
1940
+ fn = axios.post(options.url, options.params, options.headers, options.format, options.isData, options.isParams);
1927
1941
  break;
1928
1942
  case 'POST':
1929
- fn = axios.post(options.url, options.params, options.headers, options.format);
1943
+ fn = axios.post(options.url, options.params, options.headers, options.format, options.isData, options.isParams);
1930
1944
  break;
1931
1945
  case 'get':
1932
- fn = axios.get(options.url, options.params, options.headers = {});
1946
+ fn = axios.get(options.url, options.params, options.headers = {}, options.format = false, options.isData = true, options.isParams = true);
1933
1947
  break;
1934
1948
  case 'GET':
1935
- fn = axios.get(options.url, options.params, options.headers = {});
1949
+ fn = axios.get(options.url, options.params, options.headers = {}, options.format = false, options.isData = true, options.isParams = true);
1936
1950
  break;
1937
1951
  default:
1938
- fn = axios.get(options.url, options.params, options.headers = {});
1952
+ fn = axios.get(options.url, options.params, options.headers = {}, options.format = false, options.isData = true, options.isParams = true);
1939
1953
  }
1940
1954
  return fn;
1941
1955
  };