Commit 37fda09f authored by tianbo's avatar tianbo

平台配置导出接口bug修改

parent c90d00b6
...@@ -63,8 +63,10 @@ public class ControllerAop { ...@@ -63,8 +63,10 @@ public class ControllerAop {
HttpServletRequest request = attributes.getRequest(); HttpServletRequest request = attributes.getRequest();
//TODO tyboot 框架拦截器已缓存数据 //TODO tyboot 框架拦截器已缓存数据
String token = RequestContext.getToken(); String token = RequestContext.getToken();
// 平台studio配置的下载接口token从url里取
if (ValidationUtil.isEmpty(token)) { if (ValidationUtil.isEmpty(token)) {
token = request.getHeader("X-Access-Token"); fillRequestContext(request);
token = RequestContext.getToken();
} }
// 不需要添加请求头的接口 // 不需要添加请求头的接口
String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany", "/jcs/command/lookHtmlText"}; String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany", "/jcs/command/lookHtmlText"};
...@@ -138,4 +140,13 @@ public class ControllerAop { ...@@ -138,4 +140,13 @@ public class ControllerAop {
// GlobalCache.paramMap.remove(token); // GlobalCache.paramMap.remove(token);
// } // }
} }
private void fillRequestContext(HttpServletRequest request) {
String token = request.getParameterMap().get("token")[0];
String product = request.getParameterMap().get("product")[0];
String appKey = request.getParameterMap().get("appKey")[0];
RequestContext.setToken(token);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
}
} }
package com.yeejoin.amos.boot.module.jcs.biz.controller; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto; import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums; import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -16,7 +21,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -16,7 +21,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* 导出导入 * 导出导入
...@@ -150,7 +154,8 @@ public class ExcelController extends BaseController { ...@@ -150,7 +154,8 @@ public class ExcelController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出公用类带过滤参数") @ApiOperation(value = "导出公用类带过滤参数")
@PostMapping("/exportByParams/{type}") @PostMapping("/exportByParams/{type}")
public void getFireStationFileByParams(HttpServletResponse response, @PathVariable(value = "type") String type, @RequestParam(value = "params") String params) { public void getFireStationFileByParams(HttpServletResponse response, @PathVariable(value = "type") String type,
@RequestParam(value = "params") String params) {
try { try {
ExcelEnums excelEnums= ExcelEnums.getByKey(type); ExcelEnums excelEnums= ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType()); ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment