This commit is contained in:
底层用户 2022-03-17 22:58:41 +08:00
parent 6a5920ce3f
commit bee5fe6465
2 changed files with 6 additions and 4 deletions

View File

@ -168,9 +168,9 @@
</div>
<div class="weather">
<span id="city_text">天气</span>&nbsp;<span
id="wea_text">加载失败</span>&nbsp;<span id="tem_night">*</span>°C~<span
id="tem_day">*</span>°C&nbsp;<span id="win_text">风向</span><span
id="win_speed">*</span>
id="wea_text">加载失败</span>&nbsp;<span id="tem_night">N/A</span>°C~<span
id="tem_day">N/A</span>°C&nbsp;<span id="win_text"></span><span
id="win_speed"></span>
</div>
</div>
</div>

View File

@ -89,7 +89,9 @@ fetch('https://v1.hitokoto.cn?max_length=24')
.catch(console.error)
//获取天气
fetch('https://www.yiketianqi.com/free/day?appid=47343665&appsecret=dABM2QxS&unescape=1')
//每日限量 100 次
//请前往 https://www.tianqiapi.com/ 申请(免费)
fetch('https://www.yiketianqi.com/free/day?appid=43986679&appsecret=TksqGZT7&unescape=1')
.then(response => response.json())
.then(data => {
$('#wea_text').text(data.wea)