Skip to content

Commit 00a6a9a

Browse files
committed
v3.4 修复部分问题; 前端页面更新
1 parent dc5660f commit 00a6a9a

File tree

11 files changed

+17526
-131
lines changed

11 files changed

+17526
-131
lines changed

build.gradle.kts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,37 @@ plugins {
44
val kotlinVersion = "1.7.22"
55
kotlin("jvm") version kotlinVersion
66
kotlin("plugin.serialization") version kotlinVersion
7-
id("net.mamoe.mirai-console") version "2.15.0"
7+
id("net.mamoe.mirai-console") version "2.16.0"
88
}
99

1010
group = "io.github.gdpl2112"
11-
version = "3.3"
11+
version = "3.4"
1212

1313
repositories {
1414
maven("https://repo1.maven.org/maven2/")
15+
maven("https://s01.oss.sonatype.org/content/repositories/snapshots")
1516
mavenLocal()
1617
mavenCentral()
1718
}
1819

20+
mirai {
21+
noTestCore = true
22+
setupConsoleTestRuntime {
23+
// 移除 mirai-core 依赖
24+
classpath = classpath.filter {
25+
!it.nameWithoutExtension.startsWith("mirai-core-jvm")
26+
}
27+
}
28+
}
29+
1930
dependencies {
2031
testImplementation(kotlin("test"))
2132

22-
compileOnly("net.mamoe:mirai-core:2.15.0")
23-
compileOnly("net.mamoe:mirai-console-compiler-common:2.15.0")
24-
implementation(platform("net.mamoe:mirai-bom:2.15.0"))
25-
testImplementation("net.mamoe:mirai-core-mock:2.15.0")
33+
// compileOnly("net.mamoe:mirai-core:2.15.0")
34+
testConsoleRuntime("top.mrxiaom:overflow-core:2.16.0-db61867-SNAPSHOT")
35+
// compileOnly("net.mamoe:mirai-console-compiler-common:2.15.0")
36+
// implementation(platform("net.mamoe:mirai-bom:2.15.0"))
37+
// testImplementation("net.mamoe:mirai-core-mock:2.15.0")
2638
testImplementation("net.mamoe:mirai-logging-slf4j:2.15.0")
2739

2840
implementation(platform("org.slf4j:slf4j-parent:2.0.6"))
@@ -37,7 +49,3 @@ dependencies {
3749
implementation("io.github.Kloping:spt-web:0.2.0")
3850
}
3951

40-
mirai {
41-
jvmTarget = JavaVersion.VERSION_11
42-
}
43-

src/main/java/io/github/gdpl2112/mirai/p1/CallApiPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class CallApiPlugin extends JavaPlugin {
2727
public static Conf conf = null;
2828

2929
public CallApiPlugin() {
30-
super(new JvmPluginDescriptionBuilder("io.github.Kloping.mirai.p1.CallApiPlugin", "3.3")
30+
super(new JvmPluginDescriptionBuilder("io.github.Kloping.mirai.p1.CallApiPlugin", "3.4")
3131
.info("调用自定义API插件").build());
3232
}
3333

src/main/java/io/github/gdpl2112/mirai/p1/Converter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ public static Object get(Connection t1, String t0, AtomicReference<Document> doc
8484
if (t0.equals(ALL)) {
8585
return ReadUtils.readAll(t1.execute().bodyStream(), "utf-8");
8686
}
87-
if (t0.equals(PAR_URL)) {
88-
return t1.get().location();
89-
}
9087
if (doc0.get() == null) {
9188
doc0.set(t1.get());
9289
}
90+
if (t0.equals(PAR_URL)) {
91+
return doc0.get().location();
92+
}
9393
return get0(doc0.get().body().text(), t0);
9494
}
9595

src/main/java/io/github/gdpl2112/mirai/p1/Worker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private static Message parse(Connection connection, CallTemplate template, Bot b
133133
try {
134134
JSON json = (JSON) JSON.parse(o1);
135135
} catch (Exception e) {
136-
o1 = o1.replaceAll(",", ";");
136+
System.err.println("json parse error.");
137137
}
138138
end = end.replaceFirst(String.format(CHAR0, i++), o1);
139139
}
@@ -143,7 +143,7 @@ private static Message parse(Connection connection, CallTemplate template, Bot b
143143
} catch (Exception e) {
144144
if (e instanceof NullPointerException) {
145145
e.printStackTrace();
146-
}
146+
}else e.printStackTrace();
147147
if (template.err != null && !template.err.isEmpty()) {
148148
end = template.err;
149149
} else {

0 commit comments

Comments
 (0)