Refactoring
This commit is contained in:
parent
b969c9994f
commit
e6b6e50547
2 changed files with 1 additions and 11 deletions
|
@ -76,10 +76,7 @@ func handlePasswd(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
login := checkLogin(w, r)
|
login := checkLogin(w, r)
|
||||||
if login == nil {
|
if login == nil {
|
||||||
data.Common.LoggedIn = false
|
|
||||||
http.Redirect(w, r, "/", http.StatusFound)
|
http.Redirect(w, r, "/", http.StatusFound)
|
||||||
|
|
||||||
// templatePasswd.Execute(w, data)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data.Login.Status = login
|
data.Login.Status = login
|
||||||
|
|
|
@ -14,14 +14,7 @@ func handleUser(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
login := checkLogin(w, r)
|
login := checkLogin(w, r)
|
||||||
if login == nil {
|
if login == nil {
|
||||||
templatePasswd := getTemplate("passwd.html")
|
http.Redirect(w, r, "/", http.StatusFound)
|
||||||
templatePasswd.Execute(w, PasswdTplData{
|
|
||||||
|
|
||||||
Common: NestedCommonTplData{
|
|
||||||
// CanAdmin: login.Common.CanAdmin,
|
|
||||||
CanAdmin: false,
|
|
||||||
LoggedIn: true},
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue