Commit b09fc5579c86a8a7c53be889e7bac55b3a989d62
1 parent
b38c9484
处理表情符号,content解析问题
Showing
1 changed file
with
2 additions
and
2 deletions
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/midjourney/util/MjUtil.java
| @@ -25,10 +25,10 @@ public class MjUtil { | @@ -25,10 +25,10 @@ public class MjUtil { | ||
| 25 | if (CharSequenceUtil.isBlank(content)) { | 25 | if (CharSequenceUtil.isBlank(content)) { |
| 26 | return null; | 26 | return null; |
| 27 | } | 27 | } |
| 28 | - if (!content.contains("raw**")) { | 28 | + if (!content.contains("<@")) { |
| 29 | return mjContent.setPrompt(content); | 29 | return mjContent.setPrompt(content); |
| 30 | } | 30 | } |
| 31 | - int rawIndex = content.indexOf("raw**") + 5; | 31 | + int rawIndex = content.indexOf("<@") - 3; |
| 32 | String prompt = content.substring(0, rawIndex).trim(); | 32 | String prompt = content.substring(0, rawIndex).trim(); |
| 33 | String contentTail = content.substring(rawIndex).trim(); | 33 | String contentTail = content.substring(rawIndex).trim(); |
| 34 | // 检查是否存在进度条 | 34 | // 检查是否存在进度条 |