1. 403是被服務器拒絕了,一般是spring security造成的,springsecurity會開啟跨域認證,所以不關閉這個的話會訪問api會出現403錯誤
2.解決
@Override protected void configure(HttpSecurity http) throws Exception { http .and() .csrf() .disable() ....
在spring security 的控制類中加入以下代碼即可,關閉跨域認證.
1. 403是被服務器拒絕了,一般是spring security造成的,springsecurity會開啟跨域認證,所以不關閉這個的話會訪問api會出現403錯誤
2.解決
@Override protected void configure(HttpSecurity http) throws Exception { http .and() .csrf() .disable() ....
在spring security 的控制類中加入以下代碼即可,關閉跨域認證.
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。