This commit is contained in:
2023-03-08 20:28:46 +08:00
parent cc6a22aa60
commit 017d6afd95
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ import (
func Article(c *gin.Context) { func Article(c *gin.Context) {
id := c.Param("id") id := c.Param("id")
id = strings.Replace(id, "-", "//", -1) id = strings.Replace(id, "-", "/", -1)
articleBasePath := "./article" articleBasePath := "./article"
+2
View File
@@ -28,7 +28,9 @@ func Index(c *gin.Context) {
filePath := path filePath := path
uri := filePath[:len(filePath)-len(filepath.Ext(filePath))] uri := filePath[:len(filePath)-len(filepath.Ext(filePath))]
uri = strings.Replace(uri, "article\\", "", -1) uri = strings.Replace(uri, "article\\", "", -1)
uri = strings.Replace(uri, "article/", "", -1)
uri = strings.Replace(uri, "\\", "-", -1) uri = strings.Replace(uri, "\\", "-", -1)
uri = strings.Replace(uri, "/", "-", -1)
list = append(list, uri) list = append(list, uri)
return nil return nil