|
@ -5,7 +5,6 @@ import ( |
|
|
"strconv" |
|
|
"strconv" |
|
|
"beeblog/models" |
|
|
"beeblog/models" |
|
|
"beeblog/service" |
|
|
"beeblog/service" |
|
|
"fmt" |
|
|
|
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
type NoteController struct { |
|
|
type NoteController struct { |
|
@ -17,12 +16,10 @@ func (this *NoteController) Save() { |
|
|
title := this.GetString("title") |
|
|
title := this.GetString("title") |
|
|
uid := this.GetSession("userid") |
|
|
uid := this.GetSession("userid") |
|
|
if uid == nil { |
|
|
if uid == nil { |
|
|
fmt.Println("ueseid nil",uid) |
|
|
|
|
|
this.Data["json"] = models.ReurnError(401,"保存失败") |
|
|
this.Data["json"] = models.ReurnError(401,"保存失败") |
|
|
this.ServeJSON() |
|
|
this.ServeJSON() |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
fmt.Println("ueseid:",uid) |
|
|
|
|
|
note := &models.Note{Title: title, Pid: pid, UserId: uid.(int64)} |
|
|
note := &models.Note{Title: title, Pid: pid, UserId: uid.(int64)} |
|
|
err := service.SaveNote(note) |
|
|
err := service.SaveNote(note) |
|
|
if err == nil { |
|
|
if err == nil { |
|
|