优化Pexels 背景图的搜索结果

This commit is contained in:
jingrow 2026-01-21 23:11:46 +08:00
parent fa9bde2d89
commit 48f2f0b208

View File

@ -791,10 +791,15 @@ const fetchPexelsImages = async () => {
query: pexelsQuery.value,
page: pexelsPage.value,
per_page: PEXELS_PER_PAGE,
orientation: 'landscape'
orientation: 'landscape',
locale: 'zh-CN' // Add locale for better Chinese search results
},
headers: {
Authorization: PEXELS_API_KEY
},
// Ensure proper encoding of parameters
paramsSerializer: {
encode: (param) => encodeURIComponent(param)
}
})
const newPhotos = response.data.photos || []