diff --git a/QMPlusServer/controller/api/exa_fileUploadAndDownload.go b/QMPlusServer/controller/api/exa_fileUploadAndDownload.go index 4eaf976a3afc568811952cbe4bee78ff75b6f842..ff50703791f34db86296dd0a0bc30e325f0d99ae 100644 --- a/QMPlusServer/controller/api/exa_fileUploadAndDownload.go +++ b/QMPlusServer/controller/api/exa_fileUploadAndDownload.go @@ -56,7 +56,7 @@ func UploadFile(c *gin.Context) { // @Router /fileUploadAndDownload/deleteFile [post] func DeleteFile(c *gin.Context) { var file dbModel.ExaFileUploadAndDownload - _ = c.ShouldBind(&file) + _ = c.ShouldBindJSON(&file) err, f := file.FindFile() if err != nil { servers.ReportFormat(c, false, fmt.Sprintf("删除失败,%v", err), gin.H{}) diff --git a/QMPlusServer/controller/api/sys_authority.go b/QMPlusServer/controller/api/sys_authority.go index 842727000065f4bea56c33fb3c6be48f19c5a731..d01d0bc0dd23dbabe2447bb0ccec7f4a02844798 100644 --- a/QMPlusServer/controller/api/sys_authority.go +++ b/QMPlusServer/controller/api/sys_authority.go @@ -23,7 +23,7 @@ type CreateAuthorityParams struct { // @Router /authority/createAuthority [post] func CreateAuthority(c *gin.Context) { var auth sysModel.SysAuthority - _ = c.ShouldBind(&auth) + _ = c.ShouldBindJSON(&auth) err, authBack := auth.CreateAuthority() if err != nil { servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{ @@ -94,7 +94,7 @@ func GetAuthorityList(c *gin.Context) { // @Router /authority/setDataAuthority [post] func SetDataAuthority(c *gin.Context) { var auth sysModel.SysAuthority - _ = c.ShouldBind(&auth) + _ = c.ShouldBindJSON(&auth) err := auth.SetDataAuthority() if err != nil { servers.ReportFormat(c, false, fmt.Sprintf("设置关联失败,%v", err), gin.H{}) diff --git a/QMPlusServer/controller/api/sys_casbin.go b/QMPlusServer/controller/api/sys_casbin.go index 7f9b8561a5e9bded45c5f1900a448cf2b53a86f0..e46ee2b48504ecbd98a35cfbbe7b692068cff0dd 100644 --- a/QMPlusServer/controller/api/sys_casbin.go +++ b/QMPlusServer/controller/api/sys_casbin.go @@ -17,7 +17,7 @@ import ( // @Router /casbin/casbinPUpdata [post] func CasbinPUpdata(c *gin.Context) { var cmr sysModel.CasbinInReceive - _ = c.ShouldBind(&cmr) + _ = c.ShouldBindJSON(&cmr) err := new(sysModel.CasbinModel).CasbinPUpdata(cmr.AuthorityId, cmr.CasbinInfos) if err != nil { servers.ReportFormat(c, false, fmt.Sprintf("添加规则失败,%v", err), gin.H{}) @@ -36,7 +36,7 @@ func CasbinPUpdata(c *gin.Context) { // @Router /casbin/getPolicyPathByAuthorityId [post] func GetPolicyPathByAuthorityId(c *gin.Context) { var cmr sysModel.CasbinInReceive - _ = c.ShouldBind(&cmr) + _ = c.ShouldBindJSON(&cmr) paths := new(sysModel.CasbinModel).GetPolicyPathByAuthorityId(cmr.AuthorityId) servers.ReportFormat(c, true, "获取规则成功", gin.H{"paths": paths}) } diff --git a/QMPlusServer/controller/api/sys_system.go b/QMPlusServer/controller/api/sys_system.go index 47f02dccf152fddcbd18120d8982e5bdc0a6ff55..a34ac51f3e9c6a305c0327cd49e8a7f85d8890f8 100644 --- a/QMPlusServer/controller/api/sys_system.go +++ b/QMPlusServer/controller/api/sys_system.go @@ -31,7 +31,7 @@ func GetSystemConfig(c *gin.Context) { // @Router /system/setSystemConfig [post] func SetSystemConfig(c *gin.Context) { var sys sysModel.System - _ = c.ShouldBind(&sys) + _ = c.ShouldBindJSON(&sys) err := sys.SetSystemConfig() if err != nil { servers.ReportFormat(c, false, fmt.Sprintf("设置失败:%v", err), gin.H{}) @@ -49,7 +49,7 @@ func SetSystemConfig(c *gin.Context) { // @Router /system/ReloadSystem [post] func ReloadSystem(c *gin.Context) { var sys sysModel.System - _ = c.ShouldBind(&sys) + _ = c.ShouldBindJSON(&sys) err := sys.SetSystemConfig() if err != nil { servers.ReportFormat(c, false, fmt.Sprintf("设置失败:%v", err), gin.H{}) diff --git a/QMPlusServer/controller/api/sys_workFlow.go b/QMPlusServer/controller/api/sys_workFlow.go index eed4464ac651556035931414f05eca278bea2408..2eab332e0244f42076f912013169489e2d3a0b0b 100644 --- a/QMPlusServer/controller/api/sys_workFlow.go +++ b/QMPlusServer/controller/api/sys_workFlow.go @@ -15,7 +15,7 @@ import ( // @Router /workflow/createWorkFlow [post] func CreateWorkFlow(c *gin.Context) { var wk sysModel.SysWorkflow - _ = c.ShouldBind(&wk) + _ = c.ShouldBindJSON(&wk) err := wk.Create() if err != nil { servers.ReportFormat(c, false, fmt.Sprintf("获取失败:%v", err), gin.H{})