You've already forked go-url-shortener
update assets use
This commit is contained in:
@@ -11,11 +11,11 @@ import (
|
||||
"github.com/zhang2092/go-url-shortener/internal/pkg/cookie"
|
||||
pwd "github.com/zhang2092/go-url-shortener/internal/pkg/password"
|
||||
"github.com/zhang2092/go-url-shortener/internal/templ"
|
||||
"github.com/zhang2092/go-url-shortener/internal/templ/model"
|
||||
"github.com/zhang2092/go-url-shortener/internal/templ/models"
|
||||
)
|
||||
|
||||
func RegisterView(w http.ResponseWriter, r *http.Request) {
|
||||
templ.Register(w, r, &model.RegisterPageData{})
|
||||
templ.Register(w, r, &models.RegisterPageData{})
|
||||
}
|
||||
|
||||
func Register(store db.Store) http.HandlerFunc {
|
||||
@@ -67,7 +67,7 @@ func Register(store db.Store) http.HandlerFunc {
|
||||
}
|
||||
|
||||
func LoginView(w http.ResponseWriter, r *http.Request) {
|
||||
templ.Login(w, r, &model.LoginPageData{})
|
||||
templ.Login(w, r, &models.LoginPageData{})
|
||||
}
|
||||
|
||||
func Login(store db.Store) http.HandlerFunc {
|
||||
@@ -75,7 +75,7 @@ func Login(store db.Store) http.HandlerFunc {
|
||||
defer r.Body.Close()
|
||||
|
||||
if err := r.ParseForm(); err != nil {
|
||||
templ.Login(w, r, &model.LoginPageData{Summary: "请求网络错误,请刷新重试"})
|
||||
templ.Login(w, r, &models.LoginPageData{Summary: "请求网络错误,请刷新重试"})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -128,9 +128,9 @@ func Logout() http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
func viladatorRegister(email, username, password string) (*model.RegisterPageData, bool) {
|
||||
func viladatorRegister(email, username, password string) (*models.RegisterPageData, bool) {
|
||||
ok := true
|
||||
resp := &model.RegisterPageData{
|
||||
resp := &models.RegisterPageData{
|
||||
Email: email,
|
||||
Username: username,
|
||||
Password: password,
|
||||
@@ -152,9 +152,9 @@ func viladatorRegister(email, username, password string) (*model.RegisterPageDat
|
||||
return resp, ok
|
||||
}
|
||||
|
||||
func viladatorLogin(email, password string) (*model.LoginPageData, bool) {
|
||||
func viladatorLogin(email, password string) (*models.LoginPageData, bool) {
|
||||
ok := true
|
||||
errs := &model.LoginPageData{
|
||||
errs := &models.LoginPageData{
|
||||
Email: email,
|
||||
Password: password,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user