前后端分离前端vue后端python登录验证
vue使用axios默认设置不携带cookie需要设置axios.defaults.withCredentials=true后台python设置setting.pyCORS_ORIGIN_ALLOW_ALL = FalseCORS_ORIGIN_WHITELIST = ('127.0.0.1:8080',)# If True, cookies wil...
·
vue使用axios默认设置不携带cookie
需要设置
axios.defaults.withCredentials=true
后台python设置setting.py
CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = (
'127.0.0.1:8080',
)
# If True, cookies will be allowed to be included in cross-site HTTP requests. Defaults to False.
CORS_ALLOW_CREDENTIALS = True
更多推荐
已为社区贡献1条内容
所有评论(0)