This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user