diff --git a/src/main/java/com/jmfy/controller/NoticeController.java b/src/main/java/com/jmfy/controller/NoticeController.java
index a8e25e7..4b7349c 100644
--- a/src/main/java/com/jmfy/controller/NoticeController.java
+++ b/src/main/java/com/jmfy/controller/NoticeController.java
@@ -11,6 +11,7 @@ import com.jmfy.utils.RedisUtil;
import com.jmfy.utils.SeqUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -32,10 +33,11 @@ public class NoticeController {
@RequestMapping(value = "/publishNotice", method = {RequestMethod.POST, RequestMethod.GET})
public @ResponseBody
- int publishNotice(HttpServletRequest request) throws Exception {
- String content = request.getParameter("content1");
- String title = request.getParameter("title1");
- int type = Integer.valueOf(request.getParameter("addType"));
+ int publishNotice(HttpServletRequest request,@RequestBody Map map) throws Exception {
+ String content = (String) map.get("content");
+ String title = (String) map.get("title");request.getParameter("title");
+ int type = Integer.valueOf((String) map.get("addType"));
+
NoticeInfo noticeInfo = new NoticeInfo();
long id = RedisUtil.getInstence().increment("notice_id");
@@ -46,8 +48,8 @@ public class NoticeController {
if(type==0){
RedisUtil.getInstence().putMapEntry(RedisUserKey.NOTICE,"" ,"1",noticeInfo,0);
}else{
- String startTime = JsonUtil.date3TimeStamp(request.getParameter("startTime"));
- String endTime = JsonUtil.date3TimeStamp(request.getParameter("endTime"));
+ String startTime = JsonUtil.date3TimeStamp((String) map.get("startTime"));
+ String endTime = JsonUtil.date3TimeStamp((String) map.get("endTime"));
noticeInfo.setStartTime(Long.parseLong(startTime));
noticeInfo.setEndTime(Long.parseLong(endTime));
RedisUtil.getInstence().putMapEntry(RedisUserKey.NOTICE,"" ,String.valueOf(id),noticeInfo,0);
diff --git a/src/main/java/com/jmfy/model/vo/ServerInfoVo.java b/src/main/java/com/jmfy/model/vo/ServerInfoVo.java
index f63f261..792c0b6 100644
--- a/src/main/java/com/jmfy/model/vo/ServerInfoVo.java
+++ b/src/main/java/com/jmfy/model/vo/ServerInfoVo.java
@@ -52,10 +52,28 @@ public class ServerInfoVo{
public String getIp_port() {
return ip_port;
}
+ public long getOnlineNum(){
+ return onlineNum;
+ }
public void setIp_port(String ip_port) {
this.ip_port = ip_port;
}
+
+ @Override
+ public String toString() {
+ return "ServerInfoVo{" +
+ "server_id='" + server_id + '\'' +
+ ", ip_port='" + ip_port + '\'' +
+ ", name='" + name + '\'' +
+ ", open_time='" + open_time + '\'' +
+ ", open_type='" + open_type + '\'' +
+ ", status=" + status +
+ ", is_new=" + is_new +
+ ", registerNum=" + registerNum +
+ ", onlineNum=" + onlineNum +
+ '}';
+ }
}
diff --git a/src/main/resources/static/html/sendSysNotice.html b/src/main/resources/static/html/sendSysNotice.html
index c3b14c4..52430ff 100644
--- a/src/main/resources/static/html/sendSysNotice.html
+++ b/src/main/resources/static/html/sendSysNotice.html
@@ -36,16 +36,21 @@
@@ -93,7 +100,7 @@
-
@@ -140,19 +147,77 @@ $('#updataSYSNotice').load(function () {
function sendCheck() {
var erroCode = $('.SERVERID');
+ var reg = new RegExp("[|#]",'g');
var title1 = $("input[name='title1']").val();
- var content1 = document.getElementById("summary").value;
+ var title2 = $("input[name='title2']").val();
+ var title3 = $("input[name='title3']").val();
+
+ var title = title1+"|"+title2+"|"+title3;
+
+ var content1 = $("textarea[name='content1']").val();
+ var content2 = $("textarea[name='content2']").val();
+ var content3 = $("textarea[name='content3']").val();
+
+ var content = content1+"|"+content2+"|"+content3;
+
+ if (reg.test(title1)){
+ alert("中文标题不能有特殊字符")
+ }
+ if (reg.test(title2)){
+ alert("英文标题不能有特殊字符")
+ }
+ if (reg.test(title3)){
+ alert("越南文标题不能有特殊字符")
+ }
+ if (reg.test(content1)){
+ alert("中文正文不能有特殊字符")
+ }
+
+ if (reg.test(content2)){
+ alert("英文正文不能有特殊字符")
+ }
+ if (reg.test(content3)){
+ alert("越南文正文不能有特殊字符")
+ }
+
+ var startTime = $("input[name='startTime']").val();
+ var endTime = $("input[name='endTime']").val();
+ var addType = $("select[name='addType']").val();
+
+ if (title === '' || title == null) {
- if (title1 === '' || title1 == null) {
erroCode.html('
游戏公告标题不能为空!');
return false;
}
- if (content1 === '' || content1 == null) {
+ if (content === '' || content == null) {
erroCode.html('
游戏公告内容不能为空!');
return false;
}
+ $.ajax({
+ type: "POST",
+ data:
+ JSON.stringify({
+ "title": title,
+ "content": content,
+ "startTime": startTime,
+ "endTime": endTime,
+ "addType": addType
+ })
+ ,
+ url: "/publishNotice",
- return true;
+ contentType: 'application/json',
+
+ success: function (data) {
+ console.log(data)
+ if (data === 0) {
+ layer.msg('成功!', {icon: 6, time: 1000});
+ }else {
+ layer.msg('失败!', {icon: 6, time: 1000});
+ }
+ }
+ }
+ )
}
diff --git a/src/main/resources/templates/sendPersonalMail.html b/src/main/resources/templates/sendPersonalMail.html
index 64fa898..a8651ed 100644
--- a/src/main/resources/templates/sendPersonalMail.html
+++ b/src/main/resources/templates/sendPersonalMail.html
@@ -70,13 +70,13 @@
邮件标题:
@@ -88,7 +88,7 @@
中文
英文
- 粤文
+ 越南文
@@ -285,16 +285,36 @@
}
})
}
-
+
function sendSysMail() {
+ //特殊字符验证
+ var reg = new RegExp("[|#]",'g');
var mailTitle1 = $("input[name='mailTitle1']").val();
+ if (reg.test(mailTitle1)){
+ alert("中文标题不能有特殊字符")
+ }
var mailTitle2 = $("input[name='mailTitle2']").val();
+ if (reg.test(mailTitle2)){
+ alert("英文标题不能有特殊字符")
+ }
var mailTitle3 = $("input[name='mailTitle3']").val();
+ if (reg.test(mailTitle3)){
+ alert("越南文标题不能有特殊字符")
+ }
var mailContent1 = $("textarea[name='mailContent1']").val();
+ if (reg.test(mailContent1)){
+ alert("中文正文不能有特殊字符")
+ }
var mailContent2 = $("textarea[name='mailContent2']").val();
+ if (reg.test(mailContent2)){
+ alert("英文正文不能有特殊字符")
+ }
var mailContent3 = $("textarea[name='mailContent3']").val();
+ if (reg.test(mailContent3)){
+ alert("越南文正文不能有特殊字符")
+ }
var mailTitle = mailTitle1+"|"+mailTitle2+"|"+mailTitle3;
diff --git a/src/main/resources/templates/sendSysCmd.html b/src/main/resources/templates/sendSysCmd.html
index 5bd5917..b078f9f 100644
--- a/src/main/resources/templates/sendSysCmd.html
+++ b/src/main/resources/templates/sendSysCmd.html
@@ -63,39 +63,61 @@
+
+
+
+ 全选
+
+