xin
2025-06-03 95dc030ad8e77303207a1a42a3afd9a7a6612d75
oying-system/src/main/java/com/oying/modules/security/rest/OnlineController.java
@@ -2,6 +2,7 @@
import com.oying.modules.security.service.OnlineUserService;
import com.oying.modules.security.service.dto.OnlineUserDto;
import com.oying.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -12,6 +13,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
@@ -30,8 +32,8 @@
    @ApiOperation("查询在线用户")
    @GetMapping
    @PreAuthorize("@el.check()")
    public ResponseEntity<PageResult<OnlineUserDto>> queryOnlineUser(String username, Pageable pageable){
        return new ResponseEntity<>(onlineUserService.getAll(username, pageable),HttpStatus.OK);
    public ResponseEntity<Object> queryOnlineUser(String username, Pageable pageable) {
        return new ResponseEntity<>(R.success(onlineUserService.getAll(username, pageable)), HttpStatus.OK);
    }
    @ApiOperation("导出数据")
@@ -50,6 +52,6 @@
            token = EncryptUtils.desDecrypt(token);
            onlineUserService.logout(token);
        }
        return new ResponseEntity<>(HttpStatus.OK);
        return new ResponseEntity<>(R.success(), HttpStatus.OK);
    }
}