前后端一致修复

This commit is contained in:
linwenxiang committed 2021-02-19 16:50:57 +08:00
1 parent a4f8b11925
commit e04b5559bd
19 files changed
+176 -84

No files matched your search

+4
View File
@@ -74,6 +74,10 @@ func (s *SysFileDirControl) GenerateM() (common.ActiveRecord, error) {
PId: s.PId,
//Sort: s.Sort,
Path: s.Path,
ControlBy: common.ControlBy{
CreateBy: s.CreateBy,
UpdateBy: s.UpdateBy,
},
}, nil
}
+1 -1
View File
@@ -96,7 +96,7 @@ func (s *SysLoginLogById) Bind(ctx *gin.Context) error {
log.Debugf("MsgID[%s] ShouldBindUri error: %s", msgID, err.Error())
return err
}
err = ctx.ShouldBind(s)
err = ctx.ShouldBind(&s.Ids)
if err != nil {
log.Debugf("MsgID[%s] ShouldBind error: %#v", msgID, err.Error())
}
+2 -2
View File
@@ -118,7 +118,7 @@ func (s *SysOperaLogById) Bind(ctx *gin.Context) error {
log.Debugf("MsgID[%s] ShouldBindUri error: %s", msgID, err.Error())
return err
}
err = ctx.ShouldBind(s)
err = ctx.ShouldBind(&s.Ids)
if err != nil {
log.Debugf("MsgID[%s] ShouldBind error: %#v", msgID, err.Error())
}
@@ -126,5 +126,5 @@ func (s *SysOperaLogById) Bind(ctx *gin.Context) error {
}
func (s *SysOperaLogById) SetUpdateBy(id int) {
}
+12 -6
View File
@@ -42,7 +42,7 @@ func (m *SysRoleSearch) Bind(ctx *gin.Context) error {
// SysConfigControl 增、改使用的结构体
type SysRoleControl struct {
RoleId int `uri:"roleId" comment:"角色编码"` // 角色编码
RoleId int `uri:"id" comment:"角色编码"` // 角色编码
RoleName string `form:"roleName" comment:"角色名称"` // 角色名称
Status string `form:"status" comment:"状态"` // 状态
RoleKey string `form:"roleKey" comment:"角色代码"` // 角色代码
@@ -56,15 +56,15 @@ type SysRoleControl struct {
// Bind 映射上下文中的结构体数据
func (s *SysRoleControl) Bind(ctx *gin.Context) error {
msgID := tools.GenerateMsgIDFromContext(ctx)
err := ctx.ShouldBindUri(s)
err := ctx.ShouldBindBodyWith(s, binding.JSON)
if err != nil {
log.Debugf("MsgID[%s] ShouldBind error: %#v", msgID, err.Error())
}
err = ctx.ShouldBindUri(s)
if err != nil {
log.Debugf("MsgID[%s] ShouldBindUri error: %s", msgID, err.Error())
return err
}
err = ctx.ShouldBindBodyWith(s, binding.JSON)
if err != nil {
log.Debugf("MsgID[%s] ShouldBind error: %#v", msgID, err.Error())
}
var jsonStr []byte
jsonStr, err = json.Marshal(s)
if err != nil {
@@ -126,3 +126,9 @@ func (s *SysRoleById) Bind(ctx *gin.Context) error {
func (s *SysRoleById) GenerateM() (*models.SysRole, error) {
return &models.SysRole{}, nil
}
// RoleDataScopeReq 角色数据权限修改
type RoleDataScopeReq struct {
RoleId int `json:"roleId" binding:"required"`
DataScope string `json:"dataScope" binding:"required"`
}