From 63cccc1f6f3032382519abf5000856f25ad454b2 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Fri, 9 Sep 2022 16:17:46 +0800 Subject: [PATCH] Content-Security-Policy --- api/app/lib/controllers/alarm/app.js | 3 ++- api/app/lib/models/app_inspection.js | 11 ++++++++++- script/1.0.0/3.update_tables.sql | 2 ++ web/client/index.ejs | 4 +++- web/client/index.html | 1 - 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 script/1.0.0/3.update_tables.sql diff --git a/api/app/lib/controllers/alarm/app.js b/api/app/lib/controllers/alarm/app.js index 0a13f29..daa2bcb 100644 --- a/api/app/lib/controllers/alarm/app.js +++ b/api/app/lib/controllers/alarm/app.js @@ -5,7 +5,7 @@ const moment = require('moment') async function inspection (ctx) { try { const models = ctx.fs.dc.models; - const { projectAppId, screenshot = [] } = ctx.request.body + const { projectAppId, screenshot = [], description } = ctx.request.body const now = moment().format() const storageData = screenshot.map(s => { @@ -13,6 +13,7 @@ async function inspection (ctx) { projectAppId, screenshot: [s], createTime: now, + description, } }) diff --git a/api/app/lib/models/app_inspection.js b/api/app/lib/models/app_inspection.js index 84d6235..064ea38 100644 --- a/api/app/lib/models/app_inspection.js +++ b/api/app/lib/models/app_inspection.js @@ -63,7 +63,16 @@ module.exports = dc => { primaryKey: false, field: "noted_time", autoIncrement: false - } + }, + description: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "", + primaryKey: false, + field: "description", + autoIncrement: false + }, }, { tableName: "app_inspection", comment: "", diff --git a/script/1.0.0/3.update_tables.sql b/script/1.0.0/3.update_tables.sql new file mode 100644 index 0000000..ee8df65 --- /dev/null +++ b/script/1.0.0/3.update_tables.sql @@ -0,0 +1,2 @@ +alter table app_inspection + add description varchar(1024); diff --git a/web/client/index.ejs b/web/client/index.ejs index 3298117..2fd8513 100644 --- a/web/client/index.ejs +++ b/web/client/index.ejs @@ -4,7 +4,9 @@ - + + + diff --git a/web/client/index.html b/web/client/index.html index b78fc86..43369d7 100644 --- a/web/client/index.html +++ b/web/client/index.html @@ -10,7 +10,6 @@ -