🐛 fix link req nil

pull/548/head
微凉 2021-12-08 20:27:39 +08:00
parent 236f9969c0
commit 2bf235a5ac
1 changed files with 7 additions and 2 deletions

View File

@ -71,9 +71,14 @@ func Path(c *gin.Context) {
} }
} }
// 返回真实的链接,非中转
func Link(c *gin.Context) { func Link(c *gin.Context) {
reqV, _ := c.Get("req") var req common.PathReq
req := reqV.(common.PathReq) if err := c.ShouldBind(&req); err != nil {
common.ErrorResp(c, err, 400)
return
}
req.Path = utils.ParsePath(req.Path)
rawPath := req.Path rawPath := req.Path
rawPath = utils.ParsePath(rawPath) rawPath = utils.ParsePath(rawPath)
log.Debugf("link: %s", rawPath) log.Debugf("link: %s", rawPath)