"use strict";const common_vendor=require("../common/vendor.js");function useNav(){const nav=e=>{common_vendor.index[e.type=="nav"||!e.type?"navigateTo":e.type=="switchTab"?"switchTab":"navigateTo"]({url:e.path})};const navTo=(path,token,call)=>{if(!common_vendor.index.getStorageSync("token")){common_vendor.index.showModal({title:"提示",content:"为提供更好的服务，请前往登录",success:res=>{if(res.confirm){common_vendor.index.navigateTo({url:"/pages/login/login"})}else if(res.cancel){console.log("用户点击取消")}}});return}common_vendor.index.navigateTo({url:path})};return{nav:nav,navTo:navTo}}exports.useNav=useNav;
