根因: Spring Security /auth/oauth/token 401 响应带 WWW-Authenticate: Basic realm="oauth2/client"
浏览器拦截该响应头后弹出原生 HTTP Basic Auth 对话框("身份验证"),
在 axios/JS 处理响应之前就触发,前端代码无法拦截.
修法: nginx-vue.conf /auth/ location 加 proxy_hide_header WWW-Authenticate;
同时 PlaceholderView/AppLayout fetch 调用加 credentials: omit 兜底.
验证: curl 测试 401 响应已无 WWW-Authenticate 头,登录流程不再触发浏览器弹窗.
|
||
|---|---|---|
| .. | ||
| AppLayout.vue | ||