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
原文:https://www.cnblogs.com/psycho/p/14789493.html