package com.icloud.server.web.shiro.controller;


import com.icloud.server.web.JsonResult;
import io.swagger.annotations.Api;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * logout, 映射shiro自带的过滤器
 */
@CrossOrigin
@RestController
@Api( tags = {"登陆,注册"} , value = "API" )
@RequestMapping("pub")
public class LogoutController {
//
//
    @RequestMapping("/logout")
    public JsonResult findMyPlayRecord() {

        Subject subject = SecurityUtils.getSubject();

        if (subject.getPrincipals() != null) {

        }

        SecurityUtils.getSubject().logout();

        return new JsonResult("logout成功");

    }
}

