From 659f4a5256af1b2324e9587e25d8d08fcba0fac7 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Wed, 6 May 2020 16:05:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Duser=20API=E7=BB=84=E7=9A=84?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E4=BB=B6=E6=9C=AA=E5=BC=80=E6=94=BE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/server.go | 2 ++ server/db/qmplus.sql | 10 +++++----- server/router/sys_user.go | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/server/core/server.go b/server/core/server.go index 9fa1c708..803d0d07 100644 --- a/server/core/server.go +++ b/server/core/server.go @@ -23,6 +23,8 @@ func RunWindowsServer() { WriteTimeout: 10 * time.Second, MaxHeaderBytes: 1 << 20, } + // 保证文本顺序输出 + // In order to ensure that the text order output can be deleted time.Sleep(10 * time.Microsecond) global.GVA_LOG.Debug("server run success on ", address) diff --git a/server/db/qmplus.sql b/server/db/qmplus.sql index 72d43f9a..359804bc 100644 --- a/server/db/qmplus.sql +++ b/server/db/qmplus.sql @@ -11,7 +11,7 @@ Target Server Version : 50644 File Encoding : 65001 - Date: 30/04/2020 20:47:13 + Date: 06/05/2020 16:05:06 */ SET NAMES utf8mb4; @@ -57,7 +57,7 @@ INSERT INTO `casbin_rule` VALUES ('p', '8881', '/menu/updateBaseMenu', 'POST', ' INSERT INTO `casbin_rule` VALUES ('p', '8881', '/menu/getBaseMenuById', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '8881', '/user/changePassword', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '8881', '/user/uploadHeaderImg', 'POST', '', '', ''); -INSERT INTO `casbin_rule` VALUES ('p', '8881', '/user/getInfoList', 'POST', '', '', ''); +INSERT INTO `casbin_rule` VALUES ('p', '8881', '/user/deleteUser', 'DELETE', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '8881', '/user/getUserList', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '8881', '/user/setUserAuthority', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '8881', '/fileUploadAndDownload/upload', 'POST', '', '', ''); @@ -96,7 +96,7 @@ INSERT INTO `casbin_rule` VALUES ('p', '9528', '/menu/updateBaseMenu', 'POST', ' INSERT INTO `casbin_rule` VALUES ('p', '9528', '/menu/getBaseMenuById', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '9528', '/user/changePassword', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '9528', '/user/uploadHeaderImg', 'POST', '', '', ''); -INSERT INTO `casbin_rule` VALUES ('p', '9528', '/user/getInfoList', 'POST', '', '', ''); +INSERT INTO `casbin_rule` VALUES ('p', '9528', '/user/deleteUser', 'DELETE', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '9528', '/user/getUserList', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '9528', '/user/setUserAuthority', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '9528', '/fileUploadAndDownload/upload', 'POST', '', '', ''); @@ -138,7 +138,7 @@ INSERT INTO `casbin_rule` VALUES ('p', '888', '/menu/updateBaseMenu', 'POST', '' INSERT INTO `casbin_rule` VALUES ('p', '888', '/menu/getBaseMenuById', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '888', '/user/changePassword', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '888', '/user/uploadHeaderImg', 'POST', '', '', ''); -INSERT INTO `casbin_rule` VALUES ('p', '888', '/user/getInfoList', 'POST', '', '', ''); +INSERT INTO `casbin_rule` VALUES ('p', '888', '/user/deleteUser', 'DELETE', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '888', '/user/getUserList', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '888', '/user/setUserAuthority', 'POST', '', '', ''); INSERT INTO `casbin_rule` VALUES ('p', '888', '/fileUploadAndDownload/upload', 'POST', '', '', ''); @@ -3967,7 +3967,7 @@ INSERT INTO `sys_apis` VALUES (21, '2019-09-30 15:28:05', '2019-09-30 15:28:05', INSERT INTO `sys_apis` VALUES (22, '2019-09-30 15:28:21', '2019-09-30 15:28:21', NULL, NULL, '/menu/getBaseMenuById', '根据id获取菜单', 'menu', 'POST'); INSERT INTO `sys_apis` VALUES (23, '2019-09-30 15:29:19', '2019-09-30 15:29:19', NULL, NULL, '/user/changePassword', '修改密码', 'user', 'POST'); INSERT INTO `sys_apis` VALUES (24, '2019-09-30 15:29:33', '2019-09-30 15:29:33', NULL, NULL, '/user/uploadHeaderImg', '上传头像', 'user', 'POST'); -INSERT INTO `sys_apis` VALUES (25, '2019-09-30 15:30:00', '2019-09-30 15:30:00', NULL, NULL, '/user/getInfoList', '分页获取用户列表', 'user', 'POST'); +INSERT INTO `sys_apis` VALUES (25, '2019-09-30 15:30:00', '2020-05-06 16:03:47', NULL, NULL, '/user/deleteUser', '删除用户', 'user', 'DELETE'); INSERT INTO `sys_apis` VALUES (28, '2019-10-09 15:15:17', '2019-10-09 15:17:07', NULL, NULL, '/user/getUserList', '获取用户列表', 'user', 'POST'); INSERT INTO `sys_apis` VALUES (29, '2019-10-09 23:01:40', '2019-10-09 23:01:40', NULL, NULL, '/user/setUserAuthority', '修改用户角色', 'user', 'POST'); INSERT INTO `sys_apis` VALUES (30, '2019-10-26 20:14:38', '2019-10-26 20:14:38', NULL, NULL, '/fileUploadAndDownload/upload', '文件上传示例', 'fileUploadAndDownload', 'POST'); diff --git a/server/router/sys_user.go b/server/router/sys_user.go index 7c4369ca..567bd3a9 100644 --- a/server/router/sys_user.go +++ b/server/router/sys_user.go @@ -2,12 +2,12 @@ package router import ( "gin-vue-admin/api/v1" + "gin-vue-admin/middleware" "github.com/gin-gonic/gin" ) func InitUserRouter(Router *gin.RouterGroup) { - UserRouter := Router.Group("user") - //.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler()) + UserRouter := Router.Group("user").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler()) { UserRouter.POST("changePassword", v1.ChangePassword) // 修改密码 UserRouter.POST("uploadHeaderImg", v1.UploadHeaderImg) //上传头像