fix: 解码URL参数以正确处理特殊字符

在`projectComparison.js`和`projectDetails.js`中,添加了对`options.q`参数的解码逻辑,确保URL中的特殊字符被正确解析。这解决了因未解码参数导致的潜在问题。
This commit is contained in:
DESKTOP-RQ919RC\Pc 2025-04-10 18:41:03 +08:00
parent c168ac523f
commit c811ace0dc
2 changed files with 14 additions and 0 deletions

View File

@ -58,6 +58,13 @@ Page({
options: {},
ids: [],
onLoad(options) {
if (options.q) {
let decodedUrl = options.q;
while (decodedUrl !== decodeURIComponent(decodedUrl)) {
decodedUrl = decodeURIComponent(decodedUrl);
}
options.q = decodedUrl
}
this.options = options
if (options.ids) {
let decodedUrl = options.ids;

View File

@ -136,6 +136,13 @@ Page({
*/
options: {},
onLoad(options) {
if (options.q) {
let decodedUrl = options.q;
while (decodedUrl !== decodeURIComponent(decodedUrl)) {
decodedUrl = decodeURIComponent(decodedUrl);
}
options.q = decodedUrl
}
this.options = options
miucms.pageStart(app).then(() => {
const screen_data = app.globalData.screen_data || {}