feat: 保持浏览器登录,并显示我的学时里的本月学时
This commit is contained in:
@@ -14,6 +14,7 @@ interface HomeProfile {
|
||||
level: string;
|
||||
year_score: string;
|
||||
month_score: string;
|
||||
month_hours: string;
|
||||
total_hours: string;
|
||||
total_score: string;
|
||||
today_hours: string | number | null;
|
||||
@@ -35,6 +36,7 @@ const facts = computed(() => {
|
||||
return [
|
||||
{ label: "本年学分", value: current.year_score },
|
||||
{ label: "本月学分", value: current.month_score },
|
||||
{ label: "本月学时", value: current.month_hours },
|
||||
{ label: "累计学时", value: current.total_hours },
|
||||
{ label: "累计学分", value: current.total_score },
|
||||
{ label: "今日学时", value: current.today_hours ?? "—" },
|
||||
@@ -51,7 +53,7 @@ async function load() {
|
||||
const current = ++requestId;
|
||||
loading.value = profile.value === null;
|
||||
try {
|
||||
const response = await fetch(`/api/home?employee_id=${encodeURIComponent(props.employeeId)}`);
|
||||
const response = await fetch("/api/home");
|
||||
const payload = await response.json().catch(() => ({}));
|
||||
if (current !== requestId) return;
|
||||
if (!response.ok) {
|
||||
|
||||
Reference in New Issue
Block a user