package main
import (
"fmt"
"html/template"
"io"
"net/http"
"path/filepath"
)
func log_account(resp http.ResponseWriter, req *http.Request) {
sess, ok := checkLogin(resp, req)
if !ok {
return
}
//视图输出
files := []string{
filepath.Join(Cfg.TmplDir, "log", "account.tmpl"),
filepath.Join(Cfg.TmplDir, "header.tmpl"),
filepath.Join(Cfg.TmplDir, "navbar.tmpl"),
}
tmpl, err := template.New("account.tmpl").Funcs(TmplFuncMap).ParseFiles(files...)
if err != nil {
io.WriteString(resp, fmt.Sprintf("Error: %s\n", err.Error()))
} else {
tmpl.Execute(resp, struct {
Sess *Session
Req *http.Request
Title string
}{
sess,
req,
"用户操作日志",
})
}
}
func log_account_list(resp http.ResponseWriter, req *http.Request) {
_, ok := checkLogin(resp, req)
if !ok {
return
}
}