diff --git a/src/main/java/com/yutou/qqbot/QQBotApplication.java b/src/main/java/com/yutou/qqbot/QQBotApplication.java index 04aec58..da9f76a 100644 --- a/src/main/java/com/yutou/qqbot/QQBotApplication.java +++ b/src/main/java/com/yutou/qqbot/QQBotApplication.java @@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class QQBotApplication { - public static final String version="QQBot v.1.5"; + public static final String version="QQBot v.1.5.1"; public static void main(String[] args) { System.out.println("version = " + version); SpringApplication.run(QQBotApplication.class, args); diff --git a/src/main/java/com/yutou/qqbot/QQBotManager.java b/src/main/java/com/yutou/qqbot/QQBotManager.java index 0b2e415..74a135b 100644 --- a/src/main/java/com/yutou/qqbot/QQBotManager.java +++ b/src/main/java/com/yutou/qqbot/QQBotManager.java @@ -42,8 +42,30 @@ public class QQBotManager { private void init() { new Thread(new Runnable() { + private void reset() { + try { + Log.i("QQBot","签名加密服务未启动,1分钟后重试"); + Thread.sleep(60 * 1000); + init(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + } + @Override public void run() { + String test = HttpTools.get("http://192.168.31.88:7400/"); + try { + JSONObject json = JSONObject.parseObject(test); + if (json.getInteger("code") != 0) { + reset(); + return; + } + } catch (Exception e) { + reset(); + return; + } long qq = ConfigTools.load(ConfigTools.CONFIG, "qq_number", Long.class); String password = ConfigTools.load(ConfigTools.CONFIG, "qq_password", String.class); System.out.println("qq = " + qq);