Type ‘string | null‘ is not assignable to type ‘string‘. Type ‘null‘ is not assi Hyinglin 2023-04-12 753 阅读1分钟 第一种情况 报错如下: Type ‘string | null’ is not assignable to type ‘string’. Type ‘null’ is not assignable to type ‘string’.ts(2322) 解决办法: token: localStorage.getItem("token") || '' 第二种情况 报错如下: 解决办法: