fix
This commit is contained in:
parent
30c4232406
commit
53558c4b46
1 changed files with 2 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { computed, ref } from 'vue'
|
import { computed, nextTick, ref } from 'vue'
|
||||||
import { apiClient } from '@/services/apiClient'
|
import { apiClient } from '@/services/apiClient'
|
||||||
import router from '@/router/index.js'
|
import router from '@/router/index.js'
|
||||||
|
|
||||||
|
|
@ -54,6 +54,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||||
try {
|
try {
|
||||||
const response = await apiClient.post('/user/auth/login', { email, password })
|
const response = await apiClient.post('/user/auth/login', { email, password })
|
||||||
setToken(response.data.access_token)
|
setToken(response.data.access_token)
|
||||||
|
await nextTick()
|
||||||
router.push({ name: 'collection'})
|
router.push({ name: 'collection'})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Login error:', error)
|
console.error('Login error:', error)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue