尝试更新了wechatPublic登录的state为空问题
This commit is contained in:
parent
fd3104d7e0
commit
9e6922e468
|
|
@ -38,7 +38,7 @@ function Grant(props) {
|
|||
const url = new URL(decodeURIComponent(redirectUri));
|
||||
url.searchParams.set('code', code);
|
||||
if (state) {
|
||||
url.searchParams.set('state', state);
|
||||
url.searchParams.set('state', state || window.location.pathname);
|
||||
}
|
||||
window.location.href = url.toString();
|
||||
setTimeout(() => {
|
||||
|
|
@ -69,7 +69,7 @@ function Grant(props) {
|
|||
return;
|
||||
}
|
||||
setDisabled2(true);
|
||||
const url = WeChatLoginUrl(redirectUri, appId, scope, state ? `&state=${state}` : '');
|
||||
const url = WeChatLoginUrl(redirectUri, appId, scope, `&state=${state || window.location.pathname}`);
|
||||
window.location.href = url;
|
||||
setTimeout(() => {
|
||||
setDisabled2(false);
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ function Grant(props: GrantProps) {
|
|||
);
|
||||
url.searchParams.set('code', code);
|
||||
if (state) {
|
||||
url.searchParams.set('state', state);
|
||||
url.searchParams.set('state', state || window.location.pathname);
|
||||
}
|
||||
window.location.href = url.toString();
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ function Grant(props: GrantProps) {
|
|||
redirectUri,
|
||||
appId,
|
||||
scope,
|
||||
state ? `&state=${state}` : ''
|
||||
`&state=${state || window.location.pathname}`,
|
||||
);
|
||||
|
||||
window.location.href = url;
|
||||
|
|
|
|||
Loading…
Reference in New Issue