q-koa 7.9.8 → 7.9.9

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/app.js CHANGED
@@ -795,11 +795,11 @@ class APP {
795
795
  }
796
796
  await next()
797
797
  })
798
- router.post('/:controller/:fn', async (ctx) => {
798
+ const handleRouter = async (ctx) => {
799
799
  const appName = router.opts.prefix.substring(1)
800
800
  const { app } = ctx
801
801
 
802
- const { controller, fn } = ctx.params
802
+ const { controller, fn, sub } = ctx.params
803
803
  if (_.get(app, `${appName}.model.${controller}`) && fn === 'mock') {
804
804
  return ctx.SUCCESS(await app[appName].mock[controller]())
805
805
  }
@@ -1724,7 +1724,10 @@ class APP {
1724
1724
  })
1725
1725
  }
1726
1726
  }
1727
- })
1727
+ }
1728
+
1729
+ router.post('/:controller/:fn', handleRouter)
1730
+ router.post('/:controller/:fn/:sub', handleRouter)
1728
1731
  }
1729
1732
  }
1730
1733
 
@@ -1050,7 +1050,7 @@ const getRefundResultJson = async ({ req_info, app_key }) => {
1050
1050
  exports.refund_notify = async (ctx) => {
1051
1051
  const { app } = getAppByCtx(ctx)
1052
1052
  const result = ctx.request.xmlBody
1053
- const pay_config = ctx.request.query.pay_config || 'weixin_pay'
1053
+ const pay_config = ctx.params.sub || 'weixin_pay'
1054
1054
 
1055
1055
  const appConfig = getConfig(app)
1056
1056
  const { key } = await appConfig.getObject(pay_config)
@@ -50,7 +50,7 @@ exports.refund = async ({
50
50
  refund_fee: Math.round((refund_fee || price) * 100),
51
51
  notify_url: `https://${
52
52
  site_host || 'api.kuashou.com'
53
- }/${appName}/weixin/refund_notify?pay_config=weixin_pay`,
53
+ }/${appName}/weixin/refund_notify/${pay_config}`,
54
54
  })
55
55
  if (result_code === 'SUCCESS') {
56
56
  return true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "7.9.8",
3
+ "version": "7.9.9",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {