1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-07 16:17:08 +08:00
parent ce2c381116
commit 2cf886d825
4 changed files with 43 additions and 9 deletions

View File

@@ -48,6 +48,15 @@ func StartServerProxy() {
proxy.ErrorHandler = func(writer http.ResponseWriter, request *http.Request, e error) {
writer.WriteHeader(http.StatusBadGateway)
}
s.BindHandler("/bbs/api/fof/upload", func(r *ghttp.Request) {
data, _ := cool.File().Upload(r.Context())
// 返回成功响应JSON格式极简版
r.Response.Header().Set("Content-Type", "application/json")
fmt.Fprintf(r.Response.Writer, `{"code":0,"msg":"上传成功","url":"%s"}`, data)
})
// Handle all requests with path prefix "/proxy/*"
s.BindHandler("/bbs/*url", func(r *ghttp.Request) {
var (