q-koa 13.8.7 → 13.8.9
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.
- package/core/file/plugins/common/controller.js +3 -1
- package/core/file/plugins/model/service.js +9 -9
- package/core/file/plugins/setting/controller.js +0 -3
- package/core/file/plugins/system/service.js +1 -7
- package/core/file/plugins/weixin/service.js +1 -1
- package/core/file/services/allinpay.js +1 -1
- package/core/file/services/config.js +1 -1
- package/core/file/services/weixinCrypt.js +2 -2
- package/core/file/services/weixinMP.js +2 -1
- package/package.json +1 -1
|
@@ -450,6 +450,7 @@ const expressFn = async ({ app, express_number: _express_number, mobile }) => {
|
|
|
450
450
|
const { app_code, express_mobile: default_express_mobile } =
|
|
451
451
|
await appConfig.getObject('express')
|
|
452
452
|
|
|
453
|
+
if (!_express_number) throw new Error('快递单号不能为空')
|
|
453
454
|
const express_number = _express_number.replace(/\t/, '').trim()
|
|
454
455
|
|
|
455
456
|
const express_mobile = mobile || default_express_mobile
|
|
@@ -466,7 +467,7 @@ const expressFn = async ({ app, express_number: _express_number, mobile }) => {
|
|
|
466
467
|
express_number,
|
|
467
468
|
},
|
|
468
469
|
})
|
|
469
|
-
if (history) {
|
|
470
|
+
if (history && history.result && history.result.updateTime) {
|
|
470
471
|
const diffNoLong = moment().diff(moment(history.updated_at), 'hours') < 1
|
|
471
472
|
const isTooLong =
|
|
472
473
|
moment().diff(moment(history.result.updateTime), 'days') > 30
|
|
@@ -518,6 +519,7 @@ exports.express = async (ctx) => {
|
|
|
518
519
|
return expressFn({
|
|
519
520
|
app,
|
|
520
521
|
express_number: item,
|
|
522
|
+
mobile,
|
|
521
523
|
})
|
|
522
524
|
})
|
|
523
525
|
)
|
|
@@ -41,15 +41,15 @@ exports.loadModel = async ({ app, appName }) => {
|
|
|
41
41
|
? require(configPath)
|
|
42
42
|
: require(defaultConfigPath)
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
let modelFile = null
|
|
45
|
+
if (modelExist) {
|
|
46
|
+
modelFile = await fsPromise.readFile(filePath, 'utf-8')
|
|
47
|
+
} else if (defaultModelExist) {
|
|
48
|
+
modelFile = await fsPromise.readFile(defaultFilePath, 'utf-8')
|
|
49
|
+
}
|
|
50
50
|
|
|
51
51
|
const model = modelFile
|
|
52
|
-
?
|
|
52
|
+
? modelExist
|
|
53
53
|
? require(filePath)
|
|
54
54
|
: require(defaultFilePath)
|
|
55
55
|
: {}
|
|
@@ -235,11 +235,11 @@ exports.loadModel = async ({ app, appName }) => {
|
|
|
235
235
|
const promise2 = app.model.model_attributes.bulkCreate(
|
|
236
236
|
dataList
|
|
237
237
|
.filter((item) => item.list.every((t) => t.type))
|
|
238
|
-
.
|
|
238
|
+
.flatMap((b) => b.list)
|
|
239
239
|
)
|
|
240
240
|
|
|
241
241
|
await Promise.all([promise1, promise2])
|
|
242
|
-
console.log('
|
|
242
|
+
console.log('loadModel success!')
|
|
243
243
|
if (currentDisabledFindAllList.length > 0) {
|
|
244
244
|
console.warn(`当前disabledFindAllList不为空,查看需清空`)
|
|
245
245
|
} else {
|
|
@@ -30,9 +30,6 @@ exports.copyOther = async (ctx) => {
|
|
|
30
30
|
|
|
31
31
|
const findType = list.find((item) => item.code === type)
|
|
32
32
|
if (findType && findType.parent_id) {
|
|
33
|
-
if (!findType) {
|
|
34
|
-
throw new Error(`当前找不到${type}`)
|
|
35
|
-
}
|
|
36
33
|
await app.model.setting.upsert({
|
|
37
34
|
id: findType.id,
|
|
38
35
|
value: copyType.value,
|
|
@@ -261,13 +261,7 @@ exports.initData = async ({ includes, excludes, app, ctx }) => {
|
|
|
261
261
|
})
|
|
262
262
|
)
|
|
263
263
|
|
|
264
|
-
const obj =
|
|
265
|
-
(a, b) => ({
|
|
266
|
-
...a,
|
|
267
|
-
...b,
|
|
268
|
-
}),
|
|
269
|
-
{}
|
|
270
|
-
)
|
|
264
|
+
const obj = Object.assign({}, ...result)
|
|
271
265
|
if (obj.setting && apiVersion && !cacheVersion) {
|
|
272
266
|
console.log(`version没有后端缓存`)
|
|
273
267
|
}
|
|
@@ -413,7 +413,7 @@ exports.cash = async ({
|
|
|
413
413
|
})
|
|
414
414
|
|
|
415
415
|
if (!user) throw new Error('找不到该用户')
|
|
416
|
-
if (!user.mp_user.openid) throw new Error('找不到该用户openid')
|
|
416
|
+
if (!user.mp_user || !user.mp_user.openid) throw new Error('找不到该用户openid')
|
|
417
417
|
|
|
418
418
|
const { mchId, key, appId, partner_key } = await getAppConfig({
|
|
419
419
|
app,
|
|
@@ -20,8 +20,6 @@ WXBizDataCrypt.prototype.decryptData = function (encryptedData, iv) {
|
|
|
20
20
|
decoded += decipher.final('utf8')
|
|
21
21
|
|
|
22
22
|
decoded = JSON.parse(decoded)
|
|
23
|
-
|
|
24
|
-
return decoded
|
|
25
23
|
} catch (err) {
|
|
26
24
|
throw new Error('系统开小差了,请重试')
|
|
27
25
|
}
|
|
@@ -29,6 +27,8 @@ WXBizDataCrypt.prototype.decryptData = function (encryptedData, iv) {
|
|
|
29
27
|
if (decoded.watermark.appid !== this.appId) {
|
|
30
28
|
throw new Error('Illegal Buffer')
|
|
31
29
|
}
|
|
30
|
+
|
|
31
|
+
return decoded
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
module.exports = WXBizDataCrypt
|
|
@@ -350,6 +350,7 @@ module.exports = class Singleton {
|
|
|
350
350
|
subAnchorWechat,
|
|
351
351
|
anchorWechat,
|
|
352
352
|
anchorName,
|
|
353
|
+
closeReplay,
|
|
353
354
|
})
|
|
354
355
|
}
|
|
355
356
|
throw new Error(`${result.errcode};${result.errmsg}`)
|
|
@@ -614,7 +615,7 @@ module.exports = class Singleton {
|
|
|
614
615
|
if (result.errcode) {
|
|
615
616
|
if (result.errcode === 40001) {
|
|
616
617
|
cache.clear()
|
|
617
|
-
return await this.handleTyping(
|
|
618
|
+
return await this.handleTyping({ touser, is_typing })
|
|
618
619
|
}
|
|
619
620
|
throw new Error(`${result.errcode};${result.errmsg}`)
|
|
620
621
|
}
|