【feature】添加组织数据读取权限

This commit is contained in:
XM-GO
2023-09-14 17:28:52 +08:00
parent bde42bfc9a
commit b5ee2a54b9
84 changed files with 1664 additions and 774 deletions

View File

@@ -39,13 +39,14 @@ func (p *DeviceApi) GetDeviceList(rc *restfulx.ReqCtx) {
data.DeviceType = restfulx.QueryParam(rc, "deviceType")
data.ParentId = restfulx.QueryParam(rc, "parentId")
data.LinkStatus = restfulx.QueryParam(rc, "linkStatus")
// 权限检查
data.RoleId = rc.LoginAccount.RoleId
list, total := p.DeviceApp.FindListPage(pageNum, pageSize, data)
rc.ResData = model.ResultPage{
Total: total,
PageNum: int64(pageNum),
PageSize: int64(pageNum),
PageSize: int64(pageSize),
Data: list,
}
}
@@ -135,6 +136,7 @@ func (p *DeviceApi) InsertDevice(rc *restfulx.ReqCtx) {
biz.IsTrue(!(list != nil && len(*list) > 0), fmt.Sprintf("名称%s已存在设置其他命名", data.Name))
data.Id = kgo.KStr.Uniqid("d_")
data.Owner = rc.LoginAccount.UserName
data.OrgId = rc.LoginAccount.OrganizationId
data.LinkStatus = global.INACTIVE
data.LastAt = time.Now()
p.DeviceApp.Insert(data)