q-koa 12.7.4 → 12.8.1
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.
|
@@ -338,11 +338,14 @@ exports.mp_login = async (ctx) => {
|
|
|
338
338
|
|
|
339
339
|
let uid
|
|
340
340
|
if (openIdUser) {
|
|
341
|
-
await app.model.mp_user.update(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
341
|
+
await app.model.mp_user.update(
|
|
342
|
+
lodash.omit(post, openIdUser.user_id ? ['user_id'] : []),
|
|
343
|
+
{
|
|
344
|
+
where: {
|
|
345
|
+
openid: post.openid,
|
|
346
|
+
},
|
|
347
|
+
}
|
|
348
|
+
)
|
|
346
349
|
if (app.attributes.user.mp_openid) {
|
|
347
350
|
app.model.user.update(
|
|
348
351
|
{
|
|
@@ -1218,12 +1221,13 @@ exports.url_link = async (ctx) => {
|
|
|
1218
1221
|
exports.short_link = async (ctx) => {
|
|
1219
1222
|
const { app } = getAppByCtx(ctx)
|
|
1220
1223
|
|
|
1221
|
-
const { page, scene, config = 'weixin_mp' } = ctx.request.body
|
|
1224
|
+
const { page, scene, title, config = 'weixin_mp' } = ctx.request.body
|
|
1222
1225
|
if (!app.service.weixin) throw new Error(`weixin可能没有service.js`)
|
|
1223
1226
|
const result = await app.service.weixin.short_link({
|
|
1224
1227
|
app,
|
|
1225
1228
|
page,
|
|
1226
1229
|
scene,
|
|
1230
|
+
title,
|
|
1227
1231
|
config,
|
|
1228
1232
|
})
|
|
1229
1233
|
ctx.SUCCESS(result)
|
|
@@ -450,7 +450,13 @@ exports.url_link = async ({ app, page, scene, config = 'weixin_mp' }) => {
|
|
|
450
450
|
return result
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
-
exports.short_link = async ({
|
|
453
|
+
exports.short_link = async ({
|
|
454
|
+
app,
|
|
455
|
+
page,
|
|
456
|
+
scene,
|
|
457
|
+
title,
|
|
458
|
+
config = 'weixin_mp',
|
|
459
|
+
}) => {
|
|
454
460
|
const appConfig = getConfig(app)
|
|
455
461
|
const { app_id, app_secrect } = await appConfig.getObject(config)
|
|
456
462
|
const weixinMp = new WeixinMp({
|
|
@@ -461,6 +467,7 @@ exports.short_link = async ({ app, page, scene, config = 'weixin_mp' }) => {
|
|
|
461
467
|
const result = await weixinMp.createShortLink({
|
|
462
468
|
page,
|
|
463
469
|
scene,
|
|
470
|
+
title,
|
|
464
471
|
})
|
|
465
472
|
return result
|
|
466
473
|
}
|