This commit is contained in:
2025-10-05 22:24:40 +08:00
parent d28c22ddcb
commit 06146d8895
2 changed files with 30 additions and 30 deletions

View File

@@ -4,7 +4,6 @@ import { RouterLink } from "vue-router"
import { isDesktop, isMobile } from "shared/composables/breakpoints" import { isDesktop, isMobile } from "shared/composables/breakpoints"
import { toggleLogin, toggleSignup } from "shared/composables/modal" import { toggleLogin, toggleSignup } from "shared/composables/modal"
import { screenMode, switchScreenMode } from "shared/composables/switchScreen" import { screenMode, switchScreenMode } from "shared/composables/switchScreen"
import { avatar } from "utils/constants"
import { logout } from "../api" import { logout } from "../api"
import { useConfigStore } from "../store/config" import { useConfigStore } from "../store/config"
import { useUserStore } from "../store/user" import { useUserStore } from "../store/user"
@@ -16,6 +15,36 @@ const configStore = useConfigStore()
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
const names = [
"man-with-chinese-cap-1",
"cat-face",
"china",
"chicken",
"eyes",
"elephant",
"hear-no-evil-monkey",
"panda-face",
"penguin-1",
"rooster",
"star-struck-1",
"tomato",
"rocket",
"sparkles",
"money-bag",
"ghost",
"game-dice",
"ewe-1",
"artist-palette",
"baby-bottle",
]
function getRandomAvatar() {
const name = names[Math.floor(Math.random() * names.length)]
return `streamline-emojis:${name}`
}
const avatar = ref(getRandomAvatar())
const envVersion = computed(() => { const envVersion = computed(() => {
if (import.meta.env.PUBLIC_ENV === "test") { if (import.meta.env.PUBLIC_ENV === "test") {
return "测试版" return "测试版"

View File

@@ -228,35 +228,6 @@ export enum ScreenMode {
problem = "仅题目", problem = "仅题目",
} }
const AVATARS = [
"streamline-emojis:man-with-chinese-cap-1",
"streamline-emojis:cat-face",
"streamline-emojis:china",
"streamline-emojis:chicken",
"streamline-emojis:eyes",
"streamline-emojis:elephant",
"streamline-emojis:hear-no-evil-monkey",
"streamline-emojis:panda-face",
"streamline-emojis:penguin-1",
"streamline-emojis:rooster",
"streamline-emojis:star-struck-1",
"streamline-emojis:tomato",
"streamline-emojis:rocket",
"streamline-emojis:sparkles",
"streamline-emojis:money-bag",
"streamline-emojis:ghost",
"streamline-emojis:game-dice",
"streamline-emojis:ewe-1",
"streamline-emojis:artist-palette",
"streamline-emojis:baby-bottle",
]
export const avatar = ref(AVATARS[Math.floor(Math.random() * AVATARS.length)])
export function getRandomAvatar() {
avatar.value = AVATARS[Math.floor(Math.random() * AVATARS.length)]
}
export enum ChartType { export enum ChartType {
Rank, Rank,
Activity, Activity,