修改列表和登录

登录设置默认一天
列表页各行换色并点击换色
修改返回的一些bug
This commit is contained in:
郝大全
2017-07-18 16:56:22 +08:00
parent e982acb181
commit 980f49b486
8 changed files with 28 additions and 11 deletions

View File

@@ -169,7 +169,7 @@ func (this *MainController) Login() {
if remember == "yes" {
this.Ctx.SetCookie("auth", strconv.Itoa(user.Id)+"|"+authkey, 7*86400)
} else {
this.Ctx.SetCookie("auth", strconv.Itoa(user.Id)+"|"+authkey)
this.Ctx.SetCookie("auth", strconv.Itoa(user.Id)+"|"+authkey,86400)
}
this.redirect(beego.URLFor("TaskController.List"))
}

View File

@@ -29,6 +29,13 @@ func (this *TaskController) List() {
page = 1
}
groupId, _ := this.GetInt("groupid")
if groupId>0 {
this.Ctx.SetCookie("groupid", strconv.Itoa(groupId)+"|job")
}else {
arr := strings.Split(this.Ctx.GetCookie("groupid"), "|")
groupId,_= strconv.Atoi(arr[0])
}
filters := make([]interface{}, 0)
if groupId > 0 {
filters = append(filters, "group_id", groupId)
@@ -51,6 +58,7 @@ func (this *TaskController) List() {
row["description"] = v.Description
row["group_id"] = v.GroupId
row["group_name"] = groups_map[v.GroupId]
row["is_odd"] = k%2
e := jobs.GetEntryById(v.Id)
if e != nil {