Pre Merge pull request !52 from blue2999/N/A
commit
1832199791
|
|
@ -17,22 +17,28 @@
|
||||||
const event = options.event;
|
const event = options.event;
|
||||||
const code = options.code;
|
const code = options.code;
|
||||||
const state = options.state;
|
const state = options.state;
|
||||||
|
let time = 10;
|
||||||
if (event === 'login') { // 场景一:登录
|
if (event === 'login') { // 场景一:登录
|
||||||
const res = await sheep.$platform.useProvider().login(code, state);
|
const res = await sheep.$platform.useProvider().login(code, state);
|
||||||
} else if (event === 'bind') { // 场景二:绑定
|
} else if (event === 'bind') { // 场景二:绑定
|
||||||
sheep.$platform.useProvider().bind(code, state);
|
sheep.$platform.useProvider().bind(code, state);
|
||||||
|
time = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检测 H5 登录回调
|
// 避免先用手机登录再到付款页面重新微信授权登录时,绑定openId还没执行完就跳转回去,又陷入没登录的循环,所以这里做一个延迟跳转
|
||||||
let returnUrl = uni.getStorageSync('returnUrl');
|
setTimeout(function(){
|
||||||
if (returnUrl) {
|
// 检测 H5 登录回调
|
||||||
uni.removeStorage({key:'returnUrl'});
|
let returnUrl = uni.getStorageSync('returnUrl');
|
||||||
location.replace(returnUrl);
|
if (returnUrl) {
|
||||||
} else {
|
uni.removeStorage({key:'returnUrl'});
|
||||||
uni.switchTab({
|
location.replace(returnUrl);
|
||||||
url: '/',
|
} else {
|
||||||
});
|
uni.switchTab({
|
||||||
}
|
url: '/',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},time);
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue