Skip to content

Commit 0b6ab82

Browse files
committed
拆分 html js css
1 parent f2f042c commit 0b6ab82

File tree

9 files changed

+292
-278
lines changed

9 files changed

+292
-278
lines changed

.github/workflows/releases.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
- run: make
2323

2424
- run: |
25-
rm -rf dist/*
26-
tar -zcvf dist/pastebin-linux-amd64.tar.gz pastebin
25+
mkdir dist
26+
tar -czvf dist/pastebin-linux-amd64.tar.gz pastebin
2727
2828
- uses: softprops/action-gh-release@v2
2929
if: ${{ github.event_name != 'workflow_dispatch' }}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PasteBin
22

3-
支持命令行使用的一个匿名数据分享平台,分享例如一段话,一篇文章,一张图片,一个压缩包,然后将返回的链接发给别人
3+
支持命令行使用的一个匿名数据分享平台,分享例如一段话,一篇文章,一张图片,一个压缩包,然后将链接发给别人
44

55
最大限制 100MB
66

@@ -35,12 +35,12 @@ make
3535

3636
### API
3737

38-
- ___POST /___返回存储了数据内容的链接
39-
- 表单 f = 文件,上传的文件
38+
- ___POST /___上传文件
39+
- 表单 f = 文件
4040
- headers
4141
- type: 1/2/3/4,类型(可选)
4242

43-
- ___GET /{uid}___返回该链接所对应的内容
43+
- ___GET /{uid}___获取数据
4444

4545
- ___DELETE /{uid}___,删除记录
4646
- headers

dist/index.html

Lines changed: 0 additions & 246 deletions
This file was deleted.

handle.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (p *Paste) inlineCreate(c *gin.Context, fh *multipart.FileHeader) bool {
100100
Token: rand.Text(),
101101
Type: inline,
102102
Size: fh.Size,
103-
Text: strings.TrimSpace(string(bytes)),
103+
Text: string(bytes),
104104
}
105105
return p.create()
106106
} else {
@@ -188,14 +188,14 @@ func (p *Paste) htmlCreate(c *gin.Context, fh *multipart.FileHeader) bool {
188188
Token: rand.Text(),
189189
Type: html,
190190
Size: fh.Size,
191-
Text: strings.TrimSpace(string(bytes)),
191+
Text: string(bytes),
192192
}
193193
return p.create()
194194
}
195195

196196
func respPasteHandler(c *gin.Context) {
197197
paste := Paste{
198-
HashKey: convHash(c.Param("uid")),
198+
HashKey: convHash(c.Param("src")[1:]),
199199
}
200200

201201
if !paste.get() {

0 commit comments

Comments
 (0)