From e8747444f791d136480ae734e74dc3a4e8792213 Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Fri, 11 Sep 2020 17:58:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=BB=91=E5=90=8D=E5=8D=95ip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/ip.go | 2 +- models/ipblacks.go | 4 ++-- readme.md | 20 ++++++++++++-------- static/html/setting_bottom.html | 9 +++++++++ static/html/setting_ipblack.html | 2 +- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/controller/ip.go b/controller/ip.go index 7a83880..b1339ee 100644 --- a/controller/ip.go +++ b/controller/ip.go @@ -32,7 +32,7 @@ func DelIpblack(c *gin.Context) { }) return } - models.DeleteIpblackById(ip) + models.DeleteIpblackByIp(ip) c.JSON(200, gin.H{ "code": 200, "msg": "删除黑名单成功!", diff --git a/models/ipblacks.go b/models/ipblacks.go index 6a577b6..298e2b8 100644 --- a/models/ipblacks.go +++ b/models/ipblacks.go @@ -17,8 +17,8 @@ func CreateIpblack(ip string,kefuId string)uint{ DB.Create(black) return black.ID } -func DeleteIpblackById(id string){ - DB.Where("id = ?",id).Delete(Ipblack{}) +func DeleteIpblackByIp(ip string){ + DB.Where("ip = ?",ip).Delete(Ipblack{}) } func FindIp(ip string)Ipblack{ var ipblack Ipblack diff --git a/readme.md b/readme.md index e797241..abe245e 100644 --- a/readme.md +++ b/readme.md @@ -1,25 +1,29 @@ # go-fly 基于GO语言实现的web客服即时通讯与客服管理系统。 -1.使用gin http框架实现restful风格的API +1.使用gin http框架实现restful风格的API和template包的模板语法进行展示界面 2.使用jwt-go配合gin中间件实现无状态的jwt登陆认证 -3.使用casbin配合gin中间件实现权限控制 +3.数据库实现的rbac权限配合gin中间件实现权限控制 -4.使用gin以及template包的模板语法进行展示界面 +4.通过cobra进行命令行参数解析和执行对应的功能 5.使用go modoule解决依赖问题 -6.使用go-imap实现邮件的列表展示和读取 +6.使用swagger实现文档展示 -7.使用go-smtp实现发送邮件 +7.使用go-imap实现邮件的列表展示和读取 -8.使用github.com/gorilla/websocket实现即时通讯 +8.使用go-smtp实现发送邮件 -9.使用gorm配合mysql实现数据存储 +9.使用github.com/gorilla/websocket实现即时通讯 -10.充分实践了struct,interface,map,slice,for range,groutine和channel管道等基础知识 +10.使用gorm配合mysql实现数据存储 + +11.前端使用elementUI和Vue展示界面 + +11.充分实践了struct,interface,map,slice,for range,groutine和channel管道等基础知识 ### 项目预览 diff --git a/static/html/setting_bottom.html b/static/html/setting_bottom.html index 8374b0d..572340a 100644 --- a/static/html/setting_bottom.html +++ b/static/html/setting_bottom.html @@ -310,6 +310,15 @@ }); }); }, + //删除ip + deleteIpblack(ip){ + let _this=this; + this.sendAjax("/ipblack?ip="+ip,"DELETE",{ip:ip},function(result){ + _this.sendAjax("/ipblacks_all","get",{},function(result){ + _this.ipblackList=result.list; + }); + }); + }, //配置角色权限 showAuthDialog(id,name,method,path){ this.roleForm.id=id diff --git a/static/html/setting_ipblack.html b/static/html/setting_ipblack.html index 63bcd0f..664500b 100644 --- a/static/html/setting_ipblack.html +++ b/static/html/setting_ipblack.html @@ -21,7 +21,7 @@ prop="id" label="操作">