init: 0.1.0

feat: 基本功能有了
  1. 分片上传
  2. code 回显
  3. 下载
todo: 断点上传
This commit is contained in:
loveuer
2025-05-06 18:04:20 +08:00
parent 7ec8cd5c0e
commit b3ff70167f
10 changed files with 345 additions and 73 deletions

View File

@ -73,7 +73,7 @@ func ShareUpload() nf.HandlerFunc {
rangeValidator := regexp.MustCompile(`^bytes=\d+-\d+$`)
return func(c *nf.Ctx) error {
code := strings.TrimSpace(c.Param("code"))
if len(code) != 16 {
if len(code) != opt.CodeLength {
return c.Status(http.StatusBadRequest).JSON(map[string]string{"msg": "invalid file code"})
}