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) => { @@ -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))
})
}

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

@ -368,14 +368,11 @@ export default (() => { @@ -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;

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

@ -914,9 +914,7 @@ export default { @@ -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 { @@ -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)) {

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

@ -206,15 +206,10 @@ export default { @@ -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()

Loading…
Cancel
Save