Преглед на файлове

Merge branch 'feature-landpage-update' into dev_1.1.7_lint

jihuaqiang преди 2 години
родител
ревизия
e61c9bf211
променени са 2 файла, в които са добавени 6 реда и са изтрити 11 реда
  1. 4 11
      components/MobileLandPage.vue
  2. 2 0
      pages/auth/authLogin.vue

+ 4 - 11
components/MobileLandPage.vue

@@ -60,7 +60,7 @@
 		<FontZoom width="330">
 			<div class="mobile-land-page-tip">{{ tipCpd }}</div>
 		</FontZoom>
-		<div class="mobile-land-page-login-twitter" @click="toLogin">{{ isLoginCpd ? 'Claim Prize' : 'Login Twitter' }}</div>
+		<div class="mobile-land-page-login-twitter" @click="toLogin">{{ isLoginCpd || loginSuccessBack ? 'Claim Prize' : 'Login Twitter' }}</div>
 	</div>
 </template>
 <script>
@@ -69,8 +69,6 @@ import { getStorage, setStorage, removeStorage, storageKey, getOauthUrl, createW
 import { postRequest } from '../http';
 import FontZoom from './FontZoom';
 
-const TO_LOGIN_KEY = 'twitter-login-from-denet-mobile-h5-landpage';
-
 const overTimePic = require('../static/img/icon-h5-denet.svg');
 const giveawayPic = require('../static/img/icon-h5-giveaway.svg');
 const redpackPic = require('../static/img/icon-h5-redpack.svg');
@@ -133,6 +131,7 @@ export default {
 	data() {
 		return {
 			timer: {},
+			loginSuccessBack: false,
 		};
 	},
 	computed: {
@@ -188,7 +187,6 @@ export default {
 			if (userInfo) {
 				location.href = `/course?useful=${this.useFul ? '1' : '0'}&playType=${this.playType}&rewardType=${this.rewardType}&postId=${this.postId}`;
 			} else {
-				setStorage(TO_LOGIN_KEY, 1);
 				this.twitterAuth();
 			}
 		},
@@ -223,18 +221,13 @@ export default {
 					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}`;
 					}
 				});
 			}
 		},
 	},
-	mounted() {
-		const fromTwitterLoginPage = getStorage(TO_LOGIN_KEY);
-		if (fromTwitterLoginPage) {
-			removeStorage(TO_LOGIN_KEY);
-			location.href = `/course?useful=${this.useFul ? '1' : '0'}&playType=${this.playType}&rewardType=${this.rewardType}&postId=${this.postId}`;
-		}
-	},
 	components: { FontZoom },
 };
 </script>

+ 2 - 0
pages/auth/authLogin.vue

@@ -30,6 +30,8 @@ export default {
 			setTimeout(() => {
 				this.close();
 			}, time);
+		} else {
+			this.close();
 		}
 	},
 };