From d365b3fae7e1f079b37760a480b5f1b711fadf42 Mon Sep 17 00:00:00 2001 From: wangfs <15029758498@163.com> Date: Tue, 31 Jul 2018 15:38:14 +0800 Subject: [PATCH] 提交 --- src/main/java/com/zteits/oa/report/web/OAuthController.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/zteits/oa/report/web/OAuthController.java b/src/main/java/com/zteits/oa/report/web/OAuthController.java index c6d8248..40f49a7 100644 --- a/src/main/java/com/zteits/oa/report/web/OAuthController.java +++ b/src/main/java/com/zteits/oa/report/web/OAuthController.java @@ -11,8 +11,10 @@ import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; +import com.alibaba.fastjson.JSONObject; import com.zteits.oa.api.base.bean.BizResult; import com.zteits.oa.api.base.constants.ErrorType; import com.zteits.oa.api.base.constants.SessionEnum; @@ -102,7 +104,25 @@ public class OAuthController { return result; } - + /** + * 退出登录 + * @param req + * @return + * 2018年7月31日 wangfs.
+ */ + @ApiOperation("用户登出") + @RequestMapping("/loginout") + public OAuthResult loginOut() { + HttpSession session = request.getSession(); + AsraOpDTO userInfo = (AsraOpDTO)request.getSession().getAttribute(SessionEnum.USER_INFO.key()); + //登出 + session.invalidate(); + if(userInfo==null){ + return new OAuthResult<>(true); + } + logger.info("end用户登出.."); + return new OAuthResult<>(true); + } } -- libgit2 0.21.4