From 81c7dc3c3f950ccb11a07be5ee957c4817278dbc Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 21 Feb 2022 10:40:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/search.go | 6 ++++++ templates/explore/search_new.tmpl | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/routers/search.go b/routers/search.go index 2ca2ec541..2c583fd2e 100644 --- a/routers/search.go +++ b/routers/search.go @@ -31,6 +31,12 @@ func InitESClient() { } func Search(ctx *context.Context) { + keyword := strings.Trim(ctx.Query("q"), " ") + ctx.Data["keyword"] = keyword + ctx.HTML(200, "/explore/search_new.tmpl") +} + +func SearchApi(ctx *context.Context) { TableName := ctx.Query("TableName") Key := ctx.Query("Key") Page := ctx.QueryInt("Page") diff --git a/templates/explore/search_new.tmpl b/templates/explore/search_new.tmpl index 375e1b358..a063449e3 100644 --- a/templates/explore/search_new.tmpl +++ b/templates/explore/search_new.tmpl @@ -6,7 +6,7 @@
- +