Closed hezygo closed 3 years ago
@log_api.route('/kGraphLog', methods=['GET']) @group_required def k_graph_log(): form=KGraphLog().validate_for_api() log_date=form.log_date.data file_path=get_cms_log(log_date) rv=send_file(file_path,as_attachment=True) return rv
程序正常返回 BUG:flask.ext.cors:Request to '/cms/log/kGraphLog' matches CORS resource '/'. Using options: {'origins': ['.'], 'methods': 'DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT', 'allow_headers': ['.'], 'automatic_options': True, 'send_wildcard': False, 'vary_header': True, 'supports_credentials': False, 'resources': '/', 'intercept_exceptions': True} DEBUG:flask.ext.cors:The request did not contain an 'Origin' header. This means the browser or client did not request CORS, ensure the Origin Header is set. DEBUG:flask.ext.cors:Settings CORS headers: MultiDict([]) DEBUG:flask.app:[GET] -> [/cms/log/kGraphLog] from:127.0.0.1 costs:20.990 ms data:{ param: {"log_date": "20210324"}, body: {} } INFO:werkzeug:127.0.0.1 - - [24/Mar/2021 18:07:05] "GET /cms/log/kGraphLog?log_date=20210324&model_chioce=CMS HTTP/1.1" 200 - postman报错如下
用原生的Flask 同样代码 正常下载
第二天启动项目后并没有报错,所以我就关闭了此Issues
程序正常返回 BUG:flask.ext.cors:Request to '/cms/log/kGraphLog' matches CORS resource '/'. Using options: {'origins': ['.'], 'methods': 'DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT', 'allow_headers': ['.'], 'automatic_options': True, 'send_wildcard': False, 'vary_header': True, 'supports_credentials': False, 'resources': '/', 'intercept_exceptions': True} DEBUG:flask.ext.cors:The request did not contain an 'Origin' header. This means the browser or client did not request CORS, ensure the Origin Header is set. DEBUG:flask.ext.cors:Settings CORS headers: MultiDict([]) DEBUG:flask.app:[GET] -> [/cms/log/kGraphLog] from:127.0.0.1 costs:20.990 ms data:{ param: {"log_date": "20210324"}, body: {} } INFO:werkzeug:127.0.0.1 - - [24/Mar/2021 18:07:05] "GET /cms/log/kGraphLog?log_date=20210324&model_chioce=CMS HTTP/1.1" 200 - postman报错如下
用原生的Flask 同样代码 正常下载