q-koa 11.0.2 → 11.0.5

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
@@ -134,6 +134,9 @@ module.exports = {
134
134
  cacheModel: [],
135
135
  disabledFindAllList: [],
136
136
  defaultRouter: (router) => (app) => {
137
+ if (app.controller.setting.html) {
138
+ router.get('/setting/html', app.controller.setting.html)
139
+ }
137
140
  if (app.controller.cache) {
138
141
  router.get('/cache/get', app.controller.cache.get)
139
142
  router.get('/cache/clear', app.controller.cache.clear)
@@ -128,3 +128,27 @@ exports.init = async (ctx) => {
128
128
 
129
129
  ctx.SUCCESS(list)
130
130
  }
131
+
132
+ exports.html = async (ctx) => {
133
+ const { app, appName } = getAppByCtx(ctx)
134
+ const { code } = ctx.request.query
135
+ if (!code) {
136
+ ctx.body = `没有code`
137
+ }
138
+ const target = await app.model.setting.findOne({
139
+ where: {
140
+ code,
141
+ },
142
+ })
143
+ ctx.body = `<!DOCTYPE html>
144
+ <html lang="en">
145
+ <head>
146
+ <meta charset="UTF-8">
147
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
148
+ <title>${target.name}</title>
149
+ </head>
150
+ <body>
151
+ ${target.value}
152
+ </body>
153
+ </html>`
154
+ }
@@ -13,7 +13,8 @@ exports.refund = async ({
13
13
  total_fee,
14
14
  refund_fee,
15
15
  price,
16
- type = 'MP-WEIXIN',
16
+ pay_type = 'MP-WEIXIN',
17
+ type = '',
17
18
  config = 'weixin_mp',
18
19
  pay_config = 'weixin_pay',
19
20
  out_trade_no: _out_trade_no,
@@ -42,8 +43,8 @@ exports.refund = async ({
42
43
  const out_trade_no = _out_trade_no
43
44
  ? _out_trade_no
44
45
  : prefix
45
- ? `${key}_${prefix}-${id}_${type}`
46
- : `${key}_${id}_${type}`
46
+ ? `${key}_${prefix}-${id}_${pay_type}`
47
+ : `${key}_${id}_${pay_type}`
47
48
  const orderDetail = await app.model[orderModel].findOne({
48
49
  where: {
49
50
  id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "11.0.2",
3
+ "version": "11.0.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {