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
2024-01-30 13:56:46
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