架构师成长记

    科技2022-07-10  166

    文章目录

    用户退出登录清空cookie前端实现后端对接 开启Mybatis日志Sql打印

    用户退出登录清空cookie

    前端实现

    后端对接

    @ApiOperation(value = "退出登录",notes = "退出登录",httpMethod = "POST") @PostMapping("/logout") //@RequestBody 将前端传过来的json对象进行格式化 public BEYONDJSONResult logout(@RequestParam String userId, HttpServletRequest request, HttpServletResponse response){ //清除用户相互信息的cookie CookieUtils.deleteCookie(request,response,"user"); //TODO 用户退出登录, 需要清空购物车 //TODO 分布式会话中需要清除用户数据 return BEYONDJSONResult.ok(); }

    开启Mybatis日志Sql打印

    Processed: 0.014, SQL: 9