新增岗位接口
This commit is contained in:
+19
-2
@@ -79,9 +79,9 @@ func Auth() gin.HandlerFunc {
|
||||
}
|
||||
|
||||
// 获取用户部门数据
|
||||
if adminUser.PostID != 0 {
|
||||
if adminUser.DeptID != 0 {
|
||||
adminDeptDao := dao.AdminDeptDao{}
|
||||
adminDept, err := adminDeptDao.GetAdminDeptById(adminUser.PostID)
|
||||
adminDept, err := adminDeptDao.GetAdminDeptById(adminUser.DeptID)
|
||||
if err != nil || adminDept == nil {
|
||||
responses.FailWithMessage("用户部门数据错误", c)
|
||||
c.Abort()
|
||||
@@ -95,6 +95,23 @@ func Auth() gin.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取用户部门数据
|
||||
if adminUser.PostID != 0 {
|
||||
adminPostDao := dao.AdminPostDao{}
|
||||
adminPost, err := adminPostDao.GetAdminPostById(adminUser.PostID)
|
||||
if err != nil || adminPost == nil {
|
||||
responses.FailWithMessage("用户岗位数据错误", c)
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
if adminPost.PostStatus == 2 {
|
||||
responses.FailWithMessage("您所在的岗位已被删除,请联系管理员修改", c)
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 获取角色菜单id
|
||||
AdminRoleMenuDao := dao.AdminRoleMenuDao{}
|
||||
adminRoleMenu, _ := AdminRoleMenuDao.GetAdminRoleMenuListByRoleId(roleId)
|
||||
|
||||
Reference in New Issue
Block a user