Skip to content

Commit

Permalink
修复任务列表查看权限的bug
Browse files Browse the repository at this point in the history
任务分组权限无法控制列表显示
  • Loading branch information
george518 committed Dec 27, 2018
1 parent 2d68c12 commit cce046b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions controllers/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"fmt"

"github.com/astaxie/beego"
"github.com/george518/PPGo_Job/crons"
"github.com/george518/PPGo_Job/jobs"
"github.com/george518/PPGo_Job/models"
"github.com/george518/PPGo_Job/crons"
)

type TaskController struct {
Expand Down Expand Up @@ -247,7 +247,7 @@ func (self *TaskController) AjaxSave() {
if !isBan {
self.ajaxMsg("含有禁止命令:"+msg, MSG_ERR)
}

if _, err := cron.Parse(task.CronSpec); err != nil {
self.ajaxMsg("cron表达式无效", MSG_ERR)
}
Expand Down Expand Up @@ -498,7 +498,7 @@ func (self *TaskController) Table() {
limit = 30
}

groupId, _ := self.GetInt("group_id", -1)
groupId, _ := self.GetInt("group_id", 0)

//0-全部,-1如果存在,n,如果不存在,0

Expand All @@ -515,7 +515,6 @@ func (self *TaskController) Table() {
//}

status, _ := self.GetInt("status")

taskName := strings.TrimSpace(self.GetString("task_name"))

StatusText := []string{
Expand All @@ -542,7 +541,6 @@ func (self *TaskController) Table() {
if groupId == 0 {
if self.userId != 1 {
groups := strings.Split(self.taskGroups, ",")

groupsIds := make([]int, 0)
for _, v := range groups {
id, _ := strconv.Atoi(v)
Expand All @@ -557,8 +555,6 @@ func (self *TaskController) Table() {
filters = append(filters, "task_name__icontains", taskName)
}

//fmt.Println(filters, "----------", taskName)

result, count := models.TaskGetList(page, self.pageSize, filters...)
list := make([]map[string]interface{}, len(result))

Expand Down

0 comments on commit cce046b

Please sign in to comment.