diff --git a/src/main/java/com/jmfy/WebSecurityConfig.java b/src/main/java/com/jmfy/WebSecurityConfig.java
index 4b16611..9948f5b 100644
--- a/src/main/java/com/jmfy/WebSecurityConfig.java
+++ b/src/main/java/com/jmfy/WebSecurityConfig.java
@@ -40,6 +40,7 @@ public class WebSecurityConfig extends WebMvcConfigurerAdapter{
addInterceptor.excludePathPatterns("/error");
addInterceptor.excludePathPatterns("/login**");
addInterceptor.excludePathPatterns("/req/**");
+ addInterceptor.excludePathPatterns("/webGetChannelInfo**");
addInterceptor.addPathPatterns("/**");
}
diff --git a/src/main/java/com/jmfy/controller/ChannelInfoController.java b/src/main/java/com/jmfy/controller/ChannelInfoController.java
index 0a8fcce..57381c4 100644
--- a/src/main/java/com/jmfy/controller/ChannelInfoController.java
+++ b/src/main/java/com/jmfy/controller/ChannelInfoController.java
@@ -15,8 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.util.HashMap;
-import java.util.List;
+import java.util.*;
/**
* @Author hj
@@ -51,6 +50,22 @@ public class ChannelInfoController {
return "channelInfo";
}
+ /**
+ * 外部获取渠道信息
+ * @param map
+ * @returnc
+ */
+ @RequestMapping(value = "/webGetChannelInfo", method = {RequestMethod.POST, RequestMethod.GET})
+ @ResponseBody
+ public String webGetChannelInfo(HttpServletRequest request) throws Exception {
+ String ccId = request.getParameter("ccId");
+ ChannelInfo info = channelInfoDao.getChannelInfoById(ccId);
+ if (info == null){
+ return "-1";
+ }
+ return String.valueOf(info.getShielding());
+ }
+
/**
* 添加
* @param request
@@ -88,6 +103,60 @@ public class ChannelInfoController {
return 1;
}
+ /**
+ * 修改
+ * @param request
+ * @return
+ * @throws Exception
+ */
+ @RequestMapping(value = "/updateChannel", method = {RequestMethod.POST, RequestMethod.GET})
+ public @ResponseBody
+ int updateChannel(HttpServletRequest request) throws Exception {
+ HashMap
@@ -50,8 +51,12 @@
ID
名称
+ 是否和谐
操作
+
+
@@ -82,6 +87,12 @@
]
});
+ // 修改密码
+ function updateChannel(obj) {
+ var id = $(obj).attr("id");
+ window.location = "/toUpdateChannel?id=" + id;
+ }
+
// 添加
function addChannel() {
var name = $("#channel").val();
@@ -111,29 +122,34 @@
})
}
- // 单个审核
+ // 删除
function deleteChannel(obj) {
var id = $(obj).attr("id");
- $.ajax({
- type: "POST",
- data: {
- "id": id
- },
- url: "/deleteChannelInfo",
- success: function (data) {
- if (data === 1) {
- layer.msg('操作成功!', {icon: 6, time: 1000});
- window.location.reload();
- }
- if (data === 0) {
- layer.msg('操作失败,数据不存在!', {icon: 6, time: 1000});
- }
- if (data === 2) {
- layer.msg('没有权限', {icon: 6, time: 1000});
+ var msg = "您真的确定要删除id为:{" + id +"}的渠道吗?\n\n请确认!";
+ if (confirm(msg) === true) {
+ $.ajax({
+ type: "POST",
+ data: {
+ "id": id
+ },
+ url: "/deleteChannelInfo",
+ success: function (data) {
+ if (data === 1) {
+ layer.msg('操作成功!', {icon: 6, time: 1000});
+ window.location.reload();
+ }
+ if (data === 0) {
+ layer.msg('操作失败,数据不存在!', {icon: 6, time: 1000});
+ }
+ if (data === 2) {
+ layer.msg('没有权限', {icon: 6, time: 1000});
+ }
}
}
- }
- )
+ )
+ }else {
+ return false;
+ }
}
diff --git a/src/main/resources/templates/updateChannel.html b/src/main/resources/templates/updateChannel.html new file mode 100644 index 0000000..b58646f --- /dev/null +++ b/src/main/resources/templates/updateChannel.html @@ -0,0 +1,147 @@ + + +
+ + + + + + + + + + + + + + + + +
+ +
+