我试图在reactjs中获取后分配一个变量,在下面的代码获取之后没有分配它:
var apiBase = '';
fetch('/AppSettings/GetSettings')
.then(response => { return response.text() })
.then(data => {apiBase = data; console.log("Within Call:" + apiBase); })
.catch(err => {console.log("Error :" + err) });