|
@@ -0,0 +1,63 @@
|
|
|
+<!-- 移动端 twitter授权登录中间页 -->
|
|
|
+<template>
|
|
|
+ <div class="welcome">
|
|
|
+ <span class="text"></span>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: 'authLogin',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ code: '',
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ let url = new URL(window.location.href);
|
|
|
+ let search = url.search;
|
|
|
+ let urlParams = new URLSearchParams(search);
|
|
|
+ let verifier = urlParams.get('oauth_verifier');
|
|
|
+ if (verifier) {
|
|
|
+ alert(verifier);
|
|
|
+ window.ReactNativeWebView.postMessage(
|
|
|
+ JSON.stringify({
|
|
|
+ verifier,
|
|
|
+ })
|
|
|
+ );
|
|
|
+ // setStorage(storageKey.verifier, verifier);
|
|
|
+ // let time = process.env.NODE_ENV === 'production' ? 200 : 500;
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.close();
|
|
|
+ // }, time);
|
|
|
+ } else {
|
|
|
+ // 用户取消 或者 异常进入
|
|
|
+ window.ReactNativeWebView.postMessage(
|
|
|
+ JSON.stringify({
|
|
|
+ verifier,
|
|
|
+ })
|
|
|
+ );
|
|
|
+ // setStorage(storageKey.backFromTwitterLogin, 1);
|
|
|
+ // this.close();
|
|
|
+ }
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+body {
|
|
|
+ background-color: #f5f5f5;
|
|
|
+}
|
|
|
+
|
|
|
+.welcome {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ .text {
|
|
|
+ font-size: 22px;
|
|
|
+ color: #1d9bf0;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|