修改跨站脚本攻击缺陷
This commit is contained in:
@@ -385,19 +385,6 @@ export const JeroListMixin = {
|
||||
modalLoading.destroy()
|
||||
})
|
||||
},
|
||||
htmlspecialchars (string) {
|
||||
var entityMap = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
'/': '/'
|
||||
}
|
||||
return String(string).replace(/[&<>"'\/]/g, function (s) {
|
||||
return entityMap[s]
|
||||
})
|
||||
},
|
||||
/* 导入 */
|
||||
handleImportExcel (info) {
|
||||
// 限制导入大于500MB
|
||||
@@ -427,21 +414,7 @@ export const JeroListMixin = {
|
||||
importModalLoading && importModalLoading.destroy()
|
||||
this.loading = false
|
||||
if (info.file.response.success) {
|
||||
// this.$message.success(`${info.file.name} 文件上传成功`);
|
||||
if (info.file.response.code === 201) {
|
||||
const { message, result: { msg, fileUrl, fileName } } = info.file.response
|
||||
const href = this.htmlspecialchars(window._CONFIG.domianURL + fileUrl)
|
||||
this.$warning({
|
||||
title: message,
|
||||
content: (<div>
|
||||
<span>{msg}</span><br />
|
||||
<span>具体详情请 <a rel="nofollow noopener noreferrer" href={href} target="_blank" download={fileName}>点击下载</a> </span>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
} else {
|
||||
this.$message.success(info.file.response.message || `${info.file.name} 文件上传成功`)
|
||||
}
|
||||
this.$message.success(info.file.response.message || `${info.file.name} 文件上传成功`)
|
||||
this.loadData()
|
||||
} else {
|
||||
if (Array.isArray(info.file.response.result) && info.file.response.result.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user