typescript 使用as转换类型出现is missing the following properties from type错误问题

 Conversion of type 'AxiosResponse<Response<void>, any>' to type 'Response<void>' may be a mistake because neither type sufficiently overl
aps with the other. If this was intentional, convert the expression to 'unknown' first.
  Type 'AxiosResponse<Response<void>, any>' is missing the following properties from type 'Response<void>': code, msg

解决方式: xxx as unknow as string 双重类型断言(强制转换)解决这个问题。

GPT给出的合理的解决方案(经过人脑确认):

posted @ 2025-05-28 16:59  星小梦  阅读(250)  评论(0)    收藏  举报