复制代码def default(self, obj): if isinstance(obj, datetime.datetime): return obj.isoformat() return super(VAJSONEncoder, self).default(obj)