使用对象数据进行属性判断(可选链?.) const test = res.data?.info 相当于 cosnt test = res.data ? res.data.info : null 取默认值(双问号??) const tableList = res?.data?.content ?? [4,5,6]