.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
<script setup>
|
||||
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 $share from '@/sheep/platform/share';
|
||||
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()}`,
|
||||
);
|
||||
|
||||
const isLogin = computed(() => sheep.$store('user').isLogin);
|
||||
|
||||
onShow(() => {
|
||||
if (!isLogin) {
|
||||
uni.redirectTo({ url: '/pages/login/index' });
|
||||
}
|
||||
});
|
||||
|
||||
onLoad((options) => {
|
||||
// #ifdef MP
|
||||
// 小程序识别二维码
|
||||
|
||||
@@ -89,14 +89,12 @@
|
||||
const curStep = ref(0);
|
||||
|
||||
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');
|
||||
} else {
|
||||
if (!isLogin) {
|
||||
uni.redirectTo({ url: '/pages/login/index' });
|
||||
} else {
|
||||
sheep.$router.go('/pages/index/room');
|
||||
}
|
||||
sheep.$router.go('/pages/index/room');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user