瀏覽代碼

修改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)