This commit is contained in:
Fine0830 2022-04-21 12:39:06 +08:00 committed by GitHub
parent 6bfb7915bb
commit 393885324b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -88,12 +88,9 @@ export const appStore = defineStore({
this.duration.start.getMonth()); this.duration.start.getMonth());
break; break;
} }
const utcArr = this.utc.split(":");
const utcHour = isNaN(Number(utcArr[0])) ? 0 : Number(utcArr[0]);
const utcMin = isNaN(Number(utcArr[1])) ? 0 : Number(utcArr[1]);
const utcSpace = const utcSpace =
(utcHour + new Date().getTimezoneOffset() / 60) * 3600000 + (this.utcHour + new Date().getTimezoneOffset() / 60) * 3600000 +
utcMin * 60000; this.utcMin * 60000;
const startUnix: number = this.duration.start.getTime(); const startUnix: number = this.duration.start.getTime();
const endUnix: number = this.duration.end.getTime(); const endUnix: number = this.duration.end.getTime();
const timeIntervals: string[] = []; const timeIntervals: string[] = [];
@ -155,6 +152,10 @@ export const appStore = defineStore({
} }
this.utc = res.data.data.getTimeInfo.timezone / 100 + ":0"; this.utc = res.data.data.getTimeInfo.timezone / 100 + ":0";
const utcArr = this.utc.split(":");
this.utcHour = isNaN(Number(utcArr[0])) ? 0 : Number(utcArr[0]);
this.utcMin = isNaN(Number(utcArr[1])) ? 0 : Number(utcArr[1]);
return res.data; return res.data;
}, },
async fetchVersion(): Promise<void> { async fetchVersion(): Promise<void> {

View File

@ -84,9 +84,8 @@ const state = reactive<{ timer: ReturnType<typeof setInterval> | null }>({
const lang = ref<string>(locale.value || "en"); const lang = ref<string>(locale.value || "en");
const autoTime = ref<number>(6); const autoTime = ref<number>(6);
const auto = ref<boolean>(appStore.autoRefresh || false); const auto = ref<boolean>(appStore.autoRefresh || false);
const utcArr = appStore.utc.split(":"); const utcHour = ref<number>(appStore.utcHour);
const utcHour = ref<number>(isNaN(Number(utcArr[0])) ? 0 : Number(utcArr[0])); const utcMin = ref<number>(appStore.utcMin);
const utcMin = ref<number>(isNaN(Number(utcArr[1])) ? 0 : Number(utcArr[1]));
appStore.setPageTitle("Setting"); appStore.setPageTitle("Setting");
const handleReload = () => { const handleReload = () => {