From 73943024c480ec19f35f5a718d503d5e8a7b1dd0 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Sat, 30 Jul 2022 18:25:39 +0800 Subject: [PATCH] =?UTF-8?q?getApiRoot=20=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/0.0.1/data/3_init_report_pic_data/index.js | 2 +- web/routes/attachment/index.js | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/0.0.1/data/3_init_report_pic_data/index.js b/scripts/0.0.1/data/3_init_report_pic_data/index.js index 4827d5dd..20da189b 100644 --- a/scripts/0.0.1/data/3_init_report_pic_data/index.js +++ b/scripts/0.0.1/data/3_init_report_pic_data/index.js @@ -9,7 +9,7 @@ try { const qiniu = require('qiniu'); const uuidv4 = require('uuid/v4'); - // 连接数据库 + // 测试环境 // const pool = new Pool({ // user: 'FashionAdmin', // host: '10.8.30.156', diff --git a/web/routes/attachment/index.js b/web/routes/attachment/index.js index 08b8e007..f539d50f 100644 --- a/web/routes/attachment/index.js +++ b/web/routes/attachment/index.js @@ -18,9 +18,13 @@ const ext = { module.exports = { entry: function (app, router, opts) { const getApiRoot = async function (ctx) { - const { apiUrl, qndmn } = opts; - ctx.status = 200; - ctx.body = { root: apiUrl, qndmn }; + try { + const { apiUrl, qndmn } = opts; + ctx.status = 200; + ctx.body = { root: apiUrl, qndmn }; + } catch (error) { + console.error('getApiRoot', error) + } }; let upload = async function (ctx, next) { @@ -84,7 +88,7 @@ module.exports = { } router.get('/api/root', getApiRoot); - router.post('/_upload/new', upload); - router.delete('/_upload/cleanup', remove); + // router.post('/_upload/new', upload); + // router.delete('/_upload/cleanup', remove); } };