before store

This commit is contained in:
2025-06-26 11:06:48 +03:00
parent 1c732e16dd
commit 34baeb40e3
59 changed files with 3180 additions and 2149 deletions

21
src/stores/auth.ts Normal file
View File

@@ -0,0 +1,21 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { api } from 'boot/axios'
import type { WebApp } from '@twa-dev/types'
export const useAuthStore = defineStore('auth', () => {
const isInit = ref(false)
const telegramUserData = ref()
async function init (tg: WebApp) {
await api.post('/auth?' + tg?.initData)
telegramUserData.value = tg?.initDataUnsafe.user
isInit.value = true
}
return {
isInit,
telegramUserData,
init
}
})