nieyuge 2 年 前
コミット
50766dcdbb
2 ファイル変更5 行追加11 行削除
  1. 3 5
      src/components/header.vue
  2. 2 6
      src/pages/nft/list.vue

+ 3 - 5
src/components/header.vue

@@ -20,19 +20,17 @@ import { postRequest } from '../static/http'
 import { getMid, appVersionCode, getOauthUrl, createWindow, callBackUrl } from '../static/utils'
 import { getStorage, removeStorage, setStorage, storageKey } from '../static/utils/storage'
 import { ref } from 'vue'
-import { useRouter } from 'vue-router'
 import { ElMessage } from 'element-plus'
 
 const timer = ref(0)
 
-const router = useRouter()
-
 const install =  () => {
     window.open(`https://chrome.google.com/webstore/detail/denet/inlfbeejfdgkknpiodhemfcokbdgofja`);
 }
 
 const checkInstall = () => {
     return new Promise((resolve, reject) => {
+        // chrome-extension://inlfbeejfdgkknpiodhemfcokbdgofja/img/icon-denet-logo.svg
         let dom = document.querySelector('#denet_message');
         if (dom) {
             resolve(true)
@@ -46,7 +44,7 @@ const login = () => {
     checkInstall().then(() => {
         let userInfo = getStorage(storageKey.userInfo);
         if (userInfo) {
-            router.push(`/nft/list`)
+            location.href = `/nft/list`
         } else {
             twitterAuth()
         }
@@ -103,7 +101,7 @@ const twitterLogin = (data: { authToken: string, consumerKey: string }) => {
             if ( code === 0 ) {
                 setStorage(storageKey.userInfo, data);
                 removeStorage(storageKey.verifier);
-                router.push(`/nft/list`)
+                location.href = `/nft/list`
             } else {
                 ElMessage({
                     offset: 100,

+ 2 - 6
src/pages/nft/list.vue

@@ -56,23 +56,19 @@
 
 <script lang="ts" setup>
 import { onMounted, ref } from 'vue'
-import { useRouter } from  'vue-router'
 import { getStorage, storageKey, removeStorage } from '../../static/utils/storage'
 
 const userInfo: any = ref({});
-
-const router = useRouter()
-
 const publishDialog = ref(false)
 const deleteDialog = ref(false)
 
 const logout = () => {
     removeStorage(storageKey.userInfo)
-    router.push({ name: 'home' })
+    location.href = `/`
 }
 
 const add = () => {
-    router.push({ name: 'nft-add' })
+    location.href = `/nft/add`
 }
 
 onMounted(() => {