| | |
| | | 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; |
| | | |
| | | /** |
| | | * 登录控制器 |
| | |
| | | if(!loginResultBO.isSuccess()){ |
| | | msg = loginResultBO.getFailMsg(); |
| | | }else { |
| | | token = loginResultBO.getSessionInfo().getToken(); |
| | | token = loginResultBO.getTokenVO().getAccessToken(); |
| | | } |
| | | }catch (Throwable e){ |
| | | msg = LangBaseUtil.getErrorMsg(e); |
| | |
| | | msg = loginResultBO.getFailMsg(); |
| | | return BaseResult.fail(msg); |
| | | }else { |
| | | token = loginResultBO.getSessionInfo().getToken(); |
| | | token = loginResultBO.getTokenVO().getAccessToken(); |
| | | msg="登录成功!"; |
| | | } |
| | | }catch (Throwable e){ |
| | |
| | | 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().get()); |
| | | json.setObj(WebThreadLocalUtil.getCurrentUserSessionInfoInThread()); |
| | | if(json.getObj()!=null){ |
| | | json.setSuccess(true); |
| | | } |