Browse Source

用户头像由上传模式改为 媒体库选择模式

QM303176530 4 years ago
parent
commit
dda3f7a841

+ 0 - 1
server/GORMV2接口测试文档.md

@@ -21,7 +21,6 @@
 | /menu/updateBaseMenu                              | 更新菜单                |    √     | SliverHorn |
 | /menu/getBaseMenuById                             | 根据id获取菜单          |    √     | SliverHorn |
 | /user/changePassword                              | 修改密码                |    √     | SliverHorn |
-| /user/uploadHeaderImg                             | 上传头像                |    √     | SliverHorn |
 | /user/getUserList                                 | 获取用户列表            |    √     | SliverHorn |
 | /user/setUserAuthority                            | 修改用户角色            |    √     | SliverHorn |
 | /fileUploadAndDownload/upload                     | 文件上传示例            |    √     | SliverHorn |

+ 22 - 45
server/api/v1/sys_user.go

@@ -90,7 +90,7 @@ func tokenNext(c *gin.Context, user model.SysUser) {
 		NickName:    user.NickName,
 		Username:    user.Username,
 		AuthorityId: user.AuthorityId,
-		BufferTime:  60*60*24, // 缓冲时间1天 缓冲时间内会获得新的token刷新令牌 此时一个用户会存在两个有效令牌 但是前端只留一个 另一个会丢失
+		BufferTime:  60 * 60 * 24, // 缓冲时间1天 缓冲时间内会获得新的token刷新令牌 此时一个用户会存在两个有效令牌 但是前端只留一个 另一个会丢失
 		StandardClaims: jwt.StandardClaims{
 			NotBefore: time.Now().Unix() - 1000,       // 签名生效时间
 			ExpiresAt: time.Now().Unix() + 60*60*24*7, // 过期时间 7天
@@ -174,50 +174,6 @@ type UserHeaderImg struct {
 	HeaderImg multipart.File `json:"headerImg"`
 }
 
-// @Tags SysUser
-// @Summary 用户上传头像
-// @Security ApiKeyAuth
-// @accept multipart/form-data
-// @Produce  application/json
-// @Param headerImg formData file true "用户上传头像"
-// @Param username formData string true "用户上传头像"
-// @Success 200 {string} string "{"success":true,"data":{},"msg":"上传成功"}"
-// @Router /user/uploadHeaderImg [post]
-func UploadHeaderImg(c *gin.Context) {
-	claims, _ := c.Get("claims")
-	// 获取头像文件
-	// 这里我们通过断言获取 claims内的所有内容
-	waitUse := claims.(*request.CustomClaims)
-	uuid := waitUse.UUID
-	_, header, err := c.Request.FormFile("headerImg")
-	// 便于找到用户 以后从jwt中取
-	if err != nil {
-		response.FailWithMessage(fmt.Sprintf("上传文件失败,%v", err), c)
-	} else {
-		// 文件上传后拿到文件路径
-		var uploadErr error
-		var filePath string
-		if global.GVA_CONFIG.LocalUpload.Local {
-			// 本地上传
-			uploadErr, filePath, _ = utils.UploadAvatarLocal(header)
-		} else {
-			// 七牛云上传
-			uploadErr, filePath, _ = utils.UploadRemote(header)
-		}
-		if uploadErr != nil {
-			response.FailWithMessage(fmt.Sprintf("接收返回值失败,%v", err), c)
-		} else {
-			// 修改数据库后得到修改后的user并且返回供前端使用
-			err, user := service.UploadHeaderImg(uuid, filePath)
-			if err != nil {
-				response.FailWithMessage(fmt.Sprintf("修改数据库链接失败,%v", err), c)
-			} else {
-				response.OkWithData(resp.SysUserResponse{User: *user}, c)
-			}
-		}
-	}
-}
-
 // @Tags SysUser
 // @Summary 分页获取用户列表
 // @Security ApiKeyAuth
@@ -298,3 +254,24 @@ func DeleteUser(c *gin.Context) {
 		response.OkWithMessage("删除成功", c)
 	}
 }
+
+// @Tags SysUser
+// @Summary 删除用户
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysUser true "删除用户"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
+// @Router /user/setUserInfo [put]
+func SetUserInfo(c *gin.Context) {
+	var user model.SysUser
+	c.ShouldBindJSON(&user)
+	err, ReqUser := service.SetUserInfo(user)
+	if err != nil {
+		response.FailWithMessage(fmt.Sprintf("更新失败,%v", err), c)
+	} else {
+		response.OkWithData(gin.H{
+			"userInfo": ReqUser,
+		}, c)
+	}
+}

File diff suppressed because it is too large
+ 19 - 24
server/db/qmplus.sql


+ 0 - 6
server/db/sqlite/casbin_rule.sql

@@ -43,8 +43,6 @@ INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 'p','8881','/user/changePassword','POST','','','');
 INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
