组织数据读取权限完成

This commit is contained in:
XM-GO
2023-09-15 15:13:39 +08:00
parent b5ee2a54b9
commit 6630ebdb02
37 changed files with 717 additions and 59 deletions

View File

@@ -20,8 +20,5 @@ type LogLogin struct {
Params string `json:"params" gorm:"-"`
Remark string `json:"remark" gorm:"type:varchar(255);"` //备注
Msg string `json:"msg" gorm:"type:varchar(255);"`
OrgId int64 `json:"orgId" gorm:"type:int;"`
model.BaseModel
RoleId int64 `gorm:"-"` // 角色数据权限
}

View File

@@ -6,7 +6,6 @@ import (
type LogOper struct {
OperId int64 `json:"operId" gorm:"primary_key;AUTO_INCREMENT"` //主键
OrgId int64 `json:"orgId" gorm:"type:int;comment:机构ID"`
Title string `json:"title" gorm:"type:varchar(128);comment:操作的模块"`
BusinessType string `json:"businessType" gorm:"type:varchar(1);comment:0其它 1新增 2修改 3删除"`
Method string `json:"method" gorm:"type:varchar(255);comment:请求方法"`
@@ -17,6 +16,4 @@ type LogOper struct {
OperParam string `json:"operParam" gorm:"type:varchar(255);comment:请求参数"` //
Status string `json:"status" gorm:"type:varchar(1);comment:0=正常,1=异常"`
model.BaseModel
RoleId int64 `gorm:"-"` // 角色数据权限
}

View File

@@ -26,8 +26,6 @@ var LogLoginModelDao LogLoginModel = &logLoginModelImpl{
}
func (m *logLoginModelImpl) Insert(data entity.LogLogin) *entity.LogLogin {
data.CreateBy = "0"
data.UpdateBy = "0"
global.Db.Table(m.table).Create(&data)
return &data
}
@@ -51,9 +49,6 @@ func (m *logLoginModelImpl) FindListPage(page, pageSize int, data entity.LogLogi
if data.LoginLocation != "" {
db = db.Where("login_location like ?", "%"+data.LoginLocation+"%")
}
if data.Username != "" {
db = db.Where("username like ?", "%"+data.Username+"%")
}
err := db.Where("delete_time IS NULL").Count(&total).Error
err = db.Order("info_id desc").Limit(pageSize).Offset(offset).Find(&list).Error