You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
532 B
25 lines
532 B
4 years ago
|
package controller
|
||
|
|
||
|
import (
|
||
|
"github.com/taoshihan1991/imaptool/tools"
|
||
|
"net/http"
|
||
|
)
|
||
|
//首页跳转
|
||
|
func ActionIndex(w http.ResponseWriter, r *http.Request){
|
||
|
if r.URL.RequestURI() == "/favicon.ico" {
|
||
|
return
|
||
|
}
|
||
|
|
||
|
mailServer := tools.GetMailServerFromCookie(r)
|
||
|
if mailServer == nil {
|
||
|
http.Redirect(w, r, "/login", 302)
|
||
|
} else {
|
||
|
res := tools.CheckEmailPassword(mailServer.Server, mailServer.Email, mailServer.Password)
|
||
|
if res {
|
||
|
http.Redirect(w, r, "/main", 302)
|
||
|
} else {
|
||
|
http.Redirect(w, r, "/login", 302)
|
||
|
}
|
||
|
}
|
||
|
}
|