vlff李飞飞 commited on
Commit
2e2dc41
1 Parent(s): 0f36f70
Files changed (1) hide show
  1. database_server.py +2 -1
database_server.py CHANGED
@@ -63,7 +63,8 @@ async def cache_data(request: Request, file_name: str):
63
  account_info = json.loads(service.get(access_token, "info.json", False))
64
  if account_info and account_info["enabled"] and account_info["role"] == 'admin':
65
  return Response(status_code=401, content="the token is not valid")
66
- content = json.loads(service.get(access_token, file_name))
 
67
  return JSONResponse(content)
68
 
69
 
 
63
  account_info = json.loads(service.get(access_token, "info.json", False))
64
  if account_info and account_info["enabled"] and account_info["role"] == 'admin':
65
  return Response(status_code=401, content="the token is not valid")
66
+ data = service.get(access_token, file_name, False)
67
+ content = json.loads(data) if data else ""
68
  return JSONResponse(content)
69
 
70