-'p','8881','/user/uploadHeaderImg','POST','','','');
-INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 'p','8881','/user/getInfoList','POST','','','');
 INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 'p','8881','/user/getUserList','POST','','','');
@@ -121,8 +119,6 @@ INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 'p','9528','/user/changePassword','POST','','','');
 INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
-'p','9528','/user/uploadHeaderImg','POST','','','');
-INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 'p','9528','/user/getInfoList','POST','','','');
 INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 'p','9528','/user/getUserList','POST','','','');
@@ -201,8 +197,6 @@ INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 'p','888','/user/changePassword','POST','','','');
 INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
-'p','888','/user/uploadHeaderImg','POST','','','');
-INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 'p','888','/user/getInfoList','POST','','','');
 INSERT INTO casbin_rule (p_type,v0,v1,v2,v3,v4,v5) VALUES (
 'p','888','/user/getUserList','POST','','','');

+ 0 - 2
server/db/sqlite/sys_apis.sql

@@ -41,8 +41,6 @@ INSERT INTO sys_apis (id,created_at,updated_at,deleted_at,authority_id,"path",de
 INSERT INTO sys_apis (id,created_at,updated_at,deleted_at,authority_id,"path",description,api_group,"method") VALUES (
 23,1569828559000,1569828559000,NULL,NULL,'/user/changePassword','修改密码','user','POST');
 INSERT INTO sys_apis (id,created_at,updated_at,deleted_at,authority_id,"path",description,api_group,"method") VALUES (
-24,1569828573000,1569828573000,NULL,NULL,'/user/uploadHeaderImg','上传头像','user','POST');
-INSERT INTO sys_apis (id,created_at,updated_at,deleted_at,authority_id,"path",description,api_group,"method") VALUES (
 25,1569828600000,1569828600000,NULL,NULL,'/user/getInfoList','分页获取用户列表','user','POST');
 INSERT INTO sys_apis (id,created_at,updated_at,deleted_at,authority_id,"path",description,api_group,"method") VALUES (
 28,1570605317000,1570605427000,NULL,NULL,'/user/getUserList','获取用户列表','user','POST');

+ 20 - 177
server/docs/docs.go

@@ -1,6 +1,6 @@
 // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
 // This file was generated by swaggo/swag at
-// 2020-08-20 11:59:55.622609 +0800 CST m=+0.106561201
+// 2020-08-31 21:50:05.0136259 +0800 CST m=+0.193314401
 
 package docs
 
@@ -50,7 +50,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysApi"
                         }
                     }
@@ -89,7 +88,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysApi"
                         }
                     }
@@ -155,7 +153,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.GetById"
                         }
                     }
@@ -194,7 +191,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.SearchApiParams"
                         }
                     }
@@ -233,7 +229,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysApi"
                         }
                     }
@@ -272,7 +267,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/response.SysAuthorityCopyResponse"
                         }
                     }
@@ -311,7 +305,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysAuthority"
                         }
                     }
@@ -350,7 +343,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysAuthority"
                         }
                     }
@@ -389,7 +381,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.PageInfo"
                         }
                     }
@@ -428,7 +419,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysAuthority"
                         }
                     }
@@ -467,7 +457,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysAuthority"
                         }
                     }
@@ -506,7 +495,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.AutoCodeStruct"
                         }
                     }
@@ -591,7 +579,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.RegisterAndLoginStruct"
                         }
                     }
@@ -622,7 +609,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysUser"
                         }
                     }
