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

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

快乐的梦鱼 недель назад: 3
Родитель
Сommit
48f1006bc7
1 измененных файлов с 8 добавлено и 4 удалено
  1. 8 4
      src/pages/user/index.vue

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

@@ -66,8 +66,8 @@
     </BoxMid>
     </BoxMid>
 
 
     <ImageSwiper
     <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"
       :width="690"
       mode="aspectFill"
       mode="aspectFill"
       radius="radius.md"
       radius="radius.md"
@@ -97,7 +97,7 @@
 </template>
 </template>
 
 
 <script setup lang="ts">
 <script setup lang="ts">
-import { computed, onMounted } from 'vue';
+import { computed, onMounted, watch } from 'vue';
 import { navTo } from '@/components/utils/PageAction';
 import { navTo } from '@/components/utils/PageAction';
 import { confirm } from '@/components/dialog/CommonRoot';
 import { confirm } from '@/components/dialog/CommonRoot';
 import { useAuthStore } from '@/store/auth';
 import { useAuthStore } from '@/store/auth';
@@ -132,7 +132,7 @@ const appConfig = injectAppConfiguration();
 
 
 const authStore = useAuthStore();
 const authStore = useAuthStore();
 const userInfo = computed(() => authStore.isLogged ? authStore.userInfo : null);
 const userInfo = computed(() => authStore.isLogged ? authStore.userInfo : null);
-const { volunteerInfo } = useVolunteerInfo();
+const { volunteerInfo, getIsVolunteer } = useVolunteerInfo();
 const { requireLogin } = useRequireLogin();
 const { requireLogin } = useRequireLogin();
 const { finalUrl: storeOrderFinalUrl } = useWebPassToken('https://xycdn.wenlvti.net/assets/addons/yunexamine/h5/', '/pages/gift/order');
 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');
 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(() => {
 onMounted(() => {
   if (authStore.isLogged)
   if (authStore.isLogged)
     authStore.refreshUserInfo();
     authStore.refreshUserInfo();