q-koa 13.4.5 → 13.4.6

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/core/config.js CHANGED
@@ -163,7 +163,7 @@ module.exports = {
163
163
  )
164
164
  router.get('/weixin/messagePush', app.controller.weixin.messagePush)
165
165
  }
166
-
166
+ router.get('/common/restart', app.controller.common.restart)
167
167
  router.get('/common/getAppConfig', app.controller.common.getAppConfig)
168
168
  router.get('/common/createQr', app.controller.common.createQr)
169
169
  router.get('/lanhu/:str', async (ctx) => {
@@ -1201,6 +1201,9 @@ exports.b2b_pay = async (ctx) => {
1201
1201
  pay_key: _pay_key,
1202
1202
  } = await appConfig.getObject('weixin_pay')
1203
1203
 
1204
+ if (!app_key) {
1205
+ throw new Error('缺少app_key')
1206
+ }
1204
1207
  const pay_key = _pay_key || key || appName
1205
1208
 
1206
1209
  const weixinMp = new WeixinMp({
@@ -1214,6 +1217,7 @@ exports.b2b_pay = async (ctx) => {
1214
1217
  ? `${pay_key}_${prefix}-${order_id}_${type}`
1215
1218
  : `${pay_key}_${order_id}_${type}`
1216
1219
 
1220
+ const order_amount = is_admin || is_dev ? 1 : Math.round(price * 100)
1217
1221
  const res = await weixinMp.b2bPay({
1218
1222
  mchid,
1219
1223
  app_key,
@@ -1222,7 +1226,7 @@ exports.b2b_pay = async (ctx) => {
1222
1226
  out_trade_no,
1223
1227
  description: name,
1224
1228
  amount: {
1225
- order_amount: is_admin || is_dev ? 1 : Math.round(price * 100),
1229
+ order_amount,
1226
1230
  },
1227
1231
  },
1228
1232
  })
@@ -1324,6 +1328,7 @@ exports.notify = async (ctx) => {
1324
1328
  out_trade_no: result.xml.out_trade_no,
1325
1329
  openid,
1326
1330
  pay_type_key,
1331
+ mch_id: result.xml.mch_id,
1327
1332
  })
1328
1333
  }
1329
1334
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "13.4.5",
3
+ "version": "13.4.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -60,7 +60,8 @@
60
60
  "redis": "^4.0.3",
61
61
  "yly-nodejs-sdk": "^1.0.2",
62
62
  "vm2": "^3.9.19",
63
- "xlsx": "^0.18.5"
63
+ "xlsx": "^0.18.5",
64
+ "pm2": "^7.0.1"
64
65
  },
65
66
  "devDependencies": {
66
67
  "eslint": "^4.19.1",