.
This commit is contained in:
parent
7a37f837d6
commit
8fec088bfa
@ -75,7 +75,7 @@ export const useWeatherStore = defineStore('weather', () => {
|
||||
const getWeatherInfoWithCache = async () => {
|
||||
const now = new Date();
|
||||
const pad = n => String(n).padStart(2, '0');
|
||||
const key = `weather_${pad(now.getMonth() + 1)}${pad(now.getDate())}${pad(now.getHours())}${Math.floor(now.getMinutes() / 10) * 10}`;
|
||||
const key = `weather_${pad(now.getMonth() + 1)}${pad(now.getDate())}${pad(now.getHours())}${pad(Math.floor(now.getMinutes() / 10) * 10)}`;
|
||||
|
||||
const cached = localStorage.getItem(key);
|
||||
if (cached) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user