Jelajahi Sumber

fix: flattenBizContent 复杂类型用 writeValueAsString 替代 String.valueOf — 修复 department_list/role_list 等 JSON array 被 Java toString 破坏格式,导致员工签约后部门制度联动静默失效

alphaH 2 minggu lalu
induk
melakukan
dfad6e665f

+ 2 - 2
.codegraph/daemon.pid

@@ -1,6 +1,6 @@
 {
-  "pid": 36116,
+  "pid": 36300,
   "version": "0.9.9",
   "socketPath": "\\\\.\\pipe\\codegraph-9515f3f05b4112da",
-  "startedAt": 1782118159141
+  "startedAt": 1782458616450
 }

+ 5 - 1
java/src/main/java/com/payment/platform/module/payment/notification/service/NotificationService.java

@@ -171,7 +171,11 @@ public class NotificationService {
             Map<String, Object> nested = oMapper.readValue(bizContent, Map.class);
             for (Map.Entry<String, Object> e : nested.entrySet()) {
                 if (e.getValue() != null && !params.containsKey(e.getKey())) {
-                    params.put(e.getKey(), String.valueOf(e.getValue()));
+                    if (e.getValue() instanceof String) {
+                        params.put(e.getKey(), (String) e.getValue());
+                    } else {
+                        params.put(e.getKey(), oMapper.writeValueAsString(e.getValue()));
+                    }
                 }
             }
         } catch (Exception e) {

+ 2 - 2
java/src/main/java/com/payment/platform/module/system/auth/controller/AuthController.java

@@ -176,13 +176,13 @@ public class AuthController {
     @PostMapping("/sms-code")
     public Result<Void> sendSmsCode(@RequestBody Map<String, String> body) {
         String mobile = body.get("mobile");
-        String templateName = body.getOrDefault("template_name", "login");
+//        String templateName = body.getOrDefault("template_name", "verify");
 
         if (StrUtil.isBlank(mobile)) {
             return Result.fail(400, "手机号不能为空");
         }
 
-        smsCodeService.sendCode(templateName, mobile);
+        smsCodeService.sendCode("verify", mobile);
         return Result.ok();
     }