gpt4 book ai didi

javascript - 未捕获( promise )SyntaxError : Unexpected token?

转载 作者:行者123 更新时间:2023-11-29 22:45:38 27 4
gpt4 key购买 nike

<分区>

我有这样的错误:

index.js:8 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

index.js( Action ):

import { days } from "../components/app";
export function fetchData (day) {
return async (dispatch) => {dispatch({ type: 'LOAD_DATA_START', day });
const response = await fetch(`api.iev.aero/api/flights/${day}`);
const data = (await response.json()).body;
dispatch({ type: 'LOAD_DATA_END', data });
dispatch({ type: 'SET_SHIFT', data });
}
}

如何修复这个错误?

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com