"use strict";
const common_vendor = require("../common/vendor.js");
const utils_pageUrl = require("./pageUrl.js");
function navTo(obj) {
  let token = "";
  {
    const { envVersion } = common_vendor.index.getAccountInfoSync().miniProgram;
    if (envVersion == "release") {
      token = common_vendor.index.getStorageSync("AUTH_TOKEN_CASEDATA");
    } else {
      token = common_vendor.index.getStorageSync("DEV_AUTH_TOKEN_CASEDATA");
    }
  }
  if (!token) {
    let page_url = utils_pageUrl.pageUrl();
    common_vendor.index.setStorageSync("redirectUrl", page_url);
    common_vendor.index.navigateTo({
      url: "/pages/login/login?redirectUrl=has"
    });
  } else {
    {
      const pages = getCurrentPages();
      let len = pages.length;
      common_vendor.index.__f__("log", "at utils/navTo.js:31", len);
      if (len >= 10) {
        common_vendor.index.redirectTo(obj);
      } else {
        common_vendor.index.navigateTo(obj);
      }
    }
  }
}
exports.navTo = navTo;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/navTo.js.map
