wxy01giser commited on
Commit
56a0087
·
verified ·
1 Parent(s): 3c485c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -148,16 +148,12 @@ from io import BytesIO
148
  app = FastAPI()
149
 
150
  @app.post("/api/plugin") # 大赛平台填写的请求地址:https://egisinsight.top/api/plugin
151
- # async def plugin_api(
152
- # file: UploadFile = File(...), # 接收大赛平台上传的Excel文件
153
- # token: str = Form(...), # 平台传递的token(用于权限校验)
154
- # timestamp: str = Form(...), # 平台传递的时间戳
155
- # signature: str = Form(...) # 平台传递的签名(可选校验)
156
- # ):
157
- async def plugin_api(request: Request):
158
- # 读取平台发送的原始请求体
159
- # body = await request.json()
160
- rawbody = await request.body()
161
  # 提取文件标识
162
  # file_id = body["USER_INTERRUPT_FORM_INPUT"]["file"]
163
  print(f"平台传递的文件标识:{rawbody}")
 
148
  app = FastAPI()
149
 
150
  @app.post("/api/plugin") # 大赛平台填写的请求地址:https://egisinsight.top/api/plugin
151
+ async def plugin_api(
152
+ file: UploadFile = File(...), # 接收大赛平台上传的Excel文件
153
+ token: str = Form(...), # 平台传递的token(用于权限校验)
154
+ timestamp: str = Form(...), # 平台传递的时间戳
155
+ signature: str = Form(...) # 平台传递的签名(可选校验)
156
+ ):
 
 
 
 
157
  # 提取文件标识
158
  # file_id = body["USER_INTERRUPT_FORM_INPUT"]["file"]
159
  print(f"平台传递的文件标识:{rawbody}")