diff --git a/cloud/bigscreen-design/src/api/db.js b/cloud/bigscreen-design/src/api/db.js index 2ac89f5..cd5d05b 100644 --- a/cloud/bigscreen-design/src/api/db.js +++ b/cloud/bigscreen-design/src/api/db.js @@ -46,10 +46,6 @@ export const dynamicSql = (data) => { return request({ url: url + '/db/dynamic-query', method: 'post', - headers: { - 'data': data, - 'Content-Type': 'application/json' - }, data: data }) } @@ -58,10 +54,8 @@ export const dbTest = (data) => { return request({ url: url + '/db/db-test', method: 'post', - headers: { - 'data': crypto.encrypt(JSON.stringify(data)), - 'Content-Type': 'application/json' - }, - data: crypto.encrypt(JSON.stringify(data)) + // todo 借助spring网关处理解密待重写 + //data: crypto.encrypt(JSON.stringify(data)) + data: data }) } diff --git a/cloud/bigscreen-design/src/echart/common.js b/cloud/bigscreen-design/src/echart/common.js index 13880a8..e15ec5e 100644 --- a/cloud/bigscreen-design/src/echart/common.js +++ b/cloud/bigscreen-design/src/echart/common.js @@ -368,11 +368,15 @@ export default (() => { bindEvent(); } } else if (isSql) { - let sql = JSON.parse(crypto.decrypt(safe.sql)); + // todo 借助spring网关处理解密待重写 + //let sql = JSON.parse(crypto.decrypt(safe.sql)); + let sql = safe.sql; let data, result; try { sql.sql = funEval(sql.sql)(this.dataParams) - data = crypto.encrypt(JSON.stringify(sql)); + // todo 借助spring网关处理解密待重写 + //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 63cdf66..dd48803 100644 --- a/cloud/bigscreen-design/src/page/build.vue +++ b/cloud/bigscreen-design/src/page/build.vue @@ -914,7 +914,9 @@ export default { activeObj: { handler () { if (this.activeObj.sql && this.isSql) { - let mode = JSON.parse(crypto.decrypt(this.activeObj.sql)); + // todo 借助spring网关处理解密待重写 + // let mode = JSON.parse(crypto.decrypt(this.activeObj.sql)); + let mode = this.activeObj.sql; this.db = mode.id; this.sql = mode.sql; } else { @@ -1028,10 +1030,15 @@ export default { }, handleRes (tip = true) { if (this.isSql) { - this.activeObj.sql = crypto.encrypt(JSON.stringify({ + // todo 借助spring网关处理解密待重写 + // this.activeObj.sql = crypto.encrypt(JSON.stringify({ + // id: this.db, + // sql: this.sql + // })) + this.activeObj.sql = { id: this.db, sql: this.sql - })) + } } this.handleRefresh().then((res = {}) => { if (!this.validatenull(res)) { diff --git a/cloud/bigscreen-design/src/page/list/db.vue b/cloud/bigscreen-design/src/page/list/db.vue index bc18b68..d167ca6 100644 --- a/cloud/bigscreen-design/src/page/list/db.vue +++ b/cloud/bigscreen-design/src/page/list/db.vue @@ -200,7 +200,7 @@ export default { password: form.password }).then(res => { const data = res.data; - if (data.success) { + if (data.data) { this.$message.success('连接成功') } else { this.$message.error('连接失败,请检查相关配置参数') diff --git a/cloud/bigscreen-design/src/page/list/record.vue b/cloud/bigscreen-design/src/page/list/record.vue index 9ef0c29..7334012 100644 --- a/cloud/bigscreen-design/src/page/list/record.vue +++ b/cloud/bigscreen-design/src/page/list/record.vue @@ -206,10 +206,15 @@ export default { }); }, getSql (row) { - return crypto.encrypt(JSON.stringify({ + // todo 借助spring网关处理解密待重写 + /*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() @@ -289,7 +294,7 @@ export default { const data = res.data.data; this.form = data if (this.isSql) { - let mode = JSON.parse(crypto.decrypt(this.form.data)); + let mode = JSON.parse(this.form.data); this.form.dbId = mode.id; this.form.dbSql = mode.sql; } diff --git a/cloud/bigscreen-design/src/utils/crypto.js b/cloud/bigscreen-design/src/utils/crypto.js index 191af3b..68c4f4b 100644 --- a/cloud/bigscreen-design/src/utils/crypto.js +++ b/cloud/bigscreen-design/src/utils/crypto.js @@ -1,11 +1,8 @@ import CryptoJS from 'crypto-js' export default class crypto { - // 使用AesUtil.genAesKey()生成,需和后端配置保持一致 - static aesKey = "O2BEeIv399qHQNhD6aGW8R8DEj4bqHXm"; - // 使用DesUtil.genDesKey()生成,需和后端配置保持一致 - static desKey = "jMVCBsFGDQr1USHo"; + static aesKey = "changsha-kanglai"; /** * aes 加密方法 @@ -77,4 +74,4 @@ export default class crypto { }); return decrypted.toString(CryptoJS.enc.Utf8); } -} \ No newline at end of file +}