From a5a8257ad64013646d64ba35664fd0232d76e2fd Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Mon, 10 Jul 2023 16:45:17 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=94=AF=E6=8C=81=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloud/bigscreen-design/src/api/db.js | 4 +--- cloud/bigscreen-design/src/echart/common.js | 7 ++----- cloud/bigscreen-design/src/page/build.vue | 13 +++---------- cloud/bigscreen-design/src/page/list/record.vue | 9 ++------- 4 files changed, 8 insertions(+), 25 deletions(-) diff --git a/cloud/bigscreen-design/src/api/db.js b/cloud/bigscreen-design/src/api/db.js index cd5d05b..9e38a4e 100644 --- a/cloud/bigscreen-design/src/api/db.js +++ b/cloud/bigscreen-design/src/api/db.js @@ -54,8 +54,6 @@ export const dbTest = (data) => { return request({ url: url + '/db/db-test', method: 'post', - // todo 借助spring网关处理解密待重写 - //data: crypto.encrypt(JSON.stringify(data)) - data: data + data: crypto.encrypt(JSON.stringify(data)) }) } diff --git a/cloud/bigscreen-design/src/echart/common.js b/cloud/bigscreen-design/src/echart/common.js index e15ec5e..c92733c 100644 --- a/cloud/bigscreen-design/src/echart/common.js +++ b/cloud/bigscreen-design/src/echart/common.js @@ -368,14 +368,11 @@ export default (() => { bindEvent(); } } else if (isSql) { - // todo 借助spring网关处理解密待重写 - //let sql = JSON.parse(crypto.decrypt(safe.sql)); - let sql = safe.sql; + let sql = JSON.parse(crypto.decrypt(safe.sql)); let data, result; try { sql.sql = funEval(sql.sql)(this.dataParams) - // todo 借助spring网关处理解密待重写 - //data = crypto.encrypt(JSON.stringify(sql)); + data = crypto.encrypt(JSON.stringify(sql)); data = sql; } catch (error) { data = safe.sql; diff --git a/cloud/bigscreen-design/src/page/build.vue b/cloud/bigscreen-design/src/page/build.vue index dd48803..63cdf66 100644 --- a/cloud/bigscreen-design/src/page/build.vue +++ b/cloud/bigscreen-design/src/page/build.vue @@ -914,9 +914,7 @@ export default { activeObj: { handler () { if (this.activeObj.sql && this.isSql) { - // todo 借助spring网关处理解密待重写 - // let mode = JSON.parse(crypto.decrypt(this.activeObj.sql)); - let mode = this.activeObj.sql; + let mode = JSON.parse(crypto.decrypt(this.activeObj.sql)); this.db = mode.id; this.sql = mode.sql; } else { @@ -1030,15 +1028,10 @@ export default { }, handleRes (tip = true) { if (this.isSql) { - // todo 借助spring网关处理解密待重写 - // this.activeObj.sql = crypto.encrypt(JSON.stringify({ - // id: this.db, - // sql: this.sql - // })) - this.activeObj.sql = { + this.activeObj.sql = crypto.encrypt(JSON.stringify({ id: this.db, sql: this.sql - } + })) } this.handleRefresh().then((res = {}) => { if (!this.validatenull(res)) { diff --git a/cloud/bigscreen-design/src/page/list/record.vue b/cloud/bigscreen-design/src/page/list/record.vue index 7334012..630a857 100644 --- a/cloud/bigscreen-design/src/page/list/record.vue +++ b/cloud/bigscreen-design/src/page/list/record.vue @@ -206,15 +206,10 @@ export default { }); }, getSql (row) { - // todo 借助spring网关处理解密待重写 - /*return crypto.encrypt(JSON.stringify({ + return crypto.encrypt(JSON.stringify({ id: row.dbId, sql: row.dbSql - }))*/ - return { - id: row.dbId, - sql: row.dbSql - } + })) }, handleClose () { this.client.close && this.client.close()