From 56772970e21c150810efbc44ca857a71d5229251 Mon Sep 17 00:00:00 2001 From: fuchao <2577131060@qq.com> Date: Thu, 18 Dec 2025 14:03:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AE=BF=E5=AE=A2=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/course/index.vue | 7 ++++++- pages/login/login.vue | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pages/course/index.vue b/pages/course/index.vue index c7695e3..76ae958 100644 --- a/pages/course/index.vue +++ b/pages/course/index.vue @@ -459,7 +459,12 @@ const requestAll = async () => { onMounted(() => { // 重置分类索引 currentIndex.value = 0 - + if(!uni.getStorageSync('state') && !uni.getStorageSync('token')) { + uni.navigateTo({ + url: '/pages/login/login' + }); + } + if(uni.getStorageSync('state')) uni.removeStorageSync('state') // 请求所有数据 requestAll() }) diff --git a/pages/login/login.vue b/pages/login/login.vue index d02c9a4..a10b9d9 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -401,6 +401,7 @@ const yszc = () => { * 页面跳转 */ const onPageSwitch = (url: string) => { + uni.setStorageSync('state', 'true'); uni.switchTab({ url: url, }) @@ -446,7 +447,6 @@ const getOS = () =>{ const oprateOs = uni.getSystemInfoSync().platform console.log(oprateOs, 'oprateOs'); isAndorid.value = oprateOs === "android" ? true : false - console.log(isAndorid.value); } onMounted(() => {