fixed: 图片上传选择无分类的Bug

This commit is contained in:
none 2023-06-09 15:02:20 +08:00
parent c9371b0589
commit f4002b799b

View File

@ -89,13 +89,15 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource>
if (categoryIds != null && categoryIds.trim().length() > 0) {
String[] idArray = categoryIds.split(",");
List<ResourceCategoryRelation> relations = new ArrayList<>();
for (int i = 0; i < idArray.length; i++) {
String tmpId = idArray[i];
for (String s : idArray) {
int tmpId = Integer.parseInt(s);
if (tmpId == 0) {
continue;
}
relations.add(
new ResourceCategoryRelation() {
{
setCid(Integer.valueOf(tmpId));
setCid(tmpId);
setRid(resource.getId());
}
});