|
|
@@ -70,7 +70,10 @@ class GetWeather(APIView):
|
|
|
query = table.objects.filter(cityid=cityid)
|
|
|
if query:
|
|
|
temp = query.first().content.replace("'", '"')
|
|
|
- result = json.loads(temp)
|
|
|
+ try:
|
|
|
+ result = json.loads(temp)
|
|
|
+ except json.decoder.JSONDecodeError:
|
|
|
+ result = eval(temp)
|
|
|
return Response({"content": result, "msg": "success", "code": 200})
|
|
|
else:
|
|
|
return Response({"msg": "请联系管理员排查", "code": 500})
|