代码中有 window.location.href = ${window.location.origin}/#/full-screen
报告检测出安全漏洞
Cross-Site Scripting: DOM
请问这怎么修复啊,我就是需要跳转到指定页面
我需要这么跳转的原因是,我有如下几个模块
www.baidu.com/#/full-screen 假设这是登录页面
www.baidu.com/module1/#/home
www.baidu.com/module2/#/home
www.baidu.com/module3/#/home
module1,module2,module3是ngxin路径,每个路径是一个子项目
只有www.baidu.com
是有登录页面的,所以当我在www.baidu.com/module3/#/home
失去登录的时候其实根路径是www.baidu.com/module3
,所以这么跳转window.location.href = '/#/full-screen'
其实是无法到达www.baidu.com/#/full-screen
的
这样是不行的
window.location.href = ${window.location.origin}/#/full-screen
但是这样是可以的
window.location.href = ${origin}/#/full-screen
我感觉应该是location.origin可能被篡改,但是扫描工具不知道origin是个什么鬼东西,所以就可以了