重构代码:全站增加对脚本代码防护 link #ITJ53

#Issue
https://gitee.com/LongbowEnterprise/dashboard/issues?id=ITJ53

#Comment
增加扩展原有列的formatter对数据进行保护
This commit is contained in:
Argo Zhang 2019-03-14 18:50:21 +08:00
parent 84441ba300
commit a5226b7713
1 changed files with 6 additions and 0 deletions

View File

@ -335,6 +335,12 @@
return $.safeHtml(value); return $.safeHtml(value);
} }
} }
else {
var formatter = value.formatter;
value.formatter = function(value, row, index, field) {
return formatter.call(this, $.safeHtml(value), row, index, field);
}
}
}); });
this.bootstrapTable(settings); this.bootstrapTable(settings);
$('.bootstrap-table .fixed-table-toolbar .columns .export .dropdown-menu').addClass("dropdown-menu-right"); $('.bootstrap-table .fixed-table-toolbar .columns .export .dropdown-menu').addClass("dropdown-menu-right");