<div th:fragment="userInfo" th:remove="tag">
	<div class="dropdown" style="margin:0 !important;">
		<a data-toggle="dropdown" javascript:void(0) class="dropdown-toggle" style="display:inline-block;padding:0 0.4rem;">
			<div class="user-info">
				<span class="info-hello">你好</span>
				<span class="info-username" th:text="${user?.name}">用户名</span>
			</div>
			<div style="border:1px solid #5AC4FC;display:inline-block;width:0.4rem;height:0.4rem;overflow:hidden;border-radius:50%;padding:0.03rem;" th:if="${#strings.isEmpty(user?.headImgUrl)}">
				<img class="nav-user-photo" style="width:0.34rem;height:0.34rem" src="/images/avatars/user.jpg" alt="" />
			</div>
			<div style="border:1px solid #5AC4FC;display:inline-block;width:0.4rem;height:0.4rem;overflow:hidden;border-radius:50%;" th:if="${user?.headImgUrl}!=null">
				<img class="nav-user-photo" style="width:0.4rem;height:0.4rem" th:src="${user?.headImgUrl}" alt="" />
			</div>
		</a>
		<ul class="user-menu dropdown-menu" role="menu" style="margin-top:0.1rem;min-width:1.2rem">
			<div class="triangle"></div>
			<li><a href="javascript:userInfoUpdate();"><i class="icon icon-edit"></i>个人信息修改</a></li>		
			<li class="divider"></li>	
			<li><a href="javascript:updatePassword();"><i class="icon icon-lock"></i>修改密码</a></li>
			<li class="divider"></li>
			<li><a href="/session/sgin_out"><i class="icon icon-off"></i>退出</a></li>
		</ul>
	</div>
	<input id="loginOrgId" th:value="${org.id}" type="hidden"/>
	<input id="navTreeSelectOrgId" th:value="${org.id}" type="hidden"/>
	<input id="loginUserId" th:value="${user.id}" type="hidden"/>
	
	<script>
		/* 个人信息修改 */
		function userInfoUpdate(){
			$(".yk_content").find('.myModal-updateUserInfoParent').remove().end().append('<div class="base-extend myModal-updateUserInfoParent"><div class="modal fade businessDialog" id="myModal-updateUserInfo" data-backdrop="static"><div class="modal-dialog" style="width:8rem;height:2.5rem;"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" style="font-size:0.18rem">×</span><span class="sr-only">关闭</span></button><span class="modal-title">修改个人信息</span></div><div class="modal-content"></div><div class="modal-footer"><button type="button" class="btn btn-primary btn-white btn-info colorbtn updateUserInfoBtn">保存</button><button type="button" class="btn btn-default btn-white btn-info closeUpdateUserInfoBtn" data-dismiss="modal">取消</button></div></div></div></div>');
			$("#myModal-updateUserInfo").modal('show');
			$("#myModal-updateUserInfo .modal-content").load('/user/userInfoUpdate');
			$("#myModal-updateUserInfo .updateUserInfoBtn").click(function(){
				$('#userInfoForm').submit(); 
				$("#myModal-updateUserInfo").modal('show');
			})
			$("#myModal-updateUserInfo .closeUpdateUserInfoBtn").click(function(){
				$("#myModal-updateUserInfo").modal('hide');
			})
			$("#myModal-updateUserInfo .close").click(function(){
				$("#myModal-updateUserInfo").modal('hide');
			})
		}
		/* 修改密码 */
		function updatePassword(){
			$(".yk_content").find('.myModal-updatePasswordParent').remove().end().append('<div class="base-extend myModal-updatePasswordParent"><div class="modal fade businessDialog" id="myModal-updatePassword" data-backdrop="static"><div class="modal-dialog" style="width:8rem;height:3rem;"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" style="font-size:0.18rem">×</span><span class="sr-only">关闭</span></button><span class="modal-title">修改密码</span></div><div class="modal-content"></div><div class="modal-footer"><button type="button" class="btn btn-primary btn-white btn-info colorbtn updatePasswordBtn">保存</button><button type="button" class="btn btn-default btn-white btn-info closeUpdatePasswordBtn" data-dismiss="modal">取消</button></div></div></div></div>');
			$("#myModal-updatePassword").modal('show');
			$("#myModal-updatePassword .modal-content").load('/user/updatePassword');
			$("#myModal-updatePassword .updatePasswordBtn").click(function(){
				$('#updatePasswordForm').submit(); 
				$("#myModal-updatePassword").modal('show');
			})
			$("#myModal-updatePassword .closeUpdatePasswordBtn").click(function(){
				$("#myModal-updatePassword").modal('hide');
			})
			$("#myModal-updatePassword .close").click(function(){
				$("#myModal-updatePassword").modal('hide');
			})
		}
	</script>

</div>