@@ -637,45 +623,6 @@ var doc = `{
                 }
             }
         },
-        "/casbin/CasbinTest": {
-            "get": {
-                "security": [
-                    {
-                        "ApiKeyAuth": []
-                    }
-                ],
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "casbin"
-                ],
-                "summary": "casb RBAC RESTFUL测试路由",
-                "parameters": [
-                    {
-                        "description": "获取权限列表",
-                        "name": "data",
-                        "in": "body",
-                        "required": true,
-                        "schema": {
-                            "type": "object",
-                            "$ref": "#/definitions/request.CasbinInReceive"
-                        }
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
-                        "schema": {
-                            "type": "string"
-                        }
-                    }
-                }
-            }
-        },
         "/casbin/UpdateCasbin": {
             "post": {
                 "security": [
@@ -700,7 +647,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.CasbinInReceive"
                         }
                     }
@@ -739,7 +685,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.CasbinInReceive"
                         }
                     }
@@ -778,7 +723,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.ExaCustomer"
                         }
                     }
@@ -815,7 +759,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.ExaCustomer"
                         }
                     }
@@ -852,7 +795,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.ExaCustomer"
                         }
                     }
@@ -889,7 +831,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.ExaCustomer"
                         }
                     }
@@ -928,7 +869,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.PageInfo"
                         }
                     }
@@ -1000,7 +940,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.ExaFileUploadAndDownload"
                         }
                     }
@@ -1075,7 +1014,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.PageInfo"
                         }
                     }
@@ -1213,7 +1151,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.AuthorityIdInfo"
                         }
                     }
@@ -1252,7 +1189,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysBaseMenu"
                         }
                     }
@@ -1291,7 +1227,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.AddMenuAuthorityInfo"
                         }
                     }
@@ -1330,7 +1265,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.GetById"
                         }
                     }
@@ -1369,7 +1303,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.GetById"
                         }
                     }
@@ -1405,7 +1338,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.RegisterAndLoginStruct"
                         }
                     }
@@ -1441,7 +1373,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.RegisterAndLoginStruct"
                         }
                     }
@@ -1480,7 +1411,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.PageInfo"
                         }
                     }
@@ -1519,7 +1449,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysBaseMenu"
                         }
                     }
@@ -1651,7 +1580,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionary"
                         }
                     }
@@ -1690,7 +1618,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionary"
                         }
                     }
@@ -1729,7 +1656,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionary"
                         }
                     }
@@ -1768,7 +1694,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.SysDictionarySearch"
                         }
                     }
@@ -1807,7 +1732,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionary"
                         }
                     }
@@ -1846,7 +1770,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionaryDetail"
                         }
                     }
@@ -1885,7 +1808,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionaryDetail"
                         }
                     }
@@ -1924,7 +1846,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionaryDetail"
                         }
                     }
@@ -1963,7 +1884,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.SysDictionaryDetailSearch"
                         }
                     }
@@ -2002,7 +1922,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionaryDetail"
                         }
                     }
@@ -2041,7 +1960,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysOperationRecord"
                         }
                     }
@@ -2080,7 +1998,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysOperationRecord"
                         }
                     }
@@ -2119,7 +2036,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.IdsReq"
                         }
                     }
@@ -2158,7 +2074,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysOperationRecord"
                         }
                     }
@@ -2197,7 +2112,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.SysOperationRecordSearch"
                         }
                     }
@@ -2212,45 +2126,6 @@ var doc = `{
                 }
             }
         },
-        "/sysOperationRecord/updateSysOperationRecord": {
-            "put": {
-                "security": [
-                    {
-                        "ApiKeyAuth": []
-                    }
-                ],
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "SysOperationRecord"
-                ],
-                "summary": "更新SysOperationRecord",
-                "parameters": [
-                    {
-                        "description": "更新SysOperationRecord",
-                        "name": "data",
-                        "in": "body",
-                        "required": true,
-                        "schema": {
-                            "type": "object",
-                            "$ref": "#/definitions/model.SysOperationRecord"
-                        }
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}",
-                        "schema": {
-                            "type": "string"
-                        }
-                    }
-                }
-            }
-        },
         "/system/ReloadSystem": {
             "post": {
                 "security": [
@@ -2272,7 +2147,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.System"
                         }
                     }
@@ -2332,7 +2206,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.System"
                         }
                     }
@@ -2368,7 +2241,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.ChangePasswordStruct"
                         }
                     }
@@ -2407,7 +2279,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.GetById"
                         }
                     }
@@ -2446,7 +2317,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.PageInfo"
                         }
                     }
@@ -2485,7 +2355,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.SetUserAuth"
                         }
                     }
@@ -2500,49 +2369,6 @@ var doc = `{
                 }
             }
         },
-        "/user/uploadHeaderImg": {
-            "post": {
-                "security": [
-                    {
-                        "ApiKeyAuth": []
-                    }
-                ],
-                "consumes": [
-                    "multipart/form-data"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "SysUser"
-                ],
-                "summary": "用户上传头像",
-                "parameters": [
-                    {
-                        "type": "file",
-                        "description": "用户上传头像",
-                        "name": "headerImg",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "用户上传头像",
-                        "name": "username",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}",
-                        "schema": {
-                            "type": "string"
-                        }
-                    }
-                }
-            }
-        },
         "/workflow/createWorkFlow": {
             "post": {
                 "produces": [
@@ -2559,7 +2385,6 @@ var doc = `{
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysWorkflow"
                         }
                     }
