from aiohttp import web
from urllib.parse import quote
r = web.Response()
# r.content_type = 'application/octet-stream'
# r.content_disposition = 'attachment;filename={}'.format('语言包.xlsx')
r.headers['content_type'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
r.headers["Cache-Control"] = "no-cache"
filename = '官网语言包{}.xlsx'.format(datetime.datetime.now().strftime('%Y%m%d %H%M%S'))
r.headers["Content-Disposition"] = "attachment;filename*=UTF-8''{}".format(quote(filename.encode('utf-8')))
r.body = sio.getvalue()
return r