diff --git a/server.go b/server.go index 0ea2d60..df435e6 100644 --- a/server.go +++ b/server.go @@ -126,6 +126,13 @@ func view(w http.ResponseWriter, r *http.Request) { }else{ fid="INBOX" } + var id uint32 + if len(values["id"])!=0{ + i,_:=strconv.Atoi(values["id"][0]) + id=uint32(i) + }else{ + id=0 + } auth := getCookie(r, "auth") authStrings := strings.Split(auth, "|") @@ -138,6 +145,15 @@ func view(w http.ResponseWriter, r *http.Request) { render.Folders = folders render.Fid = fid }() + wg.Add(1) + go func() { + defer wg.Done() + mail:=tools.GetMessage(authStrings[0], authStrings[1], authStrings[2],fid,id) + render.From=mail.From + render.To=mail.To + render.Subject=mail.Subject + render.Date=mail.Date + }() wg.Wait() tmpl.RenderView(w,render) } diff --git a/tmpl/view.go b/tmpl/view.go index 0ffef8c..57e07bf 100644 --- a/tmpl/view.go +++ b/tmpl/view.go @@ -43,19 +43,27 @@ func RenderView(w http.ResponseWriter,render interface{}){
主题: | -Mark | +日期: | +{{.Date}} |
---|---|---|---|
发件人: | -Mark | +{{.From}} | +|
收件人: | +{{.To}} | +||
主题: | +{{.Subject}} | ||
内容: | Jacob |