修复:优化访客模式
This commit is contained in:
@@ -459,7 +459,12 @@ const requestAll = async () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 重置分类索引
|
// 重置分类索引
|
||||||
currentIndex.value = 0
|
currentIndex.value = 0
|
||||||
|
if(!uni.getStorageSync('state') && !uni.getStorageSync('token')) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(uni.getStorageSync('state')) uni.removeStorageSync('state')
|
||||||
// 请求所有数据
|
// 请求所有数据
|
||||||
requestAll()
|
requestAll()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -401,6 +401,7 @@ const yszc = () => {
|
|||||||
* 页面跳转
|
* 页面跳转
|
||||||
*/
|
*/
|
||||||
const onPageSwitch = (url: string) => {
|
const onPageSwitch = (url: string) => {
|
||||||
|
uni.setStorageSync('state', 'true');
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: url,
|
url: url,
|
||||||
})
|
})
|
||||||
@@ -446,7 +447,6 @@ const getOS = () =>{
|
|||||||
const oprateOs = uni.getSystemInfoSync().platform
|
const oprateOs = uni.getSystemInfoSync().platform
|
||||||
console.log(oprateOs, 'oprateOs');
|
console.log(oprateOs, 'oprateOs');
|
||||||
isAndorid.value = oprateOs === "android" ? true : false
|
isAndorid.value = oprateOs === "android" ? true : false
|
||||||
console.log(isAndorid.value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user