q-koa 10.5.5 → 10.6.0

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.
@@ -11,6 +11,8 @@ const WXBizDataCrypt = require('../../services/weixinCrypt')
11
11
  const weixinArticle = require('../../services/weixinArticle')
12
12
  const fxp = require('fast-xml-parser')
13
13
  const crypto = require('crypto')
14
+ const path = require('path')
15
+ const fsPromise = require('fs/promises')
14
16
  const { getAppConfig } = require('../../utils')
15
17
 
16
18
  const check = ({ timestamp, nonce, signature, token }) => {
@@ -1566,15 +1568,13 @@ exports.profitsharing = async (ctx) => {
1566
1568
 
1567
1569
  const { mchId, key, partner_key } = await appConfig.getObject(pay_config)
1568
1570
 
1569
- const { is_dev, site_host } = await appConfig.getObject('base')
1570
- // 公众号支付用 服务号 appid,其他用小程序 appid
1571
1571
  const app_id = (await appConfig.getObject(config)).app_id
1572
1572
 
1573
1573
  const wxpay = WXPay({
1574
1574
  appid: app_id,
1575
1575
  mch_id: mchId,
1576
1576
  partner_key: key.length > 10 ? key : partner_key, // 微信商户平台API密钥
1577
- pfx: await fs.readFileSync(
1577
+ pfx: await fsPromise.readFile(
1578
1578
  path.resolve(
1579
1579
  __dirname,
1580
1580
  `${process.cwd()}/app/${appName}/plugins/weixin/${key}/apiclient_cert.p12`
@@ -1619,12 +1619,6 @@ exports.addreceiver = async (ctx) => {
1619
1619
  appid: app_id,
1620
1620
  mch_id: mchId,
1621
1621
  partner_key: key.length > 10 ? key : partner_key, // 微信商户平台API密钥
1622
- pfx: await fs.readFileSync(
1623
- path.resolve(
1624
- __dirname,
1625
- `${process.cwd()}/app/${appName}/plugins/weixin/${key}/apiclient_cert.p12`
1626
- )
1627
- ),
1628
1622
  })
1629
1623
 
1630
1624
  const res = await wxpay.addreceiverSync({
@@ -1658,12 +1652,6 @@ exports.removereceiver = async (ctx) => {
1658
1652
  appid: app_id,
1659
1653
  mch_id: mchId,
1660
1654
  partner_key: key.length > 10 ? key : partner_key, // 微信商户平台API密钥
1661
- pfx: await fs.readFileSync(
1662
- path.resolve(
1663
- __dirname,
1664
- `${process.cwd()}/app/${appName}/plugins/weixin/${key}/apiclient_cert.p12`
1665
- )
1666
- ),
1667
1655
  })
1668
1656
 
1669
1657
  const res = await wxpay.removereceiverSync({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "10.5.5",
3
+ "version": "10.6.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {