Skip to content

Commit f0898a6

Browse files
committed
feat: add version log after getting settings
1 parent ff10ae2 commit f0898a6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/app/App.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { MustUser } from "./MustUser";
1818
import "./index.css";
1919
import { useI18n } from "@solid-primitives/i18n";
2020
import { initialLang, langMap, loadedLangs } from "./i18n";
21+
import { Resp } from "~/types";
2122

2223
const Home = lazy(() => import("~/pages/home/Layout"));
2324
const Manage = lazy(() => import("~/pages/manage"));
@@ -46,7 +47,7 @@ const App: Component = () => {
4647
})(),
4748
(async () => {
4849
handleRrespWithoutAuthAndNotify(
49-
await r.get("/public/settings"),
50+
(await r.get("/public/settings")) as Resp<Record<string, string>>,
5051
setSettings,
5152
setErr
5253
);

src/store/settings.ts

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ export const setSettings = (items: Record<string, string>) => {
77
Object.keys(items).forEach((key) => {
88
settings[key] = items[key];
99
});
10+
const version = settings["version"] || "Unknown";
11+
console.log(
12+
`%c AList %c ${version} %c https://github.com/Xhofe/alist`,
13+
"color: #fff; background: #5f5f5f",
14+
"color: #fff; background: #70c6be",
15+
""
16+
);
1017
};
1118

1219
export const getSetting = (key: string) => settings[key] ?? "";

0 commit comments

Comments
 (0)