Commit d365b3fae7e1f079b37760a480b5f1b711fadf42

Authored by 王富生
1 parent b0c576ed

提交

src/main/java/com/zteits/oa/report/web/OAuthController.java
@@ -11,8 +11,10 @@ import org.springframework.util.StringUtils; @@ -11,8 +11,10 @@ import org.springframework.util.StringUtils;
11 import org.springframework.web.bind.annotation.PostMapping; 11 import org.springframework.web.bind.annotation.PostMapping;
12 import org.springframework.web.bind.annotation.RequestBody; 12 import org.springframework.web.bind.annotation.RequestBody;
13 import org.springframework.web.bind.annotation.RequestMapping; 13 import org.springframework.web.bind.annotation.RequestMapping;
  14 +import org.springframework.web.bind.annotation.RequestMethod;
14 import org.springframework.web.bind.annotation.RestController; 15 import org.springframework.web.bind.annotation.RestController;
15 16
  17 +import com.alibaba.fastjson.JSONObject;
16 import com.zteits.oa.api.base.bean.BizResult; 18 import com.zteits.oa.api.base.bean.BizResult;
17 import com.zteits.oa.api.base.constants.ErrorType; 19 import com.zteits.oa.api.base.constants.ErrorType;
18 import com.zteits.oa.api.base.constants.SessionEnum; 20 import com.zteits.oa.api.base.constants.SessionEnum;
@@ -102,7 +104,25 @@ public class OAuthController { @@ -102,7 +104,25 @@ public class OAuthController {
102 104
103 return result; 105 return result;
104 } 106 }
105 - 107 + /**
  108 + * 退出登录
  109 + * @param req
  110 + * @return
  111 + * 2018年7月31日 wangfs.<br/>
  112 + */
  113 + @ApiOperation("用户登出")
  114 + @RequestMapping("/loginout")
  115 + public OAuthResult<LoginOathRes> loginOut() {
  116 + HttpSession session = request.getSession();
  117 + AsraOpDTO userInfo = (AsraOpDTO)request.getSession().getAttribute(SessionEnum.USER_INFO.key());
  118 + //登出
  119 + session.invalidate();
  120 + if(userInfo==null){
  121 + return new OAuthResult<>(true);
  122 + }
  123 + logger.info("end用户登出..");
  124 + return new OAuthResult<>(true);
  125 + }
106 126
107 127
108 } 128 }