|
@@ -225,7 +225,7 @@ export default {
|
|
|
if (userInfo) {
|
|
|
// ios手机跳转时丢失log,缓存至下个页面进行上报
|
|
|
setStorage('land-page-log', JSON.stringify(logData));
|
|
|
- location.href = `/course?useful=${this.useFul ? '1' : '0'}&playType=${this.playType}&rewardType=${this.rewardType}&postId=${this.postId}&nftProjectId=${this.nftProjectId}&srcContentId=${this.srcContentId}`;
|
|
|
+ this.goCoursePage();
|
|
|
} else {
|
|
|
Report.reportLog(logData);
|
|
|
this.twitterAuth();
|
|
@@ -252,6 +252,7 @@ export default {
|
|
|
clearInterval(this.timer.value);
|
|
|
this.twitterLogin(data);
|
|
|
if (getStorage(storageKey.backFromTwitterLogin)) {
|
|
|
+ // 从twitter授权取消页面回来
|
|
|
this.isLoading = false;
|
|
|
removeStorage(storageKey.backFromTwitterLogin);
|
|
|
this.goCoursePage();
|
|
@@ -267,6 +268,7 @@ export default {
|
|
|
},
|
|
|
async twitterLogin(authData) {
|
|
|
let verifier = getStorage(storageKey.verifier);
|
|
|
+ removeStorage('goto-twitter-login-page');
|
|
|
if (verifier) {
|
|
|
postRequest(`/denet/user/twitterLogin`, {
|
|
|
params: {
|
|
@@ -275,12 +277,15 @@ export default {
|
|
|
oauthVerifier: verifier,
|
|
|
},
|
|
|
}).then(({ code, data }) => {
|
|
|
- this.isLoading = false;
|
|
|
if (code == 0) {
|
|
|
setStorage(storageKey.userInfo, data);
|
|
|
removeStorage(storageKey.verifier);
|
|
|
this.loginSuccessBack = true;
|
|
|
- location.href = `/course?useful=${this.useFul ? '1' : '0'}&playType=${this.playType}&rewardType=${this.rewardType}&postId=${this.postId}`;
|
|
|
+ this.isLoading = false;
|
|
|
+ this.goCoursePage();
|
|
|
+ } else {
|
|
|
+ this.isLoading = false;
|
|
|
+ Toast('login fail');
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
@@ -291,6 +296,7 @@ export default {
|
|
|
console.log('visibilitychange', document.hidden);
|
|
|
var isHidden = document.hidden;
|
|
|
if (!isHidden) {
|
|
|
+ // 此处解决 点击login按钮后 主动返回的情况
|
|
|
let verifier = getStorage(storageKey.verifier);
|
|
|
const isFromTwitterLoginPage = getStorage('goto-twitter-login-page');
|
|
|
if (isFromTwitterLoginPage && !verifier) {
|