vue本地环境请求线上django后端没有cookie
作者:互联网
1、django安装django-cros-headers,settings配置:
INSTALLED_APPS = [ 'corsheaders', ... ] MIDDLEWARE = [ 'corsheaders.middleware.CorsMiddleware', ... ] CORS_ALLOW_CREDENTIALS = True CORS_ORIGIN_ALLOW_ALL = True
2、axios请求默认 withCredentials: true
标签:...,vue,corsheaders,django,cookie,ALLOW,CORS,True 来源: https://www.cnblogs.com/psycho/p/14789493.html