Spaces:
Running
Running
vlff李飞飞
commited on
Commit
•
2e2dc41
1
Parent(s):
0f36f70
优化
Browse files- 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 |
-
|
|
|
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 |
|