q-koa 10.9.1 → 10.9.4
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.
|
@@ -80,7 +80,11 @@ exports.password = {
|
|
|
80
80
|
comment: '密码',
|
|
81
81
|
defaultValue: '7b17d87eb787c51b4da25ec1bed26c8d',
|
|
82
82
|
set(value) {
|
|
83
|
-
|
|
83
|
+
if (value.length === 32) {
|
|
84
|
+
this.setDataValue('password', md5(value))
|
|
85
|
+
} else {
|
|
86
|
+
this.setDataValue('password', value)
|
|
87
|
+
}
|
|
84
88
|
},
|
|
85
89
|
// validate: {
|
|
86
90
|
// notNull: {
|
|
@@ -857,6 +857,7 @@ exports.pc_pay = async (ctx) => {
|
|
|
857
857
|
} = ctx.request.body
|
|
858
858
|
|
|
859
859
|
if (price === 0) throw new Error('价格不能为0')
|
|
860
|
+
if (!app.service.weixin) throw new Error(`weixin可能没有service.js`)
|
|
860
861
|
const result = await app.service.weixin.pc_pay({
|
|
861
862
|
ctx,
|
|
862
863
|
name,
|
|
@@ -1153,6 +1154,7 @@ exports.notify = async (ctx) => {
|
|
|
1153
1154
|
const result = ctx.request.xmlBody
|
|
1154
1155
|
let prefix = ''
|
|
1155
1156
|
let order_id = result.xml.out_trade_no.split('_')[1]
|
|
1157
|
+
let pay_type_key = result.xml.out_trade_no.split('_')[2]
|
|
1156
1158
|
const order_price = Number(result.xml.total_fee) / 100
|
|
1157
1159
|
if (order_id.includes('-')) {
|
|
1158
1160
|
const arr = order_id.split('-')
|
|
@@ -1179,6 +1181,7 @@ exports.notify = async (ctx) => {
|
|
|
1179
1181
|
transactionid,
|
|
1180
1182
|
out_trade_no: result.xml.out_trade_no,
|
|
1181
1183
|
openid,
|
|
1184
|
+
pay_type_key,
|
|
1182
1185
|
})
|
|
1183
1186
|
}
|
|
1184
1187
|
|
|
@@ -1649,6 +1652,7 @@ exports.profitsharing = async (ctx) => {
|
|
|
1649
1652
|
if (!out_order_no) return ctx.ERROR('?out_order_no')
|
|
1650
1653
|
if (!openid) return ctx.ERROR('?openid')
|
|
1651
1654
|
|
|
1655
|
+
if (!app.service.weixin) throw new Error(`weixin可能没有service.js`)
|
|
1652
1656
|
const res = await app.service.weixin.profitsharing({
|
|
1653
1657
|
ctx,
|
|
1654
1658
|
transaction_id,
|
|
@@ -1669,6 +1673,7 @@ exports.addreceiver = async (ctx) => {
|
|
|
1669
1673
|
|
|
1670
1674
|
if (!openid) return ctx.ERROR('?openid')
|
|
1671
1675
|
|
|
1676
|
+
if (!app.service.weixin) throw new Error(`weixin可能没有service.js`)
|
|
1672
1677
|
const res = await app.service.weixin.addreceiver({
|
|
1673
1678
|
ctx,
|
|
1674
1679
|
type,
|
|
@@ -1686,6 +1691,7 @@ exports.removereceiver = async (ctx) => {
|
|
|
1686
1691
|
|
|
1687
1692
|
if (!openid) return ctx.ERROR('?openid')
|
|
1688
1693
|
|
|
1694
|
+
if (!app.service.weixin) throw new Error(`weixin可能没有service.js`)
|
|
1689
1695
|
const res = await app.service.weixin.removereceiver({
|
|
1690
1696
|
ctx,
|
|
1691
1697
|
type,
|