代码修改

This commit is contained in:
董宏凯 committed 2026-07-22 15:43:06 +08:00
1 parent b93b82fcaf
commit 055523bf33
28 files changed
+483 -92

No files matched your search

@@ -42,10 +42,11 @@ export const LOGIN_SOURCE_OPTIONS: { label: string; value: string }[] = [
* 我方主题色键。当前启用 red(浅色) / dark-blue(深色);blue 为后续将新增的主题。
* 主题参数的映射以这些键为左侧 key(如 `dark-blue=darkBlue`)。
*/
export type AppThemeColor = "red" | "blue" | "dark-blue";
export type AppThemeColor = "red" | "green" | "blue" | "dark-blue";
/** 我方全部主题色(「应用管理」主题参数逐项配置目标值时遍历;dot 为配色小圆点)。 */
export const APP_THEME_COLORS: { key: AppThemeColor; label: string; dot: string }[] = [
{ key: "green", label: "绿色", dot: "#07C05F" },
{ key: "red", label: "红色", dot: "#F5222D" },
{ key: "blue", label: "蓝色", dot: "#1677FF" },
{ key: "dark-blue", label: "深蓝色", dot: "#002B5C" },
@@ -57,6 +58,7 @@ export const APP_THEME_COLORS: { key: AppThemeColor; label: string; dot: string
*/
const THEME_KEY_ALIASES: Record<AppThemeColor, string[]> = {
red: ["red", "light"],
green: ["green", "lightgreen"],
blue: ["blue"],
"dark-blue": ["dark-blue", "darkblue", "dark"],
};
@@ -69,6 +71,7 @@ export function getCurrentTheme(): AppThemeColor {
if (typeof document !== "undefined") {
const classList = document.documentElement.classList;
if (classList.contains("dark")) return "dark-blue";
if (classList.contains("lightgreen")) return "green";
if (classList.contains("lightblue")) return "blue";
}
return "red";