This commit is contained in:
杨鹏
2025-10-15 19:19:00 +08:00
parent c3fd0c2e00
commit 3b38ce766e
2 changed files with 13 additions and 7 deletions
+9 -1
View File
@@ -10,7 +10,7 @@
<script setup> <script setup>
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import { onLoad, onUnload, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app'; import { onLoad, onUnload, onShow, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
import sheep from '@/sheep'; import sheep from '@/sheep';
import $share from '@/sheep/platform/share'; import $share from '@/sheep/platform/share';
import CoverViewTabbar from '@/pages/index/components/cover-view-tabbar.vue'; import CoverViewTabbar from '@/pages/index/components/cover-view-tabbar.vue';
@@ -34,6 +34,14 @@
`https://fitting-room.huimeimeta.com/pages/report/index?token=${getAccessToken()}&t=${Date.now()}`, `https://fitting-room.huimeimeta.com/pages/report/index?token=${getAccessToken()}&t=${Date.now()}`,
); );
const isLogin = computed(() => sheep.$store('user').isLogin);
onShow(() => {
if (!isLogin) {
uni.redirectTo({ url: '/pages/login/index' });
}
});
onLoad((options) => { onLoad((options) => {
// #ifdef MP // #ifdef MP
// 小程序识别二维码 // 小程序识别二维码
+4 -6
View File
@@ -89,14 +89,12 @@
const curStep = ref(0); const curStep = ref(0);
const jumpPage = () => { const jumpPage = () => {
if (curStep.value === 0) { if (!isLogin) {
uni.redirectTo({ url: '/pages/login/index' });
} else if (curStep.value === 0) {
sheep.$router.go('/pages/index/index'); sheep.$router.go('/pages/index/index');
} else { } else {
if (!isLogin) { sheep.$router.go('/pages/index/room');
uni.redirectTo({ url: '/pages/login/index' });
} else {
sheep.$router.go('/pages/index/room');
}
} }
}; };
</script> </script>