Prechádzať zdrojové kódy

🎨 修复登录后积分未修改问题

快乐的梦鱼 3 týždňov pred
rodič
commit
48f1006bc7
1 zmenil súbory, kde vykonal 8 pridanie a 4 odobranie
  1. 8 4
      src/pages/user/index.vue

+ 8 - 4
src/pages/user/index.vue

@@ -66,8 +66,8 @@
     </BoxMid>
 
     <ImageSwiper
-      :images="appConfig.banners.userAd?.images || []"
-      :height="appConfig.banners.userAd?.height || 0"
+      :images="appConfig?.banners?.userAd?.images || []"
+      :height="appConfig?.banners?.userAd?.height || 0"
       :width="690"
       mode="aspectFill"
       radius="radius.md"
@@ -97,7 +97,7 @@
 </template>
 
 <script setup lang="ts">
-import { computed, onMounted } from 'vue';
+import { computed, onMounted, watch } from 'vue';
 import { navTo } from '@/components/utils/PageAction';
 import { confirm } from '@/components/dialog/CommonRoot';
 import { useAuthStore } from '@/store/auth';
@@ -132,7 +132,7 @@ const appConfig = injectAppConfiguration();
 
 const authStore = useAuthStore();
 const userInfo = computed(() => authStore.isLogged ? authStore.userInfo : null);
-const { volunteerInfo } = useVolunteerInfo();
+const { volunteerInfo, getIsVolunteer } = useVolunteerInfo();
 const { requireLogin } = useRequireLogin();
 const { finalUrl: storeOrderFinalUrl } = useWebPassToken('https://xycdn.wenlvti.net/assets/addons/yunexamine/h5/', '/pages/gift/order');
 const { finalUrl: storeFinalUrl } = useWebPassToken('https://xycdn.wenlvti.net/assets/addons/yunexamine/h5/', '/pages/gift/index');
@@ -162,6 +162,10 @@ function goStore() {
   }), '登录后查看我的哦');
 }
 
+watch(() => authStore.isLogged, (newVal) => {
+  if (newVal)
+    getIsVolunteer();
+});
 onMounted(() => {
   if (authStore.isLogged)
     authStore.refreshUserInfo();