<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## 一、概述 提供一個樣板,用于標準化的處理文件導出數據的場景; ## 二、方案 ### **controller**: ``` @ApiOperation(value = "導出日志列表", notes = "導出當前所有的日志列表") // @ApiOperationSupport(order = 5) @ApiImplicitParams({ @ApiImplicitParam(name = RayConstants.rayAccessToken, value = "授權token", required = true, dataTypeClass = String.class, paramType = "query") // }) @GetMapping("/api/system/log/export/list") @RayEscapeTokenValidateControllerMethod @RayEscapeRequestHeaderValidateControllerMethod @RayValidateTokenInParamControllerMethod public void exportLogList(@RequestParam String rayAccessToken) throws Exception { sysLogService.exportLogList(); } ``` >[danger] 注意, > 1、這里必須增加的注解: > @RayEscapeTokenValidateControllerMethod > @RayEscapeRequestHeaderValidateControllerMethod > @RayValidateTokenInParamControllerMethod >2、必須使用@GetMapping ### **service**: ``` @RayServiceMethod public void exportLogList() throws Exception { excelExportProcessor.export(response, "日志列表.xlsx", new ExportExcelCallback() { @Override public String buildExcelObject(Sheet sheet, Object... exportedDataObjects) { List<SysLog> dataList = (List<SysLog>) exportedDataObjects[0]; int excelRow = 0; createLogTitle(sheet); if (dataList != null && dataList.size() > 0) { for (int i = 0; i < dataList.size(); i++) { Row dataRow = sheet.createRow(i + 1); Cell cell0 = dataRow.createCell(0); Cell cell1 = dataRow.createCell(1); Cell cell2 = dataRow.createCell(2); Cell cell3 = dataRow.createCell(3); cell0.setCellValue(i + 1); cell1.setCellValue(dataList.get(i).getInfoCode()); cell2.setCellValue(dataList.get(i).getOperateTime()); } } return null; } }, sysLogDao.findAll()); } ``` ### **前端使用**: 按照接口定義,拼湊URL地址,包括token,帶上兩個安全參數,再按照接口定義的參數請求,構成了完整的url,然后模擬點擊url,即可獲得生成的導出文件;
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看