q-koa 12.9.5 → 13.0.0

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.
@@ -414,6 +414,10 @@ exports.initDataWithCache = exports.initData = async (ctx) => {
414
414
  const { is_cache } = await appConfig.getObject('base')
415
415
  const { includes, excludes = [] } = ctx.request.body
416
416
 
417
+ if (!includes) {
418
+ return ctx.SUCCESS(null)
419
+ }
420
+
417
421
  const cacheTarget = JSON.stringify(ctx.request.body)
418
422
 
419
423
  let result = null
@@ -925,12 +925,9 @@ exports.app_pay = async (ctx) => {
925
925
  // }
926
926
  const appConfig = getConfig(app)
927
927
 
928
- const {
929
- mchId,
930
- key,
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
- const { config = 'weixin_mp' } = _data || ctx.request.body
1970
- const appConfig = getConfig(app)
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
- } = await appConfig.getObject(config)
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 { activity_id: activityId } = await weixinMp.createActivity()
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
- templateld: template[template_type],
2007
+ templateId: template[template_type],
2011
2008
  },
2012
2009
  }
2013
2010
  ctx.SUCCESS(payLoad)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "12.9.5",
3
+ "version": "13.0.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {