Răsfoiți Sursa

d06 Передлка на редирект 303 с ПОСТ-запроса

SVI 2 ani în urmă
părinte
comite
a9822df1be
2 a modificat fișierele cu 5 adăugiri și 3 ștergeri
  1. 2 1
      server/serv_web/web_api/web_api.go
  2. 3 2
      web/tmpl/header.tmpl.html

+ 2 - 1
server/serv_web/web_api/web_api.go

@@ -4,6 +4,7 @@ package web_api
 import (
 	"fmt"
 	"log"
+	"net/http"
 	"time"
 
 	"github.com/gofiber/fiber/v2"
@@ -446,5 +447,5 @@ func (сам *ВебАпи) логин(кнт *fiber.Ctx) error {
 		Expires:  time.Now().Add(24 * time.Hour),
 		HTTPOnly: true,
 	})
-	return кнт.Redirect("/gui/list_bot")
+	return кнт.Redirect("/gui/list_bot", http.StatusSeeOther)
 }

+ 3 - 2
web/tmpl/header.tmpl.html

@@ -28,7 +28,8 @@
                 </div>
             </div>
             <div class="counter">
-                <output>0</output>
-                <button _="on click increment the textContent of the previous <output/>">Increment</button> (1)
+                <button _="on click increment the textContent of the next <output/>">Прибавить</button>
+                [<output>0</output>]
+                <button _="on click decrement the textContent of the previous <output/>">убавить</button><br>
             </div>
             {{end}}