소스 검색

Merge remote-tracking branch 'origin/master'

klausY 5 년 전
부모
커밋
d81755b84a

+ 1 - 1
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{})

+ 2 - 2
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{})

+ 2 - 2
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})
 }

+ 2 - 2
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{})

+ 1 - 1
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{})

+ 5 - 5
QMPlusServer/model/sysModel/sys_authority.go

@@ -27,7 +27,7 @@ func (a *SysAuthority) CreateAuthority() (err error, authority *SysAuthority) {
 func (a *SysAuthority) DeleteAuthority() (err error) {
 	err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).Find(&SysUser{}).Error
 	if err != nil {
-		err = qmsql.DEFAULTDB.Where("parentId = ?", a.AuthorityId).Find(&SysAuthority{}).Error
+		err = qmsql.DEFAULTDB.Where("parent_id = ?", a.AuthorityId).Find(&SysAuthority{}).Error
 		if err != nil {
 			err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).First(a).Unscoped().Delete(a).Error
 			new(CasbinModel).clearCasbin(0, a.AuthorityId)
@@ -75,7 +75,7 @@ func (a *SysAuthority) SetDataAuthority() error {
 	return err
 }
 
-func (a *SysAuthority) GetAuthorityInfo() (err error,sa SysAuthority) {
-	err = qmsql.DEFAULTDB.Preload("DataAuthorityId").Where("authority_id = ?",a.AuthorityId).First(&sa).Error
-	return err,sa
-}
+func (a *SysAuthority) GetAuthorityInfo() (err error, sa SysAuthority) {
+	err = qmsql.DEFAULTDB.Preload("DataAuthorityId").Where("authority_id = ?", a.AuthorityId).First(&sa).Error
+	return err, sa
+}

+ 8 - 0
README.md

@@ -10,6 +10,14 @@
 <img src="https://img.shields.io/badge/gorm-1.9.10-red"/>
 </div>
 
+# 开发者(贡献者)列表
+
+|  开发者   | 功能  | 姓名  |
+|  ----  | ----  | ----  |
+| [@piexlmax](https://github.com/piexlmax)  | 项目发起者 | 蒋\*兆 |
+| [@krank666](https://github.com/krank666)  | 前端联合作者 | 尹\* |
+| [@1319612909](https://github.com/1319612909)  | 前端css优化 |  杜\*兰 |
+| [@granty1](https://github.com/granty1)  | 代码积极贡献者 | 印\*林 |
 
 # gin-vue-admin gin+vue开源快速项目模板
     更新代码后如果遇到前端报错请执行 npm i  前端开发会不定期增加新的依赖 请注意更新