릴리스: v0.1.6 MariaDB 개발 환경 및 저장소 설정 정리

This commit is contained in:
2026-03-19 14:48:03 +09:00
commit 0c30ae5cb3
52 changed files with 9346 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { defineStore } from 'pinia'
import { api } from '../lib/api'
export const useAuthStore = defineStore('auth', {
state: () => ({
user: null,
status: 'idle',
}),
actions: {
async refresh() {
this.status = 'loading'
try {
const data = await api.me()
this.user = data.user
} finally {
this.status = 'idle'
}
},
async signup(email, password) {
const user = await api.signup({ email, password })
this.user = user
return user
},
async login(email, password) {
const user = await api.login({ email, password })
this.user = user
return user
},
async logout() {
await api.logout()
this.user = null
},
},
})