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
ec8d3984
Commit
ec8d3984
authored
Feb 26, 2023
by
chenhan wang
Browse files
fix:fix the route of test
parent
b1dc3c45
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/app/controller/handler.go
View file @
ec8d3984
...
...
@@ -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"
)
// 文件内容
...
...
backend/app/routes.go
View file @
ec8d3984
...
...
@@ -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
()
{
...
...
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