feat: 初始化DevOps平台前端

This commit is contained in:
湛兮
2026-06-11 20:49:59 +08:00
commit 60931e2c21
38 changed files with 7033 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { computed, ref } from 'vue'
import { defineStore } from 'pinia'
export const useSessionStore = defineStore('session', () => {
const operator = ref('ops-admin')
const role = ref<'admin' | 'operator' | 'viewer'>('admin')
const token = ref('mock-session')
const isAuthenticated = computed(() => Boolean(token.value))
function login(name: string) {
operator.value = name || 'ops-admin'
token.value = 'mock-session'
}
function logout() {
token.value = ''
}
return {
operator,
role,
token,
isAuthenticated,
login,
logout,
}
})