@@ -2606,6 +2431,20 @@ var doc = `{
                 }
             }
         },
+        "config.LocalUpload": {
+            "type": "object",
+            "properties": {
+                "avatarPath": {
+                    "type": "string"
+                },
+                "filePath": {
+                    "type": "string"
+                },
+                "local": {
+                    "type": "boolean"
+                }
+            }
+        },
         "config.Log": {
             "type": "object",
             "properties": {
@@ -2698,6 +2537,10 @@ var doc = `{
                     "type": "object",
                     "$ref": "#/definitions/config.JWT"
                 },
+                "localUpload": {
+                    "type": "object",
+                    "$ref": "#/definitions/config.LocalUpload"
+                },
                 "log": {
                     "type": "object",
                     "$ref": "#/definitions/config.Log"
@@ -2980,7 +2823,7 @@ var doc = `{
                 "key": {
                     "type": "string"
                 },
-                "sysBaseMenuId": {
+                "sysBaseMenuID": {
                     "type": "integer"
                 },
                 "type": {

+ 19 - 176
server/docs/swagger.json

@@ -33,7 +33,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysApi"
                         }
                     }
@@ -72,7 +71,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysApi"
                         }
                     }
@@ -138,7 +136,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.GetById"
                         }
                     }
@@ -177,7 +174,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.SearchApiParams"
                         }
                     }
@@ -216,7 +212,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysApi"
                         }
                     }
@@ -255,7 +250,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/response.SysAuthorityCopyResponse"
                         }
                     }
@@ -294,7 +288,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysAuthority"
                         }
                     }
@@ -333,7 +326,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysAuthority"
                         }
                     }
@@ -372,7 +364,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.PageInfo"
                         }
                     }
@@ -411,7 +402,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysAuthority"
                         }
                     }
@@ -450,7 +440,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysAuthority"
                         }
                     }
@@ -489,7 +478,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.AutoCodeStruct"
                         }
                     }
@@ -574,7 +562,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.RegisterAndLoginStruct"
                         }
                     }
@@ -605,7 +592,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysUser"
                         }
                     }
@@ -620,45 +606,6 @@
                 }
             }
         },
-        "/casbin/CasbinTest": {
-            "get": {
-                "security": [
-                    {
-                        "ApiKeyAuth": []
-                    }
-                ],
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "casbin"
-                ],
-                "summary": "casb RBAC RESTFUL测试路由",
-                "parameters": [
-                    {
-                        "description": "获取权限列表",
-                        "name": "data",
-                        "in": "body",
-                        "required": true,
-                        "schema": {
-                            "type": "object",
-                            "$ref": "#/definitions/request.CasbinInReceive"
-                        }
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
-                        "schema": {
-                            "type": "string"
-                        }
-                    }
-                }
-            }
-        },
         "/casbin/UpdateCasbin": {
             "post": {
                 "security": [
@@ -683,7 +630,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.CasbinInReceive"
                         }
                     }
@@ -722,7 +668,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.CasbinInReceive"
                         }
                     }
@@ -761,7 +706,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.ExaCustomer"
                         }
                     }
@@ -798,7 +742,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.ExaCustomer"
                         }
                     }
@@ -835,7 +778,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.ExaCustomer"
                         }
                     }
@@ -872,7 +814,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.ExaCustomer"
                         }
                     }
@@ -911,7 +852,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.PageInfo"
                         }
                     }
@@ -983,7 +923,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.ExaFileUploadAndDownload"
                         }
                     }
@@ -1058,7 +997,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.PageInfo"
                         }
                     }
@@ -1196,7 +1134,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.AuthorityIdInfo"
                         }
                     }
@@ -1235,7 +1172,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysBaseMenu"
                         }
                     }
@@ -1274,7 +1210,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.AddMenuAuthorityInfo"
                         }
                     }
@@ -1313,7 +1248,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.GetById"
                         }
                     }
@@ -1352,7 +1286,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.GetById"
                         }
                     }
@@ -1388,7 +1321,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.RegisterAndLoginStruct"
                         }
                     }
@@ -1424,7 +1356,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.RegisterAndLoginStruct"
                         }
                     }
@@ -1463,7 +1394,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.PageInfo"
                         }
                     }
@@ -1502,7 +1432,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysBaseMenu"
                         }
                     }
@@ -1634,7 +1563,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionary"
                         }
                     }
@@ -1673,7 +1601,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionary"
                         }
                     }
@@ -1712,7 +1639,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionary"
                         }
                     }
@@ -1751,7 +1677,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.SysDictionarySearch"
                         }
                     }
@@ -1790,7 +1715,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionary"
                         }
                     }
@@ -1829,7 +1753,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionaryDetail"
                         }
                     }
@@ -1868,7 +1791,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionaryDetail"
                         }
                     }
@@ -1907,7 +1829,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionaryDetail"
                         }
                     }
@@ -1946,7 +1867,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.SysDictionaryDetailSearch"
                         }
                     }
@@ -1985,7 +1905,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysDictionaryDetail"
                         }
                     }
@@ -2024,7 +1943,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysOperationRecord"
                         }
                     }
@@ -2063,7 +1981,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysOperationRecord"
                         }
                     }
@@ -2102,7 +2019,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.IdsReq"
                         }
                     }
@@ -2141,7 +2057,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysOperationRecord"
                         }
                     }
@@ -2180,7 +2095,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.SysOperationRecordSearch"
                         }
                     }
@@ -2195,45 +2109,6 @@
                 }
             }
         },
-        "/sysOperationRecord/updateSysOperationRecord": {
-            "put": {
-                "security": [
-                    {
-                        "ApiKeyAuth": []
-                    }
-                ],
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "SysOperationRecord"
-                ],
-                "summary": "更新SysOperationRecord",
-                "parameters": [
-                    {
-                        "description": "更新SysOperationRecord",
-                        "name": "data",
-                        "in": "body",
-                        "required": true,
-                        "schema": {
-                            "type": "object",
-                            "$ref": "#/definitions/model.SysOperationRecord"
-                        }
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}",
-                        "schema": {
-                            "type": "string"
-                        }
-                    }
-                }
-            }
-        },
         "/system/ReloadSystem": {
             "post": {
                 "security": [
@@ -2255,7 +2130,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.System"
                         }
                     }
@@ -2315,7 +2189,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.System"
                         }
                     }
@@ -2351,7 +2224,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.ChangePasswordStruct"
                         }
                     }
@@ -2390,7 +2262,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.GetById"
                         }
                     }
@@ -2429,7 +2300,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.PageInfo"
                         }
                     }
@@ -2468,7 +2338,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/request.SetUserAuth"
                         }
                     }
@@ -2483,49 +2352,6 @@
                 }
             }
         },
-        "/user/uploadHeaderImg": {
-            "post": {
-                "security": [
-                    {
-                        "ApiKeyAuth": []
-                    }
-                ],
-                "consumes": [
-                    "multipart/form-data"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "SysUser"
-                ],
-                "summary": "用户上传头像",
-                "parameters": [
-                    {
-                        "type": "file",
-                        "description": "用户上传头像",
-                        "name": "headerImg",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "用户上传头像",
-                        "name": "username",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}",
-                        "schema": {
-                            "type": "string"
-                        }
-                    }
-                }
-            }
-        },
         "/workflow/createWorkFlow": {
             "post": {
                 "produces": [
@@ -2542,7 +2368,6 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "type": "object",
                             "$ref": "#/definitions/model.SysWorkflow"
                         }
                     }
@@ -2589,6 +2414,20 @@
                 }
             }
         },
+        "config.LocalUpload": {
+            "type": "object",
+            "properties": {
+                "avatarPath": {
+                    "type": "string"
+                },
+                "filePath": {
+                    "type": "string"
+                },
+                "local": {
+                    "type": "boolean"
+                }
+            }
+        },
         "config.Log": {
             "type": "object",
             "properties": {
@@ -2681,6 +2520,10 @@
                     "type": "object",
                     "$ref": "#/definitions/config.JWT"
                 },
+                "localUpload": {
+                    "type": "object",
+                    "$ref": "#/definitions/config.LocalUpload"
+                },
                 "log": {
                     "type": "object",
                     "$ref": "#/definitions/config.Log"
@@ -2963,7 +2806,7 @@
                 "key": {
                     "type": "string"
                 },
-                "sysBaseMenuId": {
+                "sysBaseMenuID": {
                     "type": "integer"
                 },
                 "type": {

+ 13 - 130
server/docs/swagger.yaml

@@ -19,6 +19,15 @@ definitions:
       signingKey:
         type: string
     type: object
+  config.LocalUpload:
+    properties:
+      avatarPath:
+        type: string
+      filePath:
+        type: string
+      local:
+        type: boolean
+    type: object
   config.Log:
     properties:
       file:
@@ -80,6 +89,9 @@ definitions:
       jwt:
         $ref: '#/definitions/config.JWT'
         type: object
+      localUpload:
+        $ref: '#/definitions/config.LocalUpload'
+        type: object
       log:
         $ref: '#/definitions/config.Log'
         type: object
@@ -267,7 +279,7 @@ definitions:
     properties:
       key:
         type: string
-      sysBaseMenuId:
+      sysBaseMenuID:
         type: integer
       type:
         type: string
@@ -575,7 +587,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysApi'
-          type: object
       produces:
       - application/json
       responses:
@@ -599,7 +610,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysApi'
-          type: object
       produces:
       - application/json
       responses:
@@ -639,7 +649,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.GetById'
-          type: object
       produces:
       - application/json
       responses:
@@ -663,7 +672,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.SearchApiParams'
-          type: object
       produces:
       - application/json
       responses:
@@ -687,7 +695,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysApi'
-          type: object
       produces:
       - application/json
       responses:
@@ -711,7 +718,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/response.SysAuthorityCopyResponse'
-          type: object
       produces:
       - application/json
       responses:
@@ -735,7 +741,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysAuthority'
-          type: object
       produces:
       - application/json
       responses:
@@ -759,7 +764,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysAuthority'
-          type: object
       produces:
       - application/json
       responses:
@@ -783,7 +787,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.PageInfo'
-          type: object
       produces:
       - application/json
       responses:
@@ -807,7 +810,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysAuthority'
-          type: object
       produces:
       - application/json
       responses:
@@ -831,7 +833,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysAuthority'
-          type: object
       produces:
       - application/json
       responses:
@@ -855,7 +856,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.AutoCodeStruct'
-          type: object
       produces:
       - application/json
       responses:
@@ -909,7 +909,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.RegisterAndLoginStruct'
-          type: object
       produces:
       - application/json
       responses:
@@ -929,7 +928,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysUser'
-          type: object
       produces:
       - application/json
       responses:
@@ -940,30 +938,6 @@ paths:
       summary: 用户注册账号
       tags:
       - Base
-  /casbin/CasbinTest:
-    get:
-      consumes:
-      - application/json
-      parameters:
-      - description: 获取权限列表
-        in: body
-        name: data
-        required: true
-        schema:
-          $ref: '#/definitions/request.CasbinInReceive'
-          type: object
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: '{"success":true,"data":{},"msg":"获取成功"}'
-          schema:
-            type: string
-      security:
-      - ApiKeyAuth: []
-      summary: casb RBAC RESTFUL测试路由
-      tags:
-      - casbin
   /casbin/UpdateCasbin:
     post:
       consumes:
@@ -975,7 +949,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.CasbinInReceive'
-          type: object
       produces:
       - application/json
       responses:
@@ -999,7 +972,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.CasbinInReceive'
-          type: object
       produces:
       - application/json
       responses:
@@ -1023,7 +995,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.ExaCustomer'
-          type: object
       produces:
       - application/json
       responses:
@@ -1046,7 +1017,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.ExaCustomer'
-          type: object
       produces:
       - application/json
       responses:
@@ -1069,7 +1039,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.ExaCustomer'
-          type: object
       produces:
       - application/json
       responses:
@@ -1092,7 +1061,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.ExaCustomer'
-          type: object
       produces:
       - application/json
       responses:
@@ -1116,7 +1084,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.PageInfo'
-          type: object
       produces:
       - application/json
       responses:
@@ -1160,7 +1127,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.ExaFileUploadAndDownload'
-          type: object
       produces:
       - application/json
       responses:
@@ -1206,7 +1172,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.PageInfo'
-          type: object
       produces:
       - application/json
       responses:
@@ -1290,7 +1255,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.AuthorityIdInfo'
-          type: object
       produces:
       - application/json
       responses:
@@ -1314,7 +1278,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysBaseMenu'
-          type: object
       produces:
       - application/json
       responses:
@@ -1338,7 +1301,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.AddMenuAuthorityInfo'
-          type: object
       produces:
       - application/json
       responses:
@@ -1362,7 +1324,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.GetById'
-          type: object
       produces:
       - application/json
       responses:
@@ -1386,7 +1347,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.GetById'
-          type: object
       produces:
       - application/json
       responses:
@@ -1408,7 +1368,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.RegisterAndLoginStruct'
-          type: object
       produces:
       - application/json
       responses:
@@ -1430,7 +1389,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.RegisterAndLoginStruct'
-          type: object
       produces:
       - application/json
       responses:
@@ -1454,7 +1412,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.PageInfo'
-          type: object
       produces:
       - application/json
       responses:
@@ -1478,7 +1435,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysBaseMenu'
-          type: object
       produces:
       - application/json
       responses:
@@ -1559,7 +1515,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysDictionary'
-          type: object
       produces:
       - application/json
       responses:
@@ -1583,7 +1538,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysDictionary'
-          type: object
       produces:
       - application/json
       responses:
@@ -1607,7 +1561,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysDictionary'
-          type: object
       produces:
       - application/json
       responses:
@@ -1631,7 +1584,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.SysDictionarySearch'
-          type: object
       produces:
       - application/json
       responses:
@@ -1655,7 +1607,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysDictionary'
-          type: object
       produces:
       - application/json
       responses:
@@ -1679,7 +1630,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysDictionaryDetail'
-          type: object
       produces:
       - application/json
       responses:
@@ -1703,7 +1653,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysDictionaryDetail'
-          type: object
       produces:
       - application/json
       responses:
@@ -1727,7 +1676,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysDictionaryDetail'
-          type: object
       produces:
       - application/json
       responses:
@@ -1751,7 +1699,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.SysDictionaryDetailSearch'
-          type: object
       produces:
       - application/json
       responses:
@@ -1775,7 +1722,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysDictionaryDetail'
-          type: object
       produces:
       - application/json
       responses:
@@ -1799,7 +1745,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysOperationRecord'
-          type: object
       produces:
       - application/json
       responses:
@@ -1823,7 +1768,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysOperationRecord'
-          type: object
       produces:
       - application/json
       responses:
@@ -1847,7 +1791,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.IdsReq'
-          type: object
       produces:
       - application/json
       responses:
@@ -1871,7 +1814,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysOperationRecord'
-          type: object
       produces:
       - application/json
       responses:
@@ -1895,7 +1837,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.SysOperationRecordSearch'
-          type: object
       produces:
       - application/json
       responses:
@@ -1908,30 +1849,6 @@ paths:
       summary: 分页获取SysOperationRecord列表
       tags:
       - SysOperationRecord
-  /sysOperationRecord/updateSysOperationRecord:
-    put:
-      consumes:
-      - application/json
-      parameters:
-      - description: 更新SysOperationRecord
-        in: body
-        name: data
-        required: true
-        schema:
-          $ref: '#/definitions/model.SysOperationRecord'
-          type: object
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: '{"success":true,"data":{},"msg":"更新成功"}'
-          schema:
-            type: string
-      security:
-      - ApiKeyAuth: []
-      summary: 更新SysOperationRecord
-      tags:
-      - SysOperationRecord
   /system/ReloadSystem:
     post:
       parameters:
@@ -1941,7 +1858,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.System'
-          type: object
       produces:
       - application/json
       responses:
@@ -1977,7 +1893,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.System'
-          type: object
       produces:
       - application/json
       responses:
@@ -1999,7 +1914,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.ChangePasswordStruct'
-          type: object
       produces:
       - application/json
       responses:
@@ -2023,7 +1937,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.GetById'
-          type: object
       produces:
       - application/json
       responses:
@@ -2047,7 +1960,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.PageInfo'
-          type: object
       produces:
       - application/json
       responses:
@@ -2071,7 +1983,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/request.SetUserAuth'
-          type: object
       produces:
       - application/json
       responses:
@@ -2084,33 +1995,6 @@ paths:
       summary: 设置用户权限
       tags:
       - SysUser
-  /user/uploadHeaderImg:
-    post:
-      consumes:
-      - multipart/form-data
-      parameters:
-      - description: 用户上传头像
-        in: formData
-        name: headerImg
-        required: true
-        type: file
-      - description: 用户上传头像
-        in: formData
-        name: username
-        required: true
-        type: string
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: '{"success":true,"data":{},"msg":"上传成功"}'
-          schema:
-            type: string
-      security:
-      - ApiKeyAuth: []
-      summary: 用户上传头像
-      tags:
-      - SysUser
   /workflow/createWorkFlow:
     post:
       parameters:
@@ -2120,7 +2004,6 @@ paths:
         required: true
         schema:
           $ref: '#/definitions/model.SysWorkflow'
-          type: object
       produces:
       - application/json
       responses:

+ 2 - 1
server/go.mod

@@ -39,9 +39,10 @@ require (
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/spf13/viper v1.6.2
 	github.com/swaggo/gin-swagger v1.2.0
-	github.com/swaggo/swag v1.6.5
+	github.com/swaggo/swag v1.6.7
 	github.com/tebeka/strftime v0.1.3 // indirect
 	github.com/unrolled/secure v1.0.7
+	github.com/urfave/cli v1.22.2 // indirect
 	golang.org/x/net v0.0.0-20200320220750-118fecf932d8 // indirect
 	golang.org/x/sys v0.0.0-20200610111108-226ff32320da // indirect
 	golang.org/x/tools v0.0.0-20200324003944-a576cf524670 // indirect

+ 0 - 1
server/model/sys_api.go

@@ -36,7 +36,6 @@ func SysApiData() []SysApi {
 		{gorm.Model{ID: 19, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/menu/updateBaseMenu", "更新菜单", "menu", "POST"},
 		{gorm.Model{ID: 20, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/menu/getBaseMenuById", "根据id获取菜单", "menu", "POST"},
 		{gorm.Model{ID: 21, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/user/changePassword", "修改密码", "user", "POST"},
-		{gorm.Model{ID: 22, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/user/uploadHeaderImg", "上传头像", "user", "POST"},
 		{gorm.Model{ID: 23, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/user/getUserList", "获取用户列表", "user", "POST"},
 		{gorm.Model{ID: 24, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/user/setUserAuthority", "修改用户角色", "user", "POST"},
 		{gorm.Model{ID: 25, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/fileUploadAndDownload/upload", "文件上传示例", "fileUploadAndDownload", "POST"},

+ 0 - 3
server/model/sys_casbin.go

@@ -33,7 +33,6 @@ func CasbinModelData() []CasbinModel {
 		{"p", "888", "/menu/updateBaseMenu", "POST"},
 		{"p", "888", "/menu/getBaseMenuById", "POST"},
 		{"p", "888", "/user/changePassword", "POST"},
-		{"p", "888", "/user/uploadHeaderImg", "POST"},
 		{"p", "888", "/user/getUserList", "POST"},
 		{"p", "888", "/user/setUserAuthority", "POST"},
 		{"p", "888", "/user/deleteUser", "DELETE"},
@@ -93,7 +92,6 @@ func CasbinModelData() []CasbinModel {
 		{"p", "8881", "/menu/updateBaseMenu", "POST"},
 		{"p", "8881", "/menu/getBaseMenuById", "POST"},
 		{"p", "8881", "/user/changePassword", "POST"},
-		{"p", "8881", "/user/uploadHeaderImg", "POST"},
 		{"p", "8881", "/user/getUserList", "POST"},
 		{"p", "8881", "/user/setUserAuthority", "POST"},
 		{"p", "8881", "/fileUploadAndDownload/upload", "POST"},
@@ -131,7 +129,6 @@ func CasbinModelData() []CasbinModel {
 		{"p", "9528", "/menu/updateBaseMenu", "POST"},
 		{"p", "9528", "/menu/getBaseMenuById", "POST"},
 		{"p", "9528", "/user/changePassword", "POST"},
-		{"p", "9528", "/user/uploadHeaderImg", "POST"},
 		{"p", "9528", "/user/getUserList", "POST"},
 		{"p", "9528", "/user/setUserAuthority", "POST"},
 		{"p", "9528", "/fileUploadAndDownload/upload", "POST"},

+ 1 - 1
server/router/sys_user.go

@@ -13,9 +13,9 @@ func InitUserRouter(Router *gin.RouterGroup) {
 		Use(middleware.OperationRecord())
 	{
 		UserRouter.POST("changePassword", v1.ChangePassword)     // 修改密码
-		UserRouter.POST("uploadHeaderImg", v1.UploadHeaderImg)   // 上传头像
 		UserRouter.POST("getUserList", v1.GetUserList)           // 分页获取用户列表
 		UserRouter.POST("setUserAuthority", v1.SetUserAuthority) // 设置用户权限
 		UserRouter.DELETE("deleteUser", v1.DeleteUser)           // 删除用户
+		UserRouter.PUT("setUserInfo", v1.SetUserInfo)            // 设置用户信息
 	}
 }

+ 7 - 9
server/service/sys_user.go

@@ -19,7 +19,7 @@ import (
 
 func Register(u model.SysUser) (err error, userInter model.SysUser) {
 	var user model.SysUser
-	if !errors.Is(global.GVA_DB.Where("username = ?", u.Username).First(&user).Error, gorm.ErrRecordNotFound){ // 判断用户名是否注册
+	if !errors.Is(global.GVA_DB.Where("username = ?", u.Username).First(&user).Error, gorm.ErrRecordNotFound) { // 判断用户名是否注册
 		return errors.New("用户名已注册"), userInter
 	}
 	// 否则 附加uuid 密码md5简单加密 注册
@@ -101,16 +101,14 @@ func DeleteUser(id float64) (err error) {
 	return err
 }
 
-// @title    UploadHeaderImg
-// @description   upload avatar, 用户头像上传更新地址
+// @title    SetUserInfo
+// @description   set the authority of a certain user, 设置用户信息
 // @auth                     (2020/04/05  20:22)
 // @param     uuid            UUID
-// @param     filePath        string
+// @param     authorityId     string
 // @return    err             error
-// @return    userInter       *SysUser
 
-func UploadHeaderImg(uuid uuid.UUID, filePath string) (err error, userInter *model.SysUser) {
-	var user model.SysUser
-	err = global.GVA_DB.Where("uuid = ?", uuid).First(&user).Update("header_img", filePath).First(&user).Error
-	return err, &user
+func SetUserInfo(reqUser model.SysUser) (err error, user model.SysUser) {
+	err = global.GVA_DB.Updates(&reqUser).Error
+	return err, reqUser
 }

Some files were not shown because too many files changed in this diff