基础设置提交
This commit is contained in:
@@ -89,7 +89,7 @@ public class MsgApi {
|
||||
*/
|
||||
public void sendWxMsg(String title, String url, String msgtype, String description, List<String> loginNames, String contentUrl) {
|
||||
|
||||
if ("否".equals(Globals.MyConfig.getString("SengMsg"))) {
|
||||
if ("false".equals(Strings.trim(Globals.MyConfig.getString("SengMsg")))) {
|
||||
log.info("发送失败,消息暂未开启!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class MsgApi {
|
||||
// if (!"news".equals(msgtype)) {
|
||||
// title = "智慧工会";
|
||||
// }
|
||||
if (Globals.isEnv(Env.dev)){
|
||||
if (Globals.isEnv(Env.dev)) {
|
||||
log.info("发送失败,本地环境禁止发送!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
|
||||
return;
|
||||
@@ -146,7 +146,7 @@ public class MsgApi {
|
||||
m.put("title", title);
|
||||
m.put("description", description);
|
||||
//m.put("url", "");
|
||||
m.put("picurl", "https://zhghydd.cpu.edu.cn/file_server/fileStreamPreview?id="+contentUrl);
|
||||
m.put("picurl", "https://zhghydd.cpu.edu.cn/file_server/fileStreamPreview?id=" + contentUrl);
|
||||
list.add(m);
|
||||
map.put("news", Map.of("articles", list));
|
||||
}
|
||||
@@ -175,10 +175,20 @@ public class MsgApi {
|
||||
public void sendMsg(String content, List<String> toLoginNameList) {
|
||||
try {
|
||||
|
||||
if ("false".equals(Strings.trim(Globals.MyConfig.getString("SengMsg")))) {
|
||||
log.info("发送失败,消息暂未开启!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
if (Globals.isEnv(Env.dev)) {
|
||||
log.info("发送失败,本地环境禁止发送!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
List<NutMap> mapList = new ArrayList<>();
|
||||
toLoginNameList.forEach(v->{
|
||||
toLoginNameList.forEach(v -> {
|
||||
NutMap nutMap = new NutMap();
|
||||
nutMap.setv("touser",v);
|
||||
nutMap.setv("touser", v);
|
||||
mapList.add(nutMap);
|
||||
});
|
||||
|
||||
@@ -209,7 +219,7 @@ public class MsgApi {
|
||||
body.put("message", Json.toJson(a));
|
||||
log.info(Json.toJson(body));
|
||||
String postUrl = MSG_API + "?appid=" + APPID + "&tokenid=" + token + "&schoolcode=4";
|
||||
String post = Http.post(postUrl, body,10000);
|
||||
String post = Http.post(postUrl, body, 10000);
|
||||
|
||||
JSONObject parseObject = JSON.parseObject(post);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user