From 1563f1dc157d70d82a1db70cd3fa88a8a68fd369 Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Mon, 1 Jun 2020 18:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BB=E5=8F=96=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/html/chat.html | 21 +++++++++++++++ static/html/login.html | 60 ++++++++++++++++++++++++++++-------------- tools/imap.go | 12 ++++----- 3 files changed, 66 insertions(+), 27 deletions(-) create mode 100644 static/html/chat.html diff --git a/static/html/chat.html b/static/html/chat.html new file mode 100644 index 0000000..1484000 --- /dev/null +++ b/static/html/chat.html @@ -0,0 +1,21 @@ + + + + + + + 聊天界面 + + + + + + + +
+ +
+ + \ No newline at end of file diff --git a/static/html/login.html b/static/html/login.html index b399bb3..b5a1622 100644 --- a/static/html/login.html +++ b/static/html/login.html @@ -4,7 +4,7 @@ - GO-IMAP网页版邮箱imap工具登录页 + GO-FLY登录页 @@ -30,11 +30,11 @@ padding-bottom: 40px; background-color: #f5f5f5; } - .form-signin { + .signin { width: 100%; max-width: 400px; padding: 20px; - margin: auto; + margin:0 auto; background: #fff; -webkit-box-shadow: 0 1px 2px 0 rgba(101,129,156,.08); box-shadow: 0 1px 2px 0 rgba(101,129,156,.08); @@ -43,24 +43,42 @@ -
+
@@ -69,6 +87,8 @@ new Vue({ el: '#app', data: { + window:window, + activeName:"first", loading:false, ruleForm:{ server:'', diff --git a/tools/imap.go b/tools/imap.go index a35ec1e..e83597c 100644 --- a/tools/imap.go +++ b/tools/imap.go @@ -166,7 +166,7 @@ func GetMessage(server string, email string, password string, folder string, id seqSet.AddNum(id) // Get the whole message body - var section imap.BodySectionName + section:= &imap.BodySectionName{} items := []imap.FetchItem{section.FetchItem()} messages := make(chan *imap.Message, 1) @@ -181,23 +181,21 @@ func GetMessage(server string, email string, password string, folder string, id log.Fatal("Server didn't returned message") } - r := msg.GetBody(§ion) + r := msg.GetBody(section) + if r == nil { log.Fatal("Server didn't returned message body") } var mailitem = new(MailItem) // Create a new mail reader - mr, err := mail.CreateReader(r) + mr, _ := mail.CreateReader(r) - if err != nil { - return mailitem - } // Print some info about the message header := mr.Header date, _ := header.Date() - log.Println("Date:", date) + mailitem.Date = date.String() var f string