示例#1
0
文件: main.go 项目: pauek/Academio
func hLogout(w http.ResponseWriter, req *http.Request) {
	session := data.GetSession(req)
	log.Printf("%s [%s]", req.URL, session.Id)
	if session != nil {
		session.User = nil
	}
	http.Redirect(w, req, "/", http.StatusSeeOther)
}
示例#2
0
文件: main.go 项目: pauek/Academio
func hRegister(w http.ResponseWriter, req *http.Request) {
	session := data.GetSession(req)
	log.Printf("%s [%s]", req.URL, session.Id)
	if req.URL.Path != "/register" {
		NotFound(w, req)
		return
	}
	NotFound(w, req)
}