去掉自动生成的Base64

This commit is contained in:
qjq
2024-06-19 09:15:42 +08:00
parent a3c8f5a96d
commit 9eadeb00c8

View File

@ -1,6 +1,5 @@
package cn.iocoder.yudao.module.system.service.dishesraw;
import cn.hutool.core.util.ObjUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.controller.admin.dishesraw.vo.DishesRawPageReqVO;
@ -13,7 +12,6 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Base64;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
@ -85,13 +83,13 @@ public class DishesRawServiceImpl implements DishesRawService {
@SneakyThrows
public Long createDishesRawList(List<DishesRawSaveReqVO> createReqVO) {
for (DishesRawSaveReqVO reqVO : createReqVO) {
String enCode=null;
if(ObjUtil.isNotEmpty(reqVO.getRawImgUrl())){
enCode= Base64.getEncoder().encodeToString(reqVO.getRawImgUrl().getBytes());
}
// String enCode=null;
// if(ObjUtil.isNotEmpty(reqVO.getRawImgUrl())){
// enCode= Base64.getEncoder().encodeToString(reqVO.getRawImgUrl().getBytes());
// }
// 插入
DishesRawDO dishesRaw = BeanUtils.toBean(reqVO, DishesRawDO.class);
dishesRaw.setRawImgUrl(enCode);
// dishesRaw.setRawImgUrl(enCode);
dishesRawMapper.insert(dishesRaw);
}
return 1L;