Преглед на файлове

修改alexa请求pushtool返回对象

locky преди 4 години
родител
ревизия
d7ec14305c
променени са 1 файла, в които са добавени 3 реда и са изтрити 4 реда
  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)