| | |
| | | } |
| | | |
| | | // 查询孙胡沟避险场所 |
| | | export async function getSafePoint(data) { |
| | | export async function getSafePoint() { |
| | | const response = await axios.get("/hp/safeHavenLocation/getDataSelect", { |
| | | params: { |
| | | divisionId: 110116110218 |
| | |
| | | export async function getAllCode() { |
| | | const response = await axios.get("/hp/district/getAll"); |
| | | return response.data; |
| | | } |
| | | |
| | | // 获取天气预报 |
| | | export async function getWeather() { |
| | | // 获取当前时间戳 |
| | | const currentTimestamp = Date.now(); |
| | | |
| | | // 创建Date对象 |
| | | const currentDate = new Date(currentTimestamp); |
| | | |
| | | // 格式化为年-月-日(YYYY-MM-DD) |
| | | const year = currentDate.getFullYear(); |
| | | const month = String(currentDate.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以要+1 |
| | | const day = String(currentDate.getDate()).padStart(2, '0'); |
| | | const formattedDate = `${year}-${month}-${day}`; |
| | | |
| | | const response = await axios.get("/hp/weatherForecast/getSevenDaysWeather", { |
| | | params: { |
| | | inputDate: formattedDate |
| | | } |
| | | }); |
| | | return response.data; |
| | | } |