shinnosuke
2026-08-04 c8d12c37b3f78e41aafef1ccb3e380573308c34a
talent-card-server/src/main/java/com/talentcard/server/business/admin/AdminBusinessService.java
@@ -459,6 +459,17 @@
      ensureUpdated(updated);
      Long storeId = findOrCreateDefaultStore(id, request.merchantName(), request.address());
      syncMerchantBusinessHours(id, storeId, request.businessHours());
      if (request.loginPassword() != null && !request.loginPassword().isBlank()) {
         if (request.loginPassword().length() < 6 || request.loginPassword().length() > 64) {
            throw new BusinessException(ErrorCode.BAD_REQUEST, "商户登录密码长度须为6至64位");
         }
         int passwordUpdated = jdbcTemplate.update("""
               update merchant_operator
               set password_hash = ?
               where merchant_id = ? and role_code = 'owner' and deleted = 0
               """, MerchantPasswordHasher.encode(request.loginPassword()), id);
         if (passwordUpdated == 0) throw new BusinessException(ErrorCode.CONFLICT, "该商家未配置商户端登录账号");
      }
      return merchant(id);
   }