wkw hai 3 semanas
pai
achega
b2ed4b8169
Modificáronse 2 ficheiros con 12 adicións e 4 borrados
  1. 6 3
      src/views/login/index.vue
  2. 6 1
      src/views/wallet/index.vue

+ 6 - 3
src/views/login/index.vue

@@ -40,13 +40,16 @@
 </template>
 <script setup>
 import { useSystemStore } from "@/stores/modules/systemStore"
-const router = useRouter()
+import { useRoute } from 'vue-router'
+const router = useRouter();
+const route = useRoute();
 const systemStore = useSystemStore();
+const obj = route.query
 
 const checked = ref(false)
 const showBottom = ref(false);
 const isCreate = ref(true); //true:创建钱包  false:导入钱包
-const isFirst = ref(true); //true:首次  false:不是首次
+const isFirst = Object.keys(obj).length === 0 ? true : false; //true:首次  false:不是首次
 // 创建
 const changeCreate = () => {
   isCreate.value = true;
@@ -76,7 +79,7 @@ const goTo = () => {
     localStorage: true,
   });
   // 如果是第一次登录,需要选择网络
-  if(isFirst.value){
+  if(isFirst){
     router.push({
       path: '/selectNetwork'
     })

+ 6 - 1
src/views/wallet/index.vue

@@ -203,7 +203,12 @@
   }
   // 添加钱包
   const addWallet = () => {
-    
+    router.push({
+      path: '/login',
+      query:{
+        isFirst:false
+      }
+    })
   }
   onMounted(async ()=>{
     const aa = await getBalance();