/*html 读取cookies显示公司名称*/
$(function () {
  let yc_conf = {
    passport: "https://hy.passport.cyc-fund.com",
  };
  (function () {
    let uscn = Cookies.get("uscn");
    if (uscn) {
      $("#no-login").text(decodeURIComponent(uscn));
      $("#logout_button_v2").text("退出登录");
    }
  })();

  /*all 从cookies读取全局城市 设置城市显示*/
  (function () {
    let cin = Cookies.get("cin");
    if (cin) {
      let city = decodeURIComponent(cin);
      $(".select_city_v2").text(city);
    }
    if ($(".select_city_v2").length) {
      // $('.select_city_v2').click(function () {
      //     location.href = yc_conf.www + '/changecity.do'
      // })
    }
  })();

  /*all 设置登出按钮跳转转*/
  (function () {
    if ($("#logout_button_v2").length) {
      $("#logout_button_v2").click(function () {
        Cookies.remove("uscn", { domain: "cyc-fund.com" });
        location.href = yc_conf.passport + "/systemCommonFS/logout.do";
      });
    }
  })();
  /*all 设置登录按钮跳转*/
  (function () {
    if ($("#no-login").length) {
      $("#no-login").click(function () {
        location.href =
          yc_conf.passport + "/?returnUrl=" + encodeURIComponent(location.href);
      });
    }
  })();
});
