From 4de26fc7975a393122366c128afceb372840e930 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Mon, 25 Jul 2022 16:02:59 +0800 Subject: [PATCH] FS_UNIAPP_API --- api/app/lib/controllers/data/publicity.js | 0 api/app/lib/controllers/overview/building.js | 6 ++- api/log/development.log | 47 ++++++++++++++++++++ web/config.js | 3 +- 4 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 api/app/lib/controllers/data/publicity.js diff --git a/api/app/lib/controllers/data/publicity.js b/api/app/lib/controllers/data/publicity.js new file mode 100644 index 00000000..e69de29b diff --git a/api/app/lib/controllers/overview/building.js b/api/app/lib/controllers/overview/building.js index 4b362c8b..1e6d1dfc 100644 --- a/api/app/lib/controllers/overview/building.js +++ b/api/app/lib/controllers/overview/building.js @@ -148,8 +148,10 @@ async function roadState (ctx) { } } - roadState.greenMileage[r.level].canBeGreen += (Number(r.greeningMileage) || 0) - roadState.greenMileage[r.level].isGreen += (Number(r.greeningMileaged) || 0) + if (r.level && roadState.greenMileage[r.level]) { + roadState.greenMileage[r.level].canBeGreen += (Number(r.greeningMileage) || 0) + roadState.greenMileage[r.level].isGreen += (Number(r.greeningMileaged) || 0) + } } let corBuildConstruction2022 = roadState.construction.find(item => item.year == 2022) diff --git a/api/log/development.log b/api/log/development.log index 58fe7dc7..8fac17c9 100644 --- a/api/log/development.log +++ b/api/log/development.log @@ -7302,3 +7302,50 @@ 2022-07-25 11:52:00.697 - debug: [FS-LOGGER] Init. 2022-07-25 11:52:00.795 - info: [FS-ATTACHMENT] Inject attachment mw into router. 2022-07-25 11:52:00.796 - info: [FS-AUTH] Inject auth and api mv into router. +2022-07-25 15:19:38.799 - error: [FS-ERRHD] +{ + message: 'Malicious Path', + stack: 'BadRequestError: Malicious Path\n' + + ' at resolvePath (c:\\_WorkCode\\四好公路\\api\\node_modules\\resolve-path\\index.js:78:11)\n' + + ' at Object. (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-send\\index.js:58:12)\n' + + ' at Generator.next ()\n' + + ' at onFulfilled (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:65:19)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:54:5\n' + + ' at new Promise ()\n' + + ' at Object.co (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:50:10)\n' + + ' at Object.toPromise (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:118:63)\n' + + ' at next (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:99:29)\n' + + ' at onFulfilled (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:69:7)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:54:5\n' + + ' at new Promise ()\n' + + ' at Object.co (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:50:10)\n' + + ' at converted (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-convert\\index.js:17:15)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)\n' + + ' at module.exports (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa-range\\index.js:11:12)\n' + + ' at dispatch (c:\\_WorkCode\\四好公路\\api\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\fs-web-server-scaffold\\index.js:94:23\n' + + ' at Generator.next ()\n' + + ' at onFulfilled (c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:65:19)\n' + + ' at c:\\_WorkCode\\四好公路\\api\\node_modules\\co\\index.js:54:5\n' + + ' at new Promise ()', + name: 'BadRequestError' +} +2022-07-25 15:42:40.790 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:44:00.246 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:46:28.474 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:46:39.861 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:48:08.446 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:48:36.410 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:49:33.117 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:49:57.777 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:50:03.626 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:50:42.998 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:52:28.244 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:53:23.979 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:53:28.401 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:53:32.391 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:54:15.186 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:55:18.206 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:55:41.428 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:56:27.976 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined +2022-07-25 15:57:02.645 - error: path: /build/road_state, error: TypeError: Cannot read property 'canBeGreen' of undefined diff --git a/web/config.js b/web/config.js index 9938ecee..e427ddc6 100644 --- a/web/config.js +++ b/web/config.js @@ -18,7 +18,7 @@ args.option(['u', 'api-url'], 'webapi的URL'); args.option(['r', 'report-node'], '报表进程地址'); const flags = args.parse(process.argv); - +const FS_UNIAPP_API = process.env.FS_UNIAPP_API || flags.apiUrl; if (!FS_UNIAPP_API) { console.log('缺少启动参数,异常退出'); @@ -33,7 +33,6 @@ const product = { entry: require('./middlewares/proxy').entry, opts: { host: FS_UNIAPP_API, - match: /^\/_api\//, } }, {