feat: 实现官网与设备用户界面

This commit is contained in:
Nixevol
2026-10-12 06:58:06 +08:00
parent a7b8584c5a
commit 5e6d3cadcb
21 changed files with 2416 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { api, type Me } from '../api'
export const useSession = defineStore('session', () => {
const me = ref<Me | null>(null)
const ready = ref(false)
async function refresh() {
try {
me.value = await api.me()
} catch {
me.value = null
} finally {
ready.value = true
}
}
async function logout() {
await api.logout()
me.value = null
}
return { me, ready, refresh, logout }
})