| | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.servlet.http.HttpSession; |
| | | import javax.swing.*; |
| | | import java.io.IOException; |
| | | |
| | |
| | | //前端将字符\替换成了huodongwei,这里再转回来 |
| | | signDTO.setInPath(signDTO.getInPath().replace("huodongwei","\\")); |
| | | //通过uKeyId获取公钥XY |
| | | UserInf userInf = userService.getPublicXYByUKeyId(signDTO.getUKeyId()); |
| | | //UserInf userInf = userService.getPublicXYByUKeyId(signDTO.getUKeyId()); |
| | | UserInf userInf = userService.getUserByUKeyId(signDTO.getUKeyId()); |
| | | //获取之前生成的随机数 |
| | | String uKeyRandom = (String) ActionUtil.getSession().getAttribute("uKeyRandom"); |
| | | boolean b = com.whyc.softkey.jsyunew3.YtVerfiy(userInf.getUName(), uKeyRandom, signDTO.getPublicX(), signDTO.getPublicY(), signDTO.getSign(), signDTO.getInPath()); |
| | |
| | | response.setContentType("text/html;charset=utf-8"); |
| | | response.getWriter().write("您未获取到接口的调用授权,拒绝访问!"); |
| | | } |
| | | |
| | | @PostMapping("/check") |
| | | @ApiOperation(value = "判断是否有另一同一账号登录的用户") |
| | | public Response check(){ |
| | | Response response = service.checkUser(); |
| | | //当前用户 |
| | | HttpSession session = ActionUtil.getSession(); |
| | | UserInf uinf=(UserInf) session.getAttribute("user"); |
| | | if(response.getCode() == 1){ |
| | | session.invalidate(); //清除当前的session; //清除session |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | } |