.
This commit is contained in:
@@ -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
|
||||||
// 小程序识别二维码
|
// 小程序识别二维码
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user