q-koa 12.2.2 → 12.2.3
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.
|
@@ -1417,7 +1417,7 @@ exports.article = async (ctx) => {
|
|
|
1417
1417
|
return ctx.SUCCESS(result)
|
|
1418
1418
|
}
|
|
1419
1419
|
|
|
1420
|
-
exports.checkPay = async (ctx) => {
|
|
1420
|
+
exports.checkPay = async (ctx, _data) => {
|
|
1421
1421
|
const { app, appName, controller } = getAppByCtx(ctx)
|
|
1422
1422
|
|
|
1423
1423
|
const {
|
|
@@ -1427,15 +1427,19 @@ exports.checkPay = async (ctx) => {
|
|
|
1427
1427
|
pay_config = 'weixin_pay',
|
|
1428
1428
|
type = 'MP-WEIXIN',
|
|
1429
1429
|
out_trade_no: _out_trade_no,
|
|
1430
|
-
} = ctx.request.body
|
|
1430
|
+
} = _data || ctx.request.body
|
|
1431
1431
|
|
|
1432
1432
|
const orderModel = prefix ? `${prefix}_order` : 'order'
|
|
1433
|
+
|
|
1433
1434
|
const result = await app.model[orderModel].findOne({
|
|
1434
1435
|
where: {
|
|
1435
1436
|
id,
|
|
1436
1437
|
},
|
|
1437
1438
|
})
|
|
1438
|
-
if (!result)
|
|
1439
|
+
if (!result) {
|
|
1440
|
+
ctx.SUCCESS('找不到')
|
|
1441
|
+
throw new Error(`找不到`)
|
|
1442
|
+
}
|
|
1439
1443
|
|
|
1440
1444
|
const appConfig = getConfig(app)
|
|
1441
1445
|
const app_id = (await appConfig.getObject(config)).app_id
|
|
@@ -1467,6 +1471,7 @@ exports.checkPay = async (ctx) => {
|
|
|
1467
1471
|
}
|
|
1468
1472
|
|
|
1469
1473
|
ctx.SUCCESS({ prefix, out_trade_no, ...payResult })
|
|
1474
|
+
return { prefix, out_trade_no, ...payResult }
|
|
1470
1475
|
}
|
|
1471
1476
|
|
|
1472
1477
|
exports.checkPayOnly = async (ctx) => {
|