From 47d60ce7406f7c96fe125ddddef6ab86058486a2 Mon Sep 17 00:00:00 2001 From: shaoyongjun Date: Mon, 20 May 2024 10:19:46 +0800 Subject: [PATCH] to:sync --- main.go | 2 ++ static/ai-chat.html | 42 ++++++++++++------------ static/ai-chat1.html | 45 +++++++++++++++----------- static/ai-chat2.html | 77 ++++++++++++++++++++++++++++++++++++++++++++ static/page.go | 14 ++++++++ 5 files changed, 142 insertions(+), 38 deletions(-) create mode 100644 static/ai-chat2.html diff --git a/main.go b/main.go index bbab86e..d104897 100644 --- a/main.go +++ b/main.go @@ -57,6 +57,8 @@ func main() { //登录界面 e.GET("/", static.Login) e.GET("/chat", static.Chat) + e.GET("/chat1", static.Chat1) + e.GET("/chat2", static.Chat2) //user apps.InitUserGroup(e.Group("/v1/user/")) diff --git a/static/ai-chat.html b/static/ai-chat.html index 74c0fc6..e7011b2 100644 --- a/static/ai-chat.html +++ b/static/ai-chat.html @@ -50,14 +50,15 @@ background-color: #d6eaff; color: #000000; } - .gpt{ + + .gpt { margin-bottom: 10px; justify-content: flex-start; background-color: #e5ece7; color: #000; } - .gpt span{ + .gpt span { white-space: pre-line; } @@ -65,7 +66,7 @@ font-weight: bold; } - + @@ -79,7 +80,8 @@ - + + + + + \ No newline at end of file diff --git a/static/page.go b/static/page.go index 5f89441..e071ab3 100644 --- a/static/page.go +++ b/static/page.go @@ -19,6 +19,20 @@ func Chat(c echo.Context) error { return c.Blob(http.StatusOK, "text/html; charset=utf-8", pageMap["ai-chat.html"]) } +func Chat1(c echo.Context) error { + c.Response().Header().Set("Content-Type", "text/html; charset=utf-8") + c.Response().Header().Set("Cache-Control", "max-age=3600") + + return c.Blob(http.StatusOK, "text/html; charset=utf-8", pageMap["ai-chat1.html"]) +} + +func Chat2(c echo.Context) error { + c.Response().Header().Set("Content-Type", "text/html; charset=utf-8") + c.Response().Header().Set("Cache-Control", "max-age=3600") + + return c.Blob(http.StatusOK, "text/html; charset=utf-8", pageMap["ai-chat2.html"]) +} + func InitStaticGroup(g *echo.Group) { g.GET("login.html", func(c echo.Context) error {