import { hasPermission } from "@/utils/page.js" // 页面白名单 不登录可访问的页面 uni.addInterceptor('navigateTo', { // 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转 invoke(e) { if (!hasPermission(e.url)) { return false } return true } }) uni.addInterceptor('switchTab', { // tabbar页面跳转前进行拦截 invoke(e) { if (!hasPermission(e.url)) { return false } return true } })