Просмотр исходного кода

登录后查询电子卡价格

shmily1213 1 неделя назад
Родитель
Сommit
8b23545a9c
2 измененных файлов с 5 добавлено и 2 удалено
  1. 0 1
      src/hooks/usePay.ts
  2. 5 1
      src/pagesMain/pages/me/me.vue

+ 0 - 1
src/hooks/usePay.ts

@@ -201,7 +201,6 @@ export const usePay = () => {
     callback.value = cb;
   }
 
-  getPrice();
   return {
     getPrice,
     price,

+ 5 - 1
src/pagesMain/pages/me/me.vue

@@ -11,12 +11,16 @@
 
 <script lang="ts" setup>
 import { usePay } from '@/hooks/usePay';
+import { useUserStore } from '@/store/userStore';
 import meInfo from './components/me-info.vue';
 import meMenu from './components/me-menu.vue';
 
+const userStore = useUserStore();
 const { getPrice } = usePay();
 onLoad(() => {
-  getPrice();
+  if (userStore.isLogin) {
+    getPrice();
+  }
 });
 </script>