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

@@ -702,6 +702,11 @@ export default {
if (q && (q.indexOf('%') === 0 || q.indexOf('%20') > -1 || q.indexOf('%25') > -1)) {
q = decodeURI(q)
}
// %位置不为0即内容包含非英文时
const str1 = q.substring(q.indexOf('%'), q.indexOf('%') + 3)
if (q && q.indexOf('%') > 0 && (str1 !== '%20' || str1 === '%25')) {
q = decodeURI(q)
}
this.initSearch(q)
this.listMode = listMode
}