mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-22 11:52:43 +08:00
fixed: 图片上传选择无分类的Bug
This commit is contained in:
parent
c9371b0589
commit
f4002b799b
@ -89,13 +89,15 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource>
|
|||||||
if (categoryIds != null && categoryIds.trim().length() > 0) {
|
if (categoryIds != null && categoryIds.trim().length() > 0) {
|
||||||
String[] idArray = categoryIds.split(",");
|
String[] idArray = categoryIds.split(",");
|
||||||
List<ResourceCategoryRelation> relations = new ArrayList<>();
|
List<ResourceCategoryRelation> relations = new ArrayList<>();
|
||||||
for (int i = 0; i < idArray.length; i++) {
|
for (String s : idArray) {
|
||||||
String tmpId = idArray[i];
|
int tmpId = Integer.parseInt(s);
|
||||||
|
if (tmpId == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
relations.add(
|
relations.add(
|
||||||
new ResourceCategoryRelation() {
|
new ResourceCategoryRelation() {
|
||||||
{
|
{
|
||||||
setCid(Integer.valueOf(tmpId));
|
setCid(tmpId);
|
||||||
setRid(resource.getId());
|
setRid(resource.getId());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user