Просмотр исходного кода

fix(backend): 修复 FamilyChallengeService.getTemplates 数组越界 Index 7 out of bounds

模板数组每行 7 个字段(0-6),rewardPoints 在 t[4] 而非 t[7],
导致 ArrayIndexOutOfBoundsException: Index 7 out of bounds for length 7
asus 1 месяц назад
Родитель
Сommit
7a44f29776

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/service/FamilyChallengeService.java

@@ -348,7 +348,7 @@ public class FamilyChallengeService {
             template.put("durationDays", Integer.parseInt(t[3]));
             template.put("targetMode", t[5]);
             template.put("targetValue", Integer.parseInt(t[6]));
-            template.put("rewardPoints", Integer.parseInt(t[7]));
+            template.put("rewardPoints", Integer.parseInt(t[4]));
             templates.add(template);
         }