| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.security.Principal; |
| | | import java.util.*; |
| | | import java.util.Enumeration; |
| | | import java.util.HashMap; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 登录控制器 |
| | |
| | | clientInfo.setRequestType("browser"); |
| | | } |
| | | } |
| | | |
| | | Locale loc = Locale.getDefault(); |
| | | clientInfo.setCountry(loc.getCountry()); |
| | | clientInfo.setLanguage(loc.toLanguageTag()); |
| | | |
| | | Map<String,String> map = System.getenv(); |
| | | clientInfo.setMachine(map.get("COMPUTERNAME")); |
| | | clientInfo.setOsUser(map.get("USERNAME")); |
| | | } |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | public BaseResult getSessionInfo(){ |
| | | BaseResult<SessionInfo> json = new BaseResult<>(); |
| | | json.setObj(WebThreadLocalUtil.getCurrentUserSessionInfoInThread()); |
| | | if(json.getObj()!=null){ |
| | | json.setSuccess(true); |
| | | SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread(); |
| | | if(sessionInfo != null){ |
| | | json = json.success(sessionInfo); |
| | | } |
| | | return json; |
| | | } |