Commit ec8d3984 authored by chenhan wang's avatar chenhan wang
Browse files

fix:fix the route of test

parent b1dc3c45
......@@ -103,15 +103,13 @@ 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
switch stat {
case 0:
return response.SendResponse(c, http.StatusForbidden, cookieMsg+"error:密码错误", "") //403
return response.SendResponse(c, http.StatusForbidden, cookieMsg+"error:密码错误", info.Url) //403
case 1: // 鉴权通过
Data := new(Msg)
Data.Content = model.Find1(info.Url, "content") // 文件内容
......
......@@ -31,8 +31,8 @@ func addRoutes() {
* 状态码: 403:密码错误; 410:内容过期; 200:访问成功; 401:请进行身份验证(输密码)
*/
api.POST("/file/download", controller.Down)
api.POST("text/upload", controller.TextUp)
api.POST("text/download", controller.Down)
api.POST("/text/upload", controller.TextUp)
api.POST("/text/download", controller.Down)
}
func ApiAssign() {
......
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