var e;
(e = getApp()),
  (module.exports = {
    backApp: function (e) {
      if (e)
        try {
          wx.setStorageSync("we7_webview", e);
        } catch (e) {
          console.log(e);
        }
      var t = getCurrentPages();
      if (t.length > 1)
        for (var n in t)
          "wn_storex/pages/view/index" === t[n].__route__ &&
            wx.navigateBack({ data: t.length - n + 1 });
    },
    urlAddCode: function (t) {
      var n = wx.getStorageSync("userInfo"),
        a = function (e) {
          var n = (function (e, t) {
            e = e.replace(/(#\/)(.*)/, "");
            var n = new RegExp("(^|&)" + t + "=([^&]*)(&|$)", "i"),
              a = e.match(n);
            return null !== a ? unescape(a[2]) : null;
          })(t, "state");
          t.indexOf("http") ||
            n ||
            (t = t.replace(
              /index.php\?/,
              "index.php?from=wxapp&state=we7sid-" + e.sessionid + "&"
            ));
          var a = getCurrentPages();
          a && (a = a[getCurrentPages().length - 1]), a.setData({ url: t });
        };
      n.sessionid ? a(n) : e.util.getUserInfo(a);
    },
  });
