function cleanMaliciousCode(decodedStr) { // 定义一系列的恶意代码和关键字 const maliciousPatterns = [ /eval\s*\(/gi, // 检测 eval /document\.location/gi, // 页面跳转 /window\.location/gi, // 页面跳转 /window\.location\.href/gi, // 页面跳转 /http:\/\/[^\s]+/gi, // 匹配任何http协议的URL /https:\/\/[^\s]+/gi, // 匹配任何https协议的URL /javascript:/gi, // 匹配javascript: /