Skip to content

Commit

Permalink
fix: 解决onload拿到的数据被默认decode的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
human committed Jan 13, 2025
1 parent 45cd200 commit 805aca4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/core/src/platform/patch/getDefaultOptions.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,12 @@ export function getDefaultOptions ({ type, rawOptions = {}, currentInject }) {
if (!global.__mpxAppHotLaunched && global.__mpxAppOnLaunch) {
global.__mpxAppOnLaunch(props.navigation)
}
// 此处拿到的props.route.params内属性的value被进行过了一次decode, 不符合预期,此处额外进行一次encode来与微信对齐
if (isObject(props.route.params)) {
for (const key in props.route.params) {
props.route.params[key] = encodeURIComponent(props.route.params[key])
}
}
proxy.callHook(ONLOAD, [props.route.params || {}])
}
proxy.mounted()
Expand Down

0 comments on commit 805aca4

Please sign in to comment.