新增IP黑名单列表

pull/30/head
陶士涵 4 years ago
parent dd7ad61a5d
commit ece409d180

@ -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{

@ -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)
}

@ -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;

@ -0,0 +1,35 @@
{{template "header" }}
<div id="app" style="width:100%">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
{{template "setting_left" .}}
<el-main class="mainMain">
<el-table
:data="ipblackList"
border
style="width: 100%">
<el-table-column
prop="ip"
label="黑IP">
</el-table-column>
<el-table-column
prop="create_at"
label="添加时间">
</el-table-column>
<el-table-column
prop="id"
label="操作">
<template slot-scope="scope">
<el-button @click="" type="danger" size="small" plain>删除</el-button>
</template>
</el-table-column>
</el-table>
</el-main>
</el-container>
</template>
</div>
</body>
{{template "setting_bottom" .}}
Loading…
Cancel
Save