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.
@@ -19,7 +19,10 @@ exports.password = {
19
19
  defaultValue: '',
20
20
  sortOrder: 2,
21
21
  set: function (value) {
22
- this.setDataValue('password', md5(value))
22
+ if (value.length === 32) {
23
+ this.setDataValue('password', md5(value))
24
+ } else {
25
+ }
23
26
  },
24
27
  }
25
28
 
@@ -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(__dirname, 'private-key.pem'),
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "10.8.1",
3
+ "version": "10.8.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {