Prechádzať zdrojové kódy

修改alexa请求pushtool返回对象

locky 4 rokov pred
rodič
commit
d7ec14305c
1 zmenil súbory, kde vykonal 3 pridanie a 4 odobranie
  1. 3 4
      Controller/AlexaController.py

+ 3 - 4
Controller/AlexaController.py

@@ -27,14 +27,13 @@ class PushCommandView(View):
         return self.PushCommand(request_dict)
 
     def PushCommand(self, request_dict):
-        response = ResponseObject()
         command = request_dict.get('command', None)
         if not command:
-            return response(444)
+            return repr(444)
         try:
             back = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE). \
                                     communicate(timeout=2)
-            return response.json(0, back)
+            return repr(back)
         except Exception as e:
-            return response(500, repr(e))
+            return repr(e)