fix: 解码URL参数以正确处理特殊字符
在`projectComparison.js`和`projectDetails.js`中,添加了对`options.q`参数的解码逻辑,确保URL中的特殊字符被正确解析。这解决了因未解码参数导致的潜在问题。
This commit is contained in:
parent
c168ac523f
commit
c811ace0dc
@ -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;
|
||||
|
@ -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 || {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user