fix page:admin/write-post autocomplete tag

This commit is contained in:
henry.chen
2017-11-29 16:17:58 +08:00
parent 61024bfebd
commit fc37d5e093

View File

@@ -3,6 +3,7 @@ package main
import ( import (
"bytes" "bytes"
"encoding/json"
"fmt" "fmt"
"html/template" "html/template"
"net/http" "net/http"
@@ -118,7 +119,8 @@ func HandlePost(c *gin.Context) {
for tag, _ := range Ei.Tags { for tag, _ := range Ei.Tags {
tags = append(tags, T{tag, tag}) tags = append(tags, T{tag, tag})
} }
h["Tags"] = tags str, _ := json.Marshal(tags)
h["Tags"] = string(str)
c.Status(http.StatusOK) c.Status(http.StatusOK)
RenderHTMLBack(c, "admin-post", h) RenderHTMLBack(c, "admin-post", h)
} }