我正在使用react查询来执行POST请求。请求在第一次执行时是成功的,但在执行之后仍然会产生此错误,即使页面刷新也是如此。如果我清除cookie,它也会起作用,但只有一次,那么错误就会不断出现。这是错误消息:
SyntaxError: "[object Object]" is not valid JSON
at JSON.parse (<anonymous>)
at AxiosClient.js:22:1
at async loginUser (user.api.js:7:1)
at async Mutation.execute (mutation.ts:200:
在我项目中,我有一个php文件,它启动了一个js函数来进行ajax调用。我的问题是,如果用户在浏览器上刷新php页面,函数会重新进行ajax调用等等。我需要缓存ajax执行的第一个结果,这样如果刷新完成,缓存中的数据就会被使用,而不会再次进行ajax调用。
我的电话是
if (xmlHttp)
{
// try to connect to the server
try
{
xmlHttp.open("GET", "top10.php?P1="+oStxt, true);
xmlHttp.onreadysta
新的react,甚至无法打开我的项目。 npm start
> app@0.1.0 start
> react-scripts start
i 「wds」: Project is running at http://192.168.0.68/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from C:\Users\Carter\app\public
i 「wds」: 404s will fallback to /
Starting the developm