diff --git a/controller/ip.go b/controller/ip.go index 7173c6b..d275fc7 100644 --- a/controller/ip.go +++ b/controller/ip.go @@ -25,6 +25,9 @@ func PostIpblack(c *gin.Context) { } func GetIpblacks(c *gin.Context) { page,_:=strconv.Atoi(c.Query("page")) + if page==0{ + page=1 + } count:=models.CountIps(nil,nil) list:=models.FindIps(nil,nil,uint(page),config.VisitorPageSize) c.JSON(200, gin.H{ diff --git a/router/api.go b/router/api.go index d7294a7..14fb6d1 100644 --- a/router/api.go +++ b/router/api.go @@ -50,5 +50,5 @@ func InitApiRouter(engine *gin.Engine){ engine.DELETE("/notice",middleware.JwtApiMiddleware, controller.DelNotice) engine.GET("/notices",middleware.JwtApiMiddleware, controller.GetNotices) engine.POST("/ipblack",middleware.JwtApiMiddleware,controller.PostIpblack) - engine.POST("/ipblacks_all",middleware.JwtApiMiddleware,controller.GetIpblacks) + engine.GET("/ipblacks_all",middleware.JwtApiMiddleware,controller.GetIpblacks) } \ No newline at end of file diff --git a/static/html/setting_bottom.html b/static/html/setting_bottom.html index efb8748..8374b0d 100644 --- a/static/html/setting_bottom.html +++ b/static/html/setting_bottom.html @@ -70,6 +70,7 @@ roleDialog:false, noticeList:[], welcomeDialog:false, + ipblackList:[], welcomeForm: { content: "", }, @@ -194,6 +195,11 @@ _this.noticeList=result; }); } + if(ACTION=="setting_ipblack"){ + this.sendAjax("/ipblacks_all","get",{},function(result){ + _this.ipblackList=result.list; + }); + } }, sendAjax(url,method,params,callback){ let _this=this; diff --git a/static/html/setting_ipblack.html b/static/html/setting_ipblack.html new file mode 100644 index 0000000..63bcd0f --- /dev/null +++ b/static/html/setting_ipblack.html @@ -0,0 +1,35 @@ +{{template "header" }} +
+ + +
+ +{{template "setting_bottom" .}}