q-koa 12.9.5 → 12.9.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.
|
@@ -925,12 +925,9 @@ exports.app_pay = async (ctx) => {
|
|
|
925
925
|
// }
|
|
926
926
|
const appConfig = getConfig(app)
|
|
927
927
|
|
|
928
|
-
const {
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
partner_key,
|
|
932
|
-
appId: appid,
|
|
933
|
-
} = await appConfig.getObject(pay_config)
|
|
928
|
+
const { mchId, key, partner_key, appId: appid } = await appConfig.getObject(
|
|
929
|
+
pay_config
|
|
930
|
+
)
|
|
934
931
|
|
|
935
932
|
if (!appid) throw new Error(`appId不能存在`)
|
|
936
933
|
|
|
@@ -1966,16 +1963,15 @@ exports.getCommentInfo = async (ctx, _data) => {
|
|
|
1966
1963
|
|
|
1967
1964
|
exports.createActivity = async (ctx, _data) => {
|
|
1968
1965
|
const { app, appName } = getAppByCtx(ctx)
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
const {
|
|
1972
|
-
app_id,
|
|
1973
|
-
app_secrect,
|
|
1966
|
+
let {
|
|
1967
|
+
config = 'weixin_mp',
|
|
1974
1968
|
template_type = 'start',
|
|
1975
1969
|
limit_number = 5,
|
|
1976
1970
|
room_limit = 100,
|
|
1977
1971
|
activityId = '',
|
|
1978
|
-
} =
|
|
1972
|
+
} = _data || ctx.request.body
|
|
1973
|
+
const appConfig = getConfig(app)
|
|
1974
|
+
const { app_id, app_secrect } = await appConfig.getObject(config)
|
|
1979
1975
|
|
|
1980
1976
|
const weixinMp = new WeixinMp({
|
|
1981
1977
|
appid: app_id,
|
|
@@ -1989,7 +1985,8 @@ exports.createActivity = async (ctx, _data) => {
|
|
|
1989
1985
|
}
|
|
1990
1986
|
|
|
1991
1987
|
if (!activityId) {
|
|
1992
|
-
const
|
|
1988
|
+
const res = await weixinMp.createActivity()
|
|
1989
|
+
activityId = res.activity_id
|
|
1993
1990
|
}
|
|
1994
1991
|
|
|
1995
1992
|
const payLoad = {
|
|
@@ -2007,7 +2004,7 @@ exports.createActivity = async (ctx, _data) => {
|
|
|
2007
2004
|
value: room_limit + '',
|
|
2008
2005
|
},
|
|
2009
2006
|
],
|
|
2010
|
-
|
|
2007
|
+
templateId: template[template_type],
|
|
2011
2008
|
},
|
|
2012
2009
|
}
|
|
2013
2010
|
ctx.SUCCESS(payLoad)
|