|
|
|
@ -10,6 +10,7 @@ import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import com.glxp.sale.admin.util.MyStrUtil;
|
|
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
|
|
import org.springframework.http.HttpMethod;
|
|
|
|
@ -149,6 +150,7 @@ public class IdcController {
|
|
|
|
|
if (StrUtil.isNotEmpty(upperServerHost)) {
|
|
|
|
|
uri = upperServerHost + "/" + uri;
|
|
|
|
|
}
|
|
|
|
|
uri = changeUri(uri);
|
|
|
|
|
log.info(uri);
|
|
|
|
|
if (uri.contains("getImage")) {
|
|
|
|
|
return redirectIamge(request, httpServletResponse, uri);
|
|
|
|
@ -157,6 +159,18 @@ public class IdcController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String changeUri(String uri) {
|
|
|
|
|
String isTopService = systemParamConfigService.selectValueByParamKey("is_top_service");
|
|
|
|
|
if (StrUtil.isNotEmpty(isTopService) && isTopService.equals("1")) {
|
|
|
|
|
if (uri.contains("SP_SYNC_SERVER")) {
|
|
|
|
|
uri = uri.replace("SP_SYNC_SERVER/", "");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
uri = MyStrUtil.deDup(uri);
|
|
|
|
|
}
|
|
|
|
|
log.error("changeUri = " + uri);
|
|
|
|
|
return uri;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private byte[] redirectIamge(HttpServletRequest request, HttpServletResponse httpServletResponse, String uri) {
|
|
|
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
|
|
|