fix(spec-helper): correct data assignment from api response for unwrapped response

This commit is contained in:
DXC
2026-04-13 09:29:28 +08:00
parent f7a789a196
commit 81bfb29b50

View File

@ -66,10 +66,11 @@ const toggle = () => {
const fetchData = async () => { const fetchData = async () => {
try { try {
const res = await getLatestSpecs() const res = await getLatestSpecs()
if (res.data.code === 200) { if (res.code === 200) {
specData.value = res.data.data || [] specData.value = res.data || []
console.log('SpecHelper Data:', specData.value)
} else { } else {
ElMessage.error(res.data.msg || '获取规格数据失败') ElMessage.error(res.msg || '获取规格数据失败')
} }
} catch (error) { } catch (error) {
console.error('获取规格数据失败:', error) console.error('获取规格数据失败:', error)