|
@@ -26,29 +26,27 @@ const guard = (router: Router) => {
|
|
} catch (error) {
|
|
} catch (error) {
|
|
//监听到登陆事件
|
|
//监听到登陆事件
|
|
if (to.query.state === "LOGIN") {
|
|
if (to.query.state === "LOGIN") {
|
|
- setTimeout(async () => {
|
|
|
|
- const toast = Toast.loading({
|
|
|
|
- duration: 0, // 持续展示 toast
|
|
|
|
- forbidClick: true,
|
|
|
|
- message: "登陆中",
|
|
|
|
- });
|
|
|
|
- try {
|
|
|
|
- await useLogin(to.query);
|
|
|
|
- toast.message = `登陆成功`;
|
|
|
|
- setTimeout(() => {
|
|
|
|
- Toast.clear();
|
|
|
|
- }, 500);
|
|
|
|
- } catch (error) {
|
|
|
|
- toast.message = `登陆失败`;
|
|
|
|
- setTimeout(() => {
|
|
|
|
- Toast.clear();
|
|
|
|
- location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx67ca1b8c9816ef28&redirect_uri=https://jpcj-h5.zzxcx.net/home/test&response_type=code&scope=snsapi_userinfo&state=LOGIN#wechat_redirect`);
|
|
|
|
- }, 1000);
|
|
|
|
- }
|
|
|
|
- }, 1000);
|
|
|
|
|
|
+ next();
|
|
|
|
+ const toast = Toast.loading({
|
|
|
|
+ duration: 0, // 持续展示 toast
|
|
|
|
+ forbidClick: true,
|
|
|
|
+ message: "登陆中",
|
|
|
|
+ });
|
|
|
|
+ try {
|
|
|
|
+ await useLogin(to.query);
|
|
|
|
+ toast.message = `登陆成功`;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ Toast.clear();
|
|
|
|
+ }, 500);
|
|
|
|
+ } catch (error) {
|
|
|
|
+ toast.message = `登陆失败`;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ Toast.clear();
|
|
|
|
+ location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx67ca1b8c9816ef28&redirect_uri=https://jpcj-h5.zzxcx.net/home/test&response_type=code&scope=snsapi_userinfo&state=LOGIN#wechat_redirect`);
|
|
|
|
+ }, 1000);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- // location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx67ca1b8c9816ef28&redirect_uri=${location.href}&response_type=code&scope=snsapi_userinfo&state=LOGIN#wechat_redirect`);
|
|
|
|
- window.open(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx67ca1b8c9816ef28&redirect_uri=${location.href}&response_type=code&scope=snsapi_userinfo&state=LOGIN#wechat_redirect`);
|
|
|
|
|
|
+ location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx67ca1b8c9816ef28&redirect_uri=${location.href}&response_type=code&scope=snsapi_userinfo&state=LOGIN#wechat_redirect`);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|