Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenhan wang
pastebin
Commits
48db6746
Commit
48db6746
authored
Feb 14, 2023
by
chenhan wang
Browse files
fix:the wrong route path spelling
parent
1898bea4
Changes
3
Hide whitespace changes
Inline
Side-by-side
backend/app/controller/foo.go
View file @
48db6746
...
...
@@ -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
}
...
...
backend/app/controller/handler.go
View file @
48db6746
...
...
@@ -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
...
...
backend/app/routes.go
View file @
48db6746
...
...
@@ -30,7 +30,7 @@ func addRoutes() {
* 若文件没设密码则不带密码也可访问
* 状态码: 403:密码错误; 410:内容过期; 200:访问成功; 401:请进行身份验证(输密码)
*/
api
.
POST
(
"/file/downl
a
od"
,
controller
.
Down
)
api
.
POST
(
"/file/downlo
a
d"
,
controller
.
Down
)
api
.
POST
(
"text/upload"
,
controller
.
TextUp
)
api
.
POST
(
"text/download"
,
controller
.
Down
)
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment