apifm-admin 26.6.2 → 26.6.3

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/dist/index.cjs CHANGED
@@ -62121,11 +62121,15 @@ function resolveAdapter() {
62121
62121
  }
62122
62122
  if (typeof uni !== 'undefined' && typeof uni.request === 'function') {
62123
62123
  return (options) => new Promise((resolve, reject) => {
62124
+ const isGet = options.method === 'GET'
62124
62125
  uni.request({
62125
62126
  url: options.url,
62126
62127
  method: options.method,
62127
- data: options.data,
62128
- header: options.headers,
62128
+ data: isGet ? undefined : encodeForm(options.data),
62129
+ header: {
62130
+ 'content-type': 'application/x-www-form-urlencoded',
62131
+ ...options.headers
62132
+ },
62129
62133
  success: (res) => resolve(res.data),
62130
62134
  fail: reject
62131
62135
  })
@@ -62133,11 +62137,15 @@ function resolveAdapter() {
62133
62137
  }
62134
62138
  if (typeof wx !== 'undefined' && typeof wx.request === 'function') {
62135
62139
  return (options) => new Promise((resolve, reject) => {
62140
+ const isGet = options.method === 'GET'
62136
62141
  wx.request({
62137
62142
  url: options.url,
62138
62143
  method: options.method,
62139
- data: options.data,
62140
- header: options.headers,
62144
+ data: isGet ? undefined : encodeForm(options.data),
62145
+ header: {
62146
+ 'content-type': 'application/x-www-form-urlencoded',
62147
+ ...options.headers
62148
+ },
62141
62149
  success: (res) => resolve(res.data),
62142
62150
  fail: reject
62143
62151
  })
@@ -62145,13 +62153,14 @@ function resolveAdapter() {
62145
62153
  }
62146
62154
  if (typeof fetch === 'function') {
62147
62155
  return async (options) => {
62156
+ const isGet = options.method === 'GET'
62148
62157
  const response = await fetch(options.url, {
62149
62158
  method: options.method,
62150
62159
  headers: {
62151
62160
  'Content-Type': 'application/x-www-form-urlencoded',
62152
62161
  ...options.headers
62153
62162
  },
62154
- body: options.method === 'GET' ? undefined : encodeForm(options.data)
62163
+ body: isGet ? undefined : encodeForm(options.data)
62155
62164
  })
62156
62165
  return response.json()
62157
62166
  }
package/dist/index.js CHANGED
@@ -62121,11 +62121,15 @@ function resolveAdapter() {
62121
62121
  }
62122
62122
  if (typeof uni !== 'undefined' && typeof uni.request === 'function') {
62123
62123
  return (options) => new Promise((resolve, reject) => {
62124
+ const isGet = options.method === 'GET'
62124
62125
  uni.request({
62125
62126
  url: options.url,
62126
62127
  method: options.method,
62127
- data: options.data,
62128
- header: options.headers,
62128
+ data: isGet ? undefined : encodeForm(options.data),
62129
+ header: {
62130
+ 'content-type': 'application/x-www-form-urlencoded',
62131
+ ...options.headers
62132
+ },
62129
62133
  success: (res) => resolve(res.data),
62130
62134
  fail: reject
62131
62135
  })
@@ -62133,11 +62137,15 @@ function resolveAdapter() {
62133
62137
  }
62134
62138
  if (typeof wx !== 'undefined' && typeof wx.request === 'function') {
62135
62139
  return (options) => new Promise((resolve, reject) => {
62140
+ const isGet = options.method === 'GET'
62136
62141
  wx.request({
62137
62142
  url: options.url,
62138
62143
  method: options.method,
62139
- data: options.data,
62140
- header: options.headers,
62144
+ data: isGet ? undefined : encodeForm(options.data),
62145
+ header: {
62146
+ 'content-type': 'application/x-www-form-urlencoded',
62147
+ ...options.headers
62148
+ },
62141
62149
  success: (res) => resolve(res.data),
62142
62150
  fail: reject
62143
62151
  })
@@ -62145,13 +62153,14 @@ function resolveAdapter() {
62145
62153
  }
62146
62154
  if (typeof fetch === 'function') {
62147
62155
  return async (options) => {
62156
+ const isGet = options.method === 'GET'
62148
62157
  const response = await fetch(options.url, {
62149
62158
  method: options.method,
62150
62159
  headers: {
62151
62160
  'Content-Type': 'application/x-www-form-urlencoded',
62152
62161
  ...options.headers
62153
62162
  },
62154
- body: options.method === 'GET' ? undefined : encodeForm(options.data)
62163
+ body: isGet ? undefined : encodeForm(options.data)
62155
62164
  })
62156
62165
  return response.json()
62157
62166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apifm-admin",
3
- "version": "26.6.2",
3
+ "version": "26.6.3",
4
4
  "description": "API 工厂后台接口 SDK,支持 Web、uni-app、微信小程序",
5
5
  "license": "MIT",
6
6
  "author": "",