协议管理处理正文图片在前端不显示问题

This commit is contained in:
Renpc-kilig 2024-06-04 10:31:26 +08:00
parent ff538752d7
commit 97ea70f589
5 changed files with 12 additions and 5 deletions

View File

@ -109,7 +109,7 @@ public class AgreementPortalController extends DefaultBaseController {
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("getByType/{agreementType}")
public AgreementPortalDTO getByType(@PathVariable("agreementType") String agreementType) {
return agreementService.getByType(agreementType);
return agreementService.getByType(agreementType, null);
}
}

View File

@ -123,7 +123,7 @@ public class AgreementPortalAppController extends DefaultBaseController {
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("getrelease/{agreementType}")
public AgreementPortalDTO getByType(@PathVariable("agreementType") String agreementType) {
return agreementService.getByType(agreementType);
return agreementService.getByType(agreementType, "yes");
}
}

View File

@ -123,7 +123,7 @@ public class AgreementPortalResourceController extends DefaultBaseController {
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("getByType/{agreementType}")
public AgreementPortalDTO getByType(@PathVariable("agreementType") String agreementType) {
return agreementService.getByType(agreementType);
return agreementService.getByType(agreementType, null);
}
}

View File

@ -193,5 +193,5 @@ public interface IAgreementPortalService {
* @param agreementType
* @return
*/
AgreementPortalDTO getByType(String agreementType);
AgreementPortalDTO getByType(String agreementType, String forPortal);
}

View File

@ -214,11 +214,18 @@ public class AgreementPortalServiceImpl extends DefaultBaseService implements IA
}
@Override
public AgreementPortalDTO getByType(String agreementType) {
public AgreementPortalDTO getByType(String agreementType, String forPortal) {
Map<String, Object> params = new HashMap<>();
params.put("agreementType", agreementType);
params.put("sendStatus", "published");
AgreementPortalDTO agreementDTO = agreementDao.getByType(params);
if(null != forPortal) {
// System.out.println("-----" + newsDTO.getContent());
String replacedText = agreementDTO.getContent().replaceAll("<img src=\"route/file(.*?)\"",
"<img src=\"https://www.aimzhu.com/operator/route/file$1\"");
agreementDTO.setContent(replacedText);
// System.out.println("*****" + newsDTO.getContent());
}
return agreementDTO;
}