美文网首页
uniapp用登陆页面作为首页,然后根据登陆信息进行判断跳转页面

uniapp用登陆页面作为首页,然后根据登陆信息进行判断跳转页面

作者: Morbid_D | 来源:发表于2023-01-10 14:20 被阅读0次

uniapp用登陆页面作为首页,然后根据登陆信息进行判断跳转页面会有一闪而过的情景,解决方法

1.在App.vue里

onlaunch:function(){

    if(uni.getStorageSync('userInfoFLS')){

this.globalData.userInfo = uni.getStorageSync('userInfoFLS')

uni.switchTab({

url:'/pages/index/index',

success() {

plus.navigator.closeSplashscreen()

}

})

}else{

uni.reLaunch({

url:'/pages/index/login',

success() {

plus.navigator.closeSplashscreen()

}

})

}

}

2.在manifest.json中找到源码视图,在app-plus中找到splashscreen ,修改为

"splashscreen" : {

            "alwaysShowBeforeRender" : false,

            "waiting" : false,

            "autoclose" : false,

            "delay" : 0

        },

相关文章

网友评论

      本文标题:uniapp用登陆页面作为首页,然后根据登陆信息进行判断跳转页面

      本文链接:https://www.haomeiwen.com/subject/uhdvcdtx.html