Helius
2020-12-28 064c765a04dacbede3674ac7a8a9a201037a47e5
zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java
@@ -2,8 +2,10 @@
import com.alibaba.fastjson.JSONObject;
import com.matrix.component.redis.RedisClient;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.UUIDUtil;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.app.dto.LoginDto;
import com.matrix.system.app.vo.UserInfoVo;
import com.matrix.system.common.authority.DefaultAuthorityManager;
@@ -19,10 +21,7 @@
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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.RestController;
import org.springframework.web.bind.annotation.*;
/**
 * @author wzy
@@ -80,4 +79,15 @@
        result.putInMap("token", token);
        return result;
    }
    @ApiOperation(value = "退出登陆", notes = "退出登陆")
    @GetMapping(value = "/loginOut")
    public AjaxResult loginOut() {
        SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        String token = redisClient.getCachedValue(sysUsers.getSuId().toString());
        redisClient.removeObject(token);
        redisClient.removeObject(sysUsers.getSuId().toString());
        return AjaxResult.buildSuccessInstance("退出成功");
    }
}