fix: 修复实体搜索内容包含非英文时会弹窗提示非法字符串的问题

This commit is contained in:
刘洪洪
2023-10-08 17:26:32 +08:00
parent 5a4301e3aa
commit 6f72b2258f
4 changed files with 18 additions and 2 deletions

View File

@@ -225,6 +225,11 @@ export default {
if (q) {
if (q.indexOf('%') === 0 || q.indexOf('%20') > -1 || q.indexOf('%25') > -1) {
q = decodeURI(q)
} else {
const str1 = q.substring(q.indexOf('%'), q.indexOf('%') + 3)
if (q.indexOf('%') > 0 && (str1 !== '%20' || str1 === '%25')) {
q = decodeURI(q)
}
}
// 为避免地址栏任意输入导致全查询的q带QUERY解析时不识别导致的语法错误
// 如地址栏输入116.178.222.171此时的q很长刷新界面时需要把q里的116.178.222.171拿出来进行搜索