Browse Source

chore: 支持加密

master
wangxiang 2 years ago
parent
commit
a5a8257ad6
  1. 4
      cloud/bigscreen-design/src/api/db.js
  2. 7
      cloud/bigscreen-design/src/echart/common.js
  3. 13
      cloud/bigscreen-design/src/page/build.vue
  4. 9
      cloud/bigscreen-design/src/page/list/record.vue

4
cloud/bigscreen-design/src/api/db.js

@ -54,8 +54,6 @@ export const dbTest = (data) => {
return request({ return request({
url: url + '/db/db-test', url: url + '/db/db-test',
method: 'post', method: 'post',
// todo 借助spring网关处理解密待重写 data: crypto.encrypt(JSON.stringify(data))
//data: crypto.encrypt(JSON.stringify(data))
data: data
}) })
} }

7
cloud/bigscreen-design/src/echart/common.js

@ -368,14 +368,11 @@ export default (() => {
bindEvent(); bindEvent();
} }
} else if (isSql) { } else if (isSql) {
// todo 借助spring网关处理解密待重写 let sql = JSON.parse(crypto.decrypt(safe.sql));
//let sql = JSON.parse(crypto.decrypt(safe.sql));
let sql = safe.sql;
let data, result; let data, result;
try { try {
sql.sql = funEval(sql.sql)(this.dataParams) sql.sql = funEval(sql.sql)(this.dataParams)
// todo 借助spring网关处理解密待重写 data = crypto.encrypt(JSON.stringify(sql));
//data = crypto.encrypt(JSON.stringify(sql));
data = sql; data = sql;
} catch (error) { } catch (error) {
data = safe.sql; data = safe.sql;

13
cloud/bigscreen-design/src/page/build.vue

@ -914,9 +914,7 @@ export default {
activeObj: { activeObj: {
handler () { handler () {
if (this.activeObj.sql && this.isSql) { if (this.activeObj.sql && this.isSql) {
// todo spring let mode = JSON.parse(crypto.decrypt(this.activeObj.sql));
// let mode = JSON.parse(crypto.decrypt(this.activeObj.sql));
let mode = this.activeObj.sql;
this.db = mode.id; this.db = mode.id;
this.sql = mode.sql; this.sql = mode.sql;
} else { } else {
@ -1030,15 +1028,10 @@ export default {
}, },
handleRes (tip = true) { handleRes (tip = true) {
if (this.isSql) { if (this.isSql) {
// todo spring this.activeObj.sql = crypto.encrypt(JSON.stringify({
// this.activeObj.sql = crypto.encrypt(JSON.stringify({
// id: this.db,
// sql: this.sql
// }))
this.activeObj.sql = {
id: this.db, id: this.db,
sql: this.sql sql: this.sql
} }))
} }
this.handleRefresh().then((res = {}) => { this.handleRefresh().then((res = {}) => {
if (!this.validatenull(res)) { if (!this.validatenull(res)) {

9
cloud/bigscreen-design/src/page/list/record.vue

@ -206,15 +206,10 @@ export default {
}); });
}, },
getSql (row) { getSql (row) {
// todo spring return crypto.encrypt(JSON.stringify({
/*return crypto.encrypt(JSON.stringify({
id: row.dbId, id: row.dbId,
sql: row.dbSql sql: row.dbSql
}))*/ }))
return {
id: row.dbId,
sql: row.dbSql
}
}, },
handleClose () { handleClose () {
this.client.close && this.client.close() this.client.close && this.client.close()

Loading…
Cancel
Save