"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.reLaunch({
        url: "/pages/login/login"
      });
      return;
    }
    common_vendor.index.navigateTo({
      url: path
    });
  };
  return {
    nav,
    navTo
  };
}
exports.useNav = useNav;
