|
@@ -64,7 +64,7 @@
|
|
<FontZoom width="330">
|
|
<FontZoom width="330">
|
|
<div class="mobile-land-page-tip">{{ tipCpd }}</div>
|
|
<div class="mobile-land-page-tip">{{ tipCpd }}</div>
|
|
</FontZoom>
|
|
</FontZoom>
|
|
- <div class="mobile-land-page-login-twitter" @click="toLogin">Login Twitter</div>
|
|
+ <div class="mobile-land-page-login-twitter" @click="toLogin">{{ isLoginCpd ? 'Claim Prize' : 'Login Twitter' }}</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
@@ -182,14 +182,17 @@ export default {
|
|
return 'login Twitter to install DeNet Chrome Extension';
|
|
return 'login Twitter to install DeNet Chrome Extension';
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ isLoginCpd() {
|
|
|
|
+ return !!getStorage(storageKey.userInfo);
|
|
|
|
+ },
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
toLogin() {
|
|
toLogin() {
|
|
let userInfo = getStorage(storageKey.userInfo);
|
|
let userInfo = getStorage(storageKey.userInfo);
|
|
if (userInfo) {
|
|
if (userInfo) {
|
|
- setStorage(TO_LOGIN_KEY, 1);
|
|
|
|
location.href = `/course?useful=${this.useFul ? '1' : '0'}&playType=${this.playType}&rewardType=${this.rewardType}&postId=${this.postId}`;
|
|
location.href = `/course?useful=${this.useFul ? '1' : '0'}&playType=${this.playType}&rewardType=${this.rewardType}&postId=${this.postId}`;
|
|
} else {
|
|
} else {
|
|
|
|
+ setStorage(TO_LOGIN_KEY, 1);
|
|
this.twitterAuth();
|
|
this.twitterAuth();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -200,9 +203,7 @@ export default {
|
|
},
|
|
},
|
|
}).then(({ code, data }) => {
|
|
}).then(({ code, data }) => {
|
|
if (code == 0) {
|
|
if (code == 0) {
|
|
- console.log('%c [ data ]-78', 'font-size:13px; background:pink; color:#bf2c9f;', data);
|
|
|
|
let url = getOauthUrl(data.authToken);
|
|
let url = getOauthUrl(data.authToken);
|
|
-
|
|
|
|
let win = createWindow(url);
|
|
let win = createWindow(url);
|
|
this.timer.value = setInterval(() => {
|
|
this.timer.value = setInterval(() => {
|
|
if (win && win.closed) {
|
|
if (win && win.closed) {
|
|
@@ -224,7 +225,6 @@ export default {
|
|
},
|
|
},
|
|
}).then(({ code, data }) => {
|
|
}).then(({ code, data }) => {
|
|
if (code == 0) {
|
|
if (code == 0) {
|
|
- console.log('%c [ data ]-100', 'font-size:13px; background:pink; color:#bf2c9f;', data);
|
|
|
|
setStorage(storageKey.userInfo, data);
|
|
setStorage(storageKey.userInfo, data);
|
|
removeStorage(storageKey.verifier);
|
|
removeStorage(storageKey.verifier);
|
|
}
|
|
}
|