shuishen
2026-05-15 fe1a7f5e5e96f961c06caf8bcd8e513447468f6b
1
2
3
4
5
6
7
8
9
10
import { hasPerm } from "@/plugins/permission"
import { currentRoute } from "@/router"
 
// 对某些特殊场景需要在页面onShow生命周期中校验权限:
// 1.微信小程序端点击tabbar的底层逻辑不触发uni.switchTab
// 2.h5在浏览器地址栏输入url后跳转不触发uni的路由api
// 3.首次启动加载的页面不触发uni的路由api
export default async function usePermission () {
  return hasPerm(currentRoute())
}