4
我有一個用Spring Boot開發的Java應用程序,它是後端。 前端是一個在ReactJs中開發的應用程序。我使用REST服務。 我使用axios進行REST調用。 我最近啓用了Spring Boot的安全性。現在我很難驗證axios呼叫。Reactjs Axios/Spring引導安全
var config = {
auth: {
username: 'bruker',
password: 'passord'
}
};
axios.get('http://localhost:8090/employee/all', config).then(function (response) {
console.log(response)
}.bind(this)).catch(function (response) {
console.log(response)
}.bind(this))
我得到以下錯誤「預檢響應無效(重定向)」 我假設響應是重定向到localhost:8090/login
我還沒有發現這個任何解決方案。我做錯了什麼?