q-koa 8.8.0 → 8.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.
@@ -406,19 +406,31 @@ exports.verify = async (ctx) => {
406
406
  exports.express = async (ctx) => {
407
407
  const { app } = getAppByCtx(ctx)
408
408
  const appConfig = getConfig(app)
409
- const { app_code } = await appConfig.getObject('express')
409
+ const { app_code, express_mobile } = await appConfig.getObject('express')
410
410
 
411
- const express = new Express({
412
- app_code,
413
- })
411
+ const { express_number: _express_number } = ctx.request.body
414
412
 
415
- const { id, express_number } = ctx.request.body
413
+ const express_number = _express_number.replace(/\t/, '').trim()
416
414
 
417
- const result = await express.send({
418
- no: express_number,
419
- })
415
+ const lastFour = express_mobile
416
+ .split('')
417
+ .slice(express_mobile.length - 4, express_mobile.length)
418
+ .join('')
420
419
 
421
- ctx.SUCCESS(result)
420
+ try {
421
+ const express = new Express({
422
+ app_code,
423
+ })
424
+
425
+ const result = await express.send({
426
+ no: express_number.startsWith('SF')
427
+ ? `${express_number}:${lastFour}`
428
+ : express_number,
429
+ })
430
+ ctx.SUCCESS(result)
431
+ } catch (e) {
432
+ return ctx.SUCCESS(null)
433
+ }
422
434
  }
423
435
 
424
436
  exports.urlToOss = async (ctx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "8.8.0",
3
+ "version": "8.8.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {