Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 支付宝小程序通过 getSearchParams 取到的值有问题 #70

Open
fengzilong opened this issue Jan 8, 2021 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@fengzilong
Copy link

fengzilong commented Jan 8, 2021

跳转代码已对 url 做 encode

import navigate from 'universal-navigate'

navigate.push( {
  url: '/pages/webview/index?url=' + encodeURIComponent( url )
} )

在另一个页面获取 searchParams

import { getSearchParams } from 'rax-app'

return () => {
  const searchParams = getSearchParams();
  // 这里的 searchParams 存在问题
}

假如传入的 url 是 "https://a.com?foo=1&bar=2"

在支付宝小程序中获取到的 searchParams 为

{
  "url": "https://a.com?foo=1",
  "bar": 2
}

正确的值应该为

{
  "url": "https://a.com?foo=1&bar=2",
}

在微信小程序中没有问题

@fengzilong fengzilong changed the title [Bug] 支付宝小程序通过 SearchParams 取到的值有问题 [Bug] 支付宝小程序通过 getSearchParams 取到的值有问题 Jan 8, 2021
@SoloJiang SoloJiang added the bug Something isn't working label Jan 8, 2021
@ChrisCindy
Copy link
Contributor

ChrisCindy commented Apr 23, 2021

"https://a.com/foo=1&bar=2"
这里少了个 ? 吧,应该是 "https://a.com/?foo=1&bar=2"

@fengzilong
Copy link
Author

"a.com/foo=1&bar=2"
这里少了个 ? 吧,应该是 "a.com/?foo=1&bar=2"

这个问号打漏了,但是加上"?"也还是有一样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants