feat: 改为Post取参数
This commit is contained in:
parent
f57ac365b4
commit
c9c7834291
2
main.go
2
main.go
@ -18,7 +18,7 @@ func main() {
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
uid, _ := uuid.NewV4()
|
||||
uuid := "html2pic-" + uid.String()
|
||||
url, html := r.FormValue("url"), r.FormValue("html")
|
||||
url, html := r.PostFormValue("url"), r.PostFormValue("html")
|
||||
tempFile := *tempDir + "/" + uuid + ".html"
|
||||
if html != "" {
|
||||
ioutil.WriteFile(tempFile, []byte("<!DOCTYPE html><html lang=\"zh\"><head><meta charset=\"UTF-8\"></head><body style=\"margin: 0;padding: 0;\">"+html+"</body></html>"), os.ModeAppend)
|
||||
|
Loading…
Reference in New Issue
Block a user