This commit is contained in:
赵鑫 2022-09-04 19:49:22 +08:00
parent 35b84697cd
commit b1b2b29689
3 changed files with 13 additions and 13 deletions

View File

@ -4,13 +4,13 @@ html(lang='zh')
meta(charset='UTF-8')
meta(http-equiv='X-UA-Compatible' content='IE=edge')
meta(name='viewport' content='width=device-width, initial-scale=1.0')
link(rel='icon' href='/favicon.ico' type='image/x-icon')
link(rel='stylesheet' href='/style.css')
link(rel='icon' href='/share/favicon.ico' type='image/x-icon')
link(rel='stylesheet' href='/share/style.css')
title #{file.filename} | 文件下载
body
h1 文件下载
p
a(href='/') 返回首页
a(href='/share') 返回首页
form(method='POST')
label 文件
label= file.filename
@ -29,7 +29,7 @@ html(lang='zh')
button(id='download_button' type='submit') 下载
if !file.password
- const mimetype = file.mimetype.split('/')[0]
- const src = '/file/' + file.md5
- const src = '/share/file/' + file.md5
if mimetype == 'image'
p 预览
img(src=src)

View File

@ -4,20 +4,20 @@ html(lang='zh')
meta(charset='UTF-8')
meta(http-equiv='X-UA-Compatible' content='IE=edge')
meta(name='viewport' content='width=device-width, initial-scale=1.0')
link(rel='icon' href='/favicon.ico' type='image/x-icon')
link(rel='stylesheet' href='/style.css')
link(rel='icon' href='/share/favicon.ico' type='image/x-icon')
link(rel='stylesheet' href='/share/style.css')
title 文件分享
body
h1 文件分享
p
a(href='/upload') 我要上传
a(href='upload') 我要上传
ul
if filesharing.length==0
li 暂无文件
else
for file in filesharing
li
a(href=`/download/${file.id}`)= file.filename
a(href=`download/${file.id}`)= file.filename
if file.password
span  ㊙️
span.small  (#{moment(file.createdAt).fromNow()}, #{file.downloads} 次下载)

View File

@ -4,13 +4,13 @@ html(lang='zh')
meta(charset='UTF-8')
meta(http-equiv='X-UA-Compatible' content='IE=edge')
meta(name='viewport' content='width=device-width, initial-scale=1.0')
link(rel='icon' href='/favicon.ico' type='image/x-icon')
link(rel='stylesheet' href='/style.css')
link(rel='icon' href='/share/favicon.ico' type='image/x-icon')
link(rel='stylesheet' href='/share/style.css')
title 文件上传
body
h1 文件上传
p
a(href='/') 返回首页
a(href='/share') 返回首页
if file
section
p
@ -18,9 +18,9 @@ html(lang='zh')
var #{file.filename}  
| 分享成功!
p 链接  
- const url = '/download/' + file.id
- const url = 'download/' + file.id
a(href=url)= url
form(method='POST' action='/upload' enctype='multipart/form-data')
form(method='POST' action='upload' enctype='multipart/form-data')
label(for='file_input') 文件
input(id='file_input' name='file' type='file' required)
label(for='password_input') 密码