这是获取功能。
const fetchApi = async () => {
const response = await fetch("http://127.0.0.1:8000/api")
const data = await response.json();
const gd = data.map(e => {
return {
value: parseFloat(e.total),
label: determine_sub_type(e.subs_type),
color: dtermineColor(e.subs_type),
}
})
答案 0 :(得分:0)
您必须使用计算机的 IP地址。
例如:http://192.168.1.100:8000/api
和https portocol