进入App首次打开不进入登录页面
manifest.json 源码配置
"app-plus" : {
"splashscreen" : {
"alwaysShowBeforeRender" : false,
"waiting" : true,
"autoclose" : false,
"delay" : 0
}
}
App.vue 文件 onLaunch 生命周期里面写法
onLaunch: function() {
console.log('App Launch');
// #ifdef APP-PLUS
// token标志来判断
let token= uni.getStorageSync('token');
if (token) {
//存在token则跳转至登录页
uni.reLaunch({
url: "/pages/login/login",
success: () => {
plus.navigator.closeSplashscreen();
}
})
} else {
//不存在则关闭启动页进入首页
plus.navigator.closeSplashscreen();
}
// #endif
}
详情见 https://blog.csdn.net/weixin_43887780/article/details/114638694