diff --git a/api/controller/short_link.go b/api/controller/short_link.go index ae5035d..ddd1c32 100644 --- a/api/controller/short_link.go +++ b/api/controller/short_link.go @@ -46,5 +46,5 @@ func ShortLinkGetHandler(c *gin.Context) { c.String(404, "未找到短链接") return } - c.Redirect(302, "/"+shortLink.Url) + c.Redirect(302, "../"+shortLink.Url) } diff --git a/api/templates/index.html b/api/templates/index.html index 9cb3a4b..8c63925 100644 --- a/api/templates/index.html +++ b/api/templates/index.html @@ -298,7 +298,7 @@ function generateShortLink() { const apiShortLink = document.getElementById("apiShortLink"); - axios.post("/short", { + axios.post("./short", { "url": generateURI() }, { headers: {