Commit 48db6746 authored by chenhan wang's avatar chenhan wang
Browse files

fix:the wrong route path spelling

parent 1898bea4
......@@ -163,7 +163,7 @@ func DBupdate(c echo.Context, info *Upload) (string, string) {
//num,_=strconv.ParseUint(GetSetting("maxDefaultAccess"), 10, 64)
info.MaxView = uint(Settings.MaxDefaultView) // 设置最大默认可访问次数
}
//model.Savetext(info.Content, info.MaxView, info.Passwd, info.Expiration, url, info.Type, info.Name,info.HighLight)
model.Savetext(info.Content, info.MaxView, info.Passwd, info.Expiration, url, info.Type, info.Name, info.HighLight)
return sid, url
}
......
......@@ -104,6 +104,8 @@ func Down(c echo.Context) error {
SetCookie(c, cookie, IdGen(8), 1800, time.Time{})
}
c.SetParamNames("url")
c.SetParamValues(info.Url)
// 鉴权
stat := Autheticate(cookie, info.Url, info.Passwd, time.Now().Add(1800)) // 包含创建链接Createlink
// response
......
......@@ -30,7 +30,7 @@ func addRoutes() {
* 若文件没设密码则不带密码也可访问
* 状态码: 403:密码错误; 410:内容过期; 200:访问成功; 401:请进行身份验证(输密码)
*/
api.POST("/file/downlaod", controller.Down)
api.POST("/file/download", controller.Down)
api.POST("text/upload", controller.TextUp)
api.POST("text/download", controller.Down)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment