q-koa 10.8.1 → 10.8.2
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.
|
@@ -109,7 +109,10 @@ exports.mp_pay = async (ctx) => {
|
|
|
109
109
|
gateway, // 支付宝网关地址 ,沙箱环境下使用时需要修改
|
|
110
110
|
alipayPublicKey: alipay_public_key,
|
|
111
111
|
privateKey: fs.readFileSync(
|
|
112
|
-
path.resolve(
|
|
112
|
+
path.resolve(
|
|
113
|
+
__dirname,
|
|
114
|
+
`${process.cwd()}/app/${appName}/plugins/alipay/private-key.pem`
|
|
115
|
+
),
|
|
113
116
|
'ascii'
|
|
114
117
|
),
|
|
115
118
|
notify_url,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { lodash, getAppByCtx, getConfig } = require('q-koa')
|
|
1
|
+
const { lodash, getAppByCtx, getConfig, moment } = require('q-koa')
|
|
2
2
|
|
|
3
3
|
const axios = require('axios')
|
|
4
4
|
const OAuth = require('wechat-oauth')
|
|
@@ -484,6 +484,16 @@ exports.mp_login = async (ctx) => {
|
|
|
484
484
|
user: tokenResult,
|
|
485
485
|
})
|
|
486
486
|
|
|
487
|
+
if (
|
|
488
|
+
result.updated_at &&
|
|
489
|
+
moment().diff(moment(result.updated_at), 'hours') > 24
|
|
490
|
+
) {
|
|
491
|
+
app.model.user.upsert({
|
|
492
|
+
id: result.id,
|
|
493
|
+
updated_at: moment(),
|
|
494
|
+
})
|
|
495
|
+
}
|
|
496
|
+
|
|
487
497
|
return ctx.SUCCESS({
|
|
488
498
|
token,
|
|
489
499
|
user: app.appConfig.loginData
|