Skip to content

Commit

Permalink
🐛 bug: 修复状态卡片显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
snowykami committed Sep 29, 2024
1 parent 8e3d3b3 commit 596f4d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
23 changes: 11 additions & 12 deletions src/nonebot_plugins/liteyuki_weather/qw_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import aiohttp

from .qw_models import *
import httpx

from ...utils.base.data_manager import get_memory_data
from ...utils.base.language import Language
Expand Down Expand Up @@ -94,7 +93,7 @@ async def city_lookup(
"key" : key,
"lang" : lang,
}
async with httpx.AsyncClient() as client:
async with aiohttp.ClientSession() as client:
resp = await client.get(url, params=params)
return CityLookup.parse_obj(resp.json())

Expand All @@ -114,9 +113,9 @@ async def get_weather_now(
"lang" : lang,
"unit" : unit,
}
async with httpx.AsyncClient() as client:
async with aiohttp.ClientSession() as client:
resp = await client.get(url, params=params)
return resp.json()
return await resp.json()


async def get_weather_daily(
Expand All @@ -134,9 +133,9 @@ async def get_weather_daily(
"lang" : lang,
"unit" : unit,
}
async with httpx.AsyncClient() as client:
async with aiohttp.ClientSession() as client:
resp = await client.get(url, params=params)
return resp.json()
return await resp.json()


async def get_weather_hourly(
Expand All @@ -154,9 +153,9 @@ async def get_weather_hourly(
"lang" : lang,
"unit" : unit,
}
async with httpx.AsyncClient() as client:
async with aiohttp.ClientSession() as client:
resp = await client.get(url, params=params)
return resp.json()
return await resp.json()


async def get_airquality(
Expand All @@ -175,9 +174,9 @@ async def get_airquality(
"pollutant": pollutant,
"station" : station,
}
async with httpx.AsyncClient() as client:
async with aiohttp.ClientSession() as client:
resp = await client.get(url, params=params)
return resp.json()
return await resp.json()

async def get_astronomy(
key: str,
Expand All @@ -192,6 +191,6 @@ async def get_astronomy(
"location" : location,
"date" : date,
}
async with httpx.AsyncClient() as client:
async with aiohttp.ClientSession() as client:
resp = await client.get(url, params=params)
return resp.json()
return await resp.json()
3 changes: 2 additions & 1 deletion src/resources/vanilla_resource/templates/css/status.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@
font-size: 24px;
margin-left: 20px;
text-align: left;
white-space: nowrap;
white-space: normal; /* 允许换行 */
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all; /* 允许在单词内换行 */
z-index: 2;
}

Expand Down

0 comments on commit 596f4d0

Please sign in to comment.