Exemplo n.º 1
0
 def write_aes_data(self, data):
     """
     :keyword AES加密
     :param data:
     :return:
     """
     if isinstance(data, dict):
         content = jsondate.dumps(data).encode()
         res = aes_tools.encrypt(content)
     else:
         content = data.encode()
         res = aes_tools.encrypt(content)
     return self.write(res)
Exemplo n.º 2
0
 def write_json(self, data):
     assert isinstance(data, dict)
     self.set_header("Content-Type", "application/json; charset=utf-8")
     content = jsondate.dumps(data)
     self.write(content)