解决报错:Uncaught SyntaxError: Unexpected token “xxx” in JSON at position 0

首先检查一下你的代码:

if(localStorage.getItem("projectInfos")){
  console.log(localStorage.getItem("projectInfos"));
}

如果能打印出值,然后去浏览器的 location 里,看一下里面存储的数据,将数据清空,刷新页面,报错解决。

猜你喜欢

转载自blog.csdn.net/mChales_Liu/article/details/114257038