function logoutHR(callback) {
	if (typeof(callback) == 'undefined' || !$.isFunction(callback)) {
		callback = function(){
			top.window.location.href = shr.getContextPath();
		};
	}

	// ========== 二开 BaoYPro 2026-07-16：联邦退出转泛微 ==========
	// 原因：标品清完本地会话后常回 /shr，泛微 IdP 会话还在会被 SSO 自动登回首页。
	// 做法：本地退出链不变，最后统一跳 /qy/auth/weaver/logout.do，由 qy 再转泛微 logout。
	// 地址：当前用测试环境；生产 prod.ecologyUrl。
	var WEAVER_LOGOUT_ENV = {
		test: {
			ecologyUrl: 'http://172.16.37.23:20600/'
		},
		prod: {
			// TODO 生产泛微地址，上线前填写，例如 https://oa.xxx.com/
			ecologyUrl: ''
		},
		currentEnv: 'test'
	};
	var weaverEcologyUrl = (WEAVER_LOGOUT_ENV[WEAVER_LOGOUT_ENV.currentEnv] || WEAVER_LOGOUT_ENV.test).ecologyUrl;
	if (weaverEcologyUrl) {
		callback = function() {
			top.window.location.href = '/qy/auth/weaver/logout.do?service='
				+ encodeURIComponent(weaverEcologyUrl);
		};
	}
	// ========== 二开结束 ==========

	$.ajax({
		url : '/eassso/logout',
		dataType: "json",
		async: false,
		success: function(response) {
			$.ajax({url : shr.getContextPath()+'/shr_loginout/logoutAndReleaseResource.do?ticked=true',type:"get", async: false});
			//$.ajax({url : '/portal/web_frame/uncheck/easrpc/logoutAndReleaseResource.action?ticked=true',type:"get"});
			$.ajax({url : '/easweb/logout?isSso=true',type:"get", async: false});
			//$.ajax({url : '/easweb/winlet/releaseWafResAjax.jsf',type:"get"});
			$.ajax({url : '/easportal/logout.jsp',type:"get", async: false});
    		setTimeout(function(){
    			//清理cookie,每次使用新的JESSIONID
			    var delCookie  = "JSESSIONID=;expires="+(new Date(0)).toGMTString()+";path=/";
			    document.cookie = delCookie;
				delCookie  = "JSESSIONID=;expires="+(new Date(0)).toGMTString()+";path=/eassso";
				document.cookie = delCookie;
				delCookie  = "JSESSIONID=;expires="+(new Date(0)).toGMTString()+";path=/shr";
				document.cookie = delCookie;
        		$.ajax({url : '/eassso/logout?url=/portal',type:"get", async: false});
				sessionStorage.clear();
                localStorage.clear();
				localStorage.setItem('ckie', true);
				callback.apply(this);
    		},500);
		},
		error: function(response) {
			$.ajax({url : shr.getContextPath()+'/shr_loginout/logoutAndReleaseResource.do?ticked=true',type:"get", async: false});
			//$.ajax({url : '/portal/web_frame/uncheck/easrpc/logoutAndReleaseResource.action?ticked=true',type:"get"});
			$.ajax({url : '/easweb/logout?isSso=true',type:"get", async: false});
			//$.ajax({url : '/easweb/winlet/releaseWafResAjax.jsf',type:"get"});
			$.ajax({url : '/easportal/logout.jsp',type:"get", async: false});
    		setTimeout(function(){
    			//清理cookie,每次使用新的JESSIONID
			    var delCookie  = "JSESSIONID=;expires="+(new Date(0)).toGMTString()+";path=/";
			    document.cookie = delCookie;
				delCookie  = "JSESSIONID=;expires="+(new Date(0)).toGMTString()+";path=/eassso";
				document.cookie = delCookie;
				delCookie  = "JSESSIONID=;expires="+(new Date(0)).toGMTString()+";path=/shr";
				document.cookie = delCookie;
				$.ajax({url : '/eassso/logout?url=/portal',type:"get", async: false});
				sessionStorage.clear();
                localStorage.clear();
				localStorage.setItem('ckie', true);
				callback.apply(this);
    		},500);
		}
	});



}
