@fgz/wxmini-sdk 1.0.0 → 1.0.1
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 +12 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -8
- package/dist/index.d.ts +40 -8
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
package/dist/index.cjs
CHANGED
|
@@ -1256,7 +1256,14 @@ var WxMiniBridge = class {
|
|
|
1256
1256
|
try {
|
|
1257
1257
|
const jsonMap = JSON.parse(result);
|
|
1258
1258
|
if (isWxMiniBridgeCommandResult(jsonMap)) {
|
|
1259
|
-
|
|
1259
|
+
let data = jsonMap.data;
|
|
1260
|
+
if (typeof data === "string") {
|
|
1261
|
+
try {
|
|
1262
|
+
data = JSON.parse(data);
|
|
1263
|
+
} catch (e) {
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
return data;
|
|
1260
1267
|
}
|
|
1261
1268
|
} catch (error) {
|
|
1262
1269
|
}
|
|
@@ -1449,7 +1456,7 @@ var WxMiniApi = class {
|
|
|
1449
1456
|
[WxMiniCommand.getUserProfile_BUTTON]: opts.buttonLabel,
|
|
1450
1457
|
[WxMiniCommand.getUserProfile_QUERY_TYPE]: opts.type ?? "All"
|
|
1451
1458
|
});
|
|
1452
|
-
return this.
|
|
1459
|
+
return this.executeAs(command);
|
|
1453
1460
|
}
|
|
1454
1461
|
// ========================= 手机号 =========================
|
|
1455
1462
|
/**
|
|
@@ -1461,7 +1468,7 @@ var WxMiniApi = class {
|
|
|
1461
1468
|
[WxMiniCommand.getPhoneNum_BUTTON]: opts.buttonLabel,
|
|
1462
1469
|
[WxMiniCommand.getPhoneNum_REJECT_BUTTON]: opts.rejectButtonLabel ?? null
|
|
1463
1470
|
});
|
|
1464
|
-
return this.
|
|
1471
|
+
return this.executeAs(command);
|
|
1465
1472
|
}
|
|
1466
1473
|
// ========================= 拨打电话 =========================
|
|
1467
1474
|
/**
|
|
@@ -1502,7 +1509,7 @@ var WxMiniApi = class {
|
|
|
1502
1509
|
*/
|
|
1503
1510
|
async scanCode(opts = {}) {
|
|
1504
1511
|
const command = buildCmd("scanCode" /* scanCode */, opts);
|
|
1505
|
-
return this.
|
|
1512
|
+
return this.executeAs(command);
|
|
1506
1513
|
}
|
|
1507
1514
|
// ========================= 文件操作 =========================
|
|
1508
1515
|
/**
|
|
@@ -1513,7 +1520,7 @@ var WxMiniApi = class {
|
|
|
1513
1520
|
const command = buildCmd("readLocalFile" /* readLocalFile */, opts, {
|
|
1514
1521
|
[WxMiniCommand.PARAM_FILE_PATH]: opts.filePath
|
|
1515
1522
|
});
|
|
1516
|
-
return this.
|
|
1523
|
+
return this.executeAs(command);
|
|
1517
1524
|
}
|
|
1518
1525
|
/**
|
|
1519
1526
|
* 下载文件,返回临时文件路径
|