地图查询构造器

This commit is contained in:
2025-06-24 22:54:04 +08:00
parent 912d2d4a12
commit 4ac36abfe3
3 changed files with 299 additions and 30 deletions

View File

@@ -92,3 +92,20 @@ export const getAllMapRating = async () => {
}
};
/**
* 依据条件搜索地图
* @param {Object} params - 查询参数对象,键为参数名,值为参数值
* @returns {Promise<any>} 返回一个包含地图信息的Promise对象
*/
export const searchMapsByConditions = async (params) => {
try {
// 构建查询字符串
const query = new URLSearchParams(params).toString();
const response = await axiosInstance.get(`/map/search?${query}`);
return response.data;
} catch (error) {
console.error('依据条件搜索地图失败:', error);
throw error;
}
};