| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.bo.LoginResultBO; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.dto.LoginUserDTO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.annotation.log.VciBusinessLog; |
| | | import com.vci.starter.web.constant.TokenKeyConstant; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.RequestClientInfo; |
| | | import com.vci.starter.web.pagemodel.SessionInfo; |
| | | import com.vci.starter.web.util.LangBaseUtil; |
| | | import com.vci.starter.web.util.MessageUtils; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.util.WebThreadLocalUtil; |
| | | import com.vci.bo.LoginResultBO; |
| | | import com.vci.dto.LoginUserDTO; |
| | | import com.vci.web.service.OsLoginServiceI; |
| | | import com.zeroc.IceInternal.Ex; |
| | | import eu.bitwalker.useragentutils.*; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.Cookie; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.security.Principal; |
| | | import java.util.Enumeration; |
| | | import java.util.HashMap; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | |
| | |
| | | @ResponseBody |
| | | public BaseResult logout(HttpServletRequest request){ |
| | | String userToken = request.getHeader(TokenKeyConstant.USER_TOKEN_KEY); |
| | | loginService.logout(userToken); |
| | | return BaseResult.success(); |
| | | try { |
| | | loginService.logout(userToken); |
| | | return BaseResult.success("退出成功"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String errorLog = "登出时出现异常,原因:"+ VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(errorLog); |
| | | return BaseResult.fail(errorLog); |
| | | } |
| | | } |
| | | |
| | | } |