@mpxjs/api-proxy 2.10.17-beta.4 → 2.10.17-beta.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/api-proxy",
3
- "version": "2.10.17-beta.4",
3
+ "version": "2.10.17-beta.8",
4
4
  "description": "convert miniprogram API at each end",
5
5
  "module": "src/index.js",
6
6
  "types": "@types/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "homepage": "https://github.com/didi/mpx#readme",
39
39
  "dependencies": {
40
- "@mpxjs/utils": "^2.10.17",
40
+ "@mpxjs/utils": "^2.10.17-beta.0",
41
41
  "axios": "^1.7.3"
42
42
  },
43
43
  "peerDependencies": {
@@ -1,10 +1,7 @@
1
1
  import { fromByteArray, toByteArray } from './base64'
2
2
 
3
3
  function base64ToArrayBuffer (base64) {
4
- if (__mpx_mode__ === 'web') {
5
- return toByteArray(base64)?.buffer
6
- }
7
- return toByteArray(base64)
4
+ return toByteArray(base64)?.buffer // 判断了一下,RN下也是要.buffer才是buffer类型
8
5
  }
9
6
 
10
7
  function arrayBufferToBase64 (arrayBuffer) {
@@ -22,13 +22,18 @@ const getImageInfo = function (options = {}) {
22
22
  failHandle(result, fail, complete)
23
23
  return
24
24
  }
25
+ let path = ''
26
+ if (src.toLowerCase().startsWith('http')) {
27
+ path = src
28
+ }
25
29
  Image.getSize(src, (width, height) => {
26
30
  const result = {
27
31
  errMsg: 'getImageInfo:ok',
28
32
  width,
29
- height
33
+ height,
34
+ path
30
35
  }
31
- defineUnsupportedProps(result, ['path', 'orientation', 'type'])
36
+ defineUnsupportedProps(result, ['orientation', 'type'])
32
37
  successHandle(result, success, complete)
33
38
  }, (err) => {
34
39
  const result = {