init: 0.1.2
Some checks failed
/ build and run u-api (push) Failing after 8s
/ clean (push) Successful in 0s

feat: login page && auth required
todo: file dir cleanup
This commit is contained in:
loveuer
2025-05-09 17:49:12 +08:00
parent e5cf2c1367
commit 93c4339039
30 changed files with 1166 additions and 35 deletions

View File

@ -18,9 +18,10 @@ func Start(ctx context.Context) <-chan struct{} {
return c.SendStatus(http.StatusOK)
})
app.Get("/api/share/:code", handler.Fetch())
app.Put("/api/share/:filename", handler.ShareNew()) // 获取上传 code, 分片大小
app.Post("/api/share/:code", handler.ShareUpload()) // 分片上传接口
app.Get("/ushare/:code", handler.Fetch())
app.Put("/api/ushare/:filename", handler.AuthVerify(), handler.ShareNew()) // 获取上传 code, 分片大小
app.Post("/api/ushare/:code", handler.ShareUpload()) // 分片上传接口
app.Post("/api/uauth/login", handler.AuthLogin())
ready := make(chan struct{})
ln, err := net.Listen("tcp", opt.Cfg.Address)