q-koa 9.5.0 → 9.5.3
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.
|
@@ -404,13 +404,9 @@ exports.verify = async (ctx) => {
|
|
|
404
404
|
ctx.SUCCESS(result)
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
-
|
|
408
|
-
const { app } = getAppByCtx(ctx)
|
|
407
|
+
const expressFn = async ({ app, express_number: _express_number }) => {
|
|
409
408
|
const appConfig = getConfig(app)
|
|
410
409
|
const { app_code, express_mobile } = await appConfig.getObject('express')
|
|
411
|
-
|
|
412
|
-
const { express_number: _express_number } = ctx.request.body
|
|
413
|
-
|
|
414
410
|
const express_number = _express_number.replace(/\t/, '').trim()
|
|
415
411
|
|
|
416
412
|
const lastFour = express_mobile
|
|
@@ -431,7 +427,7 @@ exports.express = async (ctx) => {
|
|
|
431
427
|
moment().diff(moment(history.result.updateTime), 'days') > 30
|
|
432
428
|
|
|
433
429
|
if (diffNoLong || isTooLong) {
|
|
434
|
-
return
|
|
430
|
+
return history.result
|
|
435
431
|
}
|
|
436
432
|
}
|
|
437
433
|
}
|
|
@@ -461,9 +457,34 @@ exports.express = async (ctx) => {
|
|
|
461
457
|
}
|
|
462
458
|
}
|
|
463
459
|
|
|
464
|
-
|
|
460
|
+
return result
|
|
465
461
|
} catch (e) {
|
|
466
|
-
return
|
|
462
|
+
return null
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
exports.express = async (ctx) => {
|
|
466
|
+
const { app } = getAppByCtx(ctx)
|
|
467
|
+
|
|
468
|
+
const { express_number } = ctx.request.body
|
|
469
|
+
|
|
470
|
+
if (Array.isArray(express_number)) {
|
|
471
|
+
const result = await Promise.all(
|
|
472
|
+
express_number.map((item) => {
|
|
473
|
+
return expressFn({
|
|
474
|
+
app,
|
|
475
|
+
express_number: item,
|
|
476
|
+
})
|
|
477
|
+
})
|
|
478
|
+
)
|
|
479
|
+
|
|
480
|
+
return ctx.SUCCESS(result)
|
|
481
|
+
} else {
|
|
482
|
+
const result = await expressFn({
|
|
483
|
+
app,
|
|
484
|
+
express_number,
|
|
485
|
+
})
|
|
486
|
+
|
|
487
|
+
return ctx.SUCCESS(result)
|
|
467
488
|
}
|
|
468
489
|
}
|
|
469
490
|
|
|
@@ -481,7 +502,11 @@ exports.urlToOss = async (ctx) => {
|
|
|
481
502
|
oss_host,
|
|
482
503
|
} = await appConfig.getObject('oss')
|
|
483
504
|
|
|
484
|
-
if (
|
|
505
|
+
if (
|
|
506
|
+
!url ||
|
|
507
|
+
(!url.includes('://lanhu') &&
|
|
508
|
+
['aliyun', cdn_host, oss_host].some((i) => url.includes(i)))
|
|
509
|
+
)
|
|
485
510
|
return ctx.SUCCESS(url)
|
|
486
511
|
|
|
487
512
|
if (!(accessKeyId && accessKeySecret && bucket && region)) {
|
|
@@ -198,9 +198,13 @@ exports.showTables = async (ctx) => {
|
|
|
198
198
|
exports.getTable = async (ctx) => {
|
|
199
199
|
const { app } = getAppByCtx(ctx)
|
|
200
200
|
|
|
201
|
-
const {
|
|
201
|
+
const {
|
|
202
|
+
model: _model,
|
|
203
|
+
show_virtual = false,
|
|
204
|
+
is_cache = true,
|
|
205
|
+
} = ctx.request.body
|
|
202
206
|
|
|
203
|
-
if (app.cache && app.cache.get(`${_model}-table`)) {
|
|
207
|
+
if (is_cache && app.cache && app.cache.get(`${_model}-table`)) {
|
|
204
208
|
return ctx.SUCCESS(app.cache.get(`${_model}-table`))
|
|
205
209
|
}
|
|
206
210
|
|