
import HCP from "./HCPUtils.js"
import host from "./host.js"
var gdxz_unionid = HCP.getCookie("gdxz_unionid");
var from;

const hcpRight =  async function () {
  if (HCP.is_weixin()) {
     from = "wechat";
    if (HCP.isNull(gdxz_unionid)) {
        //await HCP.getUserInfo();
         window.location.href = "https://dev-wx.igandan.com/hcp/Signup2020online_tologin?back_url=https://dev-caseplatform.igandan.com/web/home"
      // var redirectUrl = encodeURIComponent(window.location.href);
      // let url='https://dev-wx.igandan.com';
      //  if(host.indexOf('//dev-caseplatform.igandan.com')==-1){
      //    url='https://wx.igandan.com'
      //  }
      // window.location.href = url+"/AuthorizeURL/grant?back_url=" + redirectUrl;

    }else{
      await HCP.getHCPPrivilege(gdxz_unionid, from, "")
    }


  } else {
    gdxz_unionid = "";
    from = "gdxzAPP";
    HCP.getHCPPrivilege(gdxz_unionid, from, "");
  };

};



export default hcpRight;