sessionID as prop
This commit is contained in:
parent
348b4b2702
commit
3b2ff65054
6 changed files with 17 additions and 15 deletions
|
@ -95,7 +95,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import * as Cookies from 'js-cookie'
|
||||
import axios from '@/plugins/axios'
|
||||
|
||||
import Card from './Card.vue'
|
||||
|
@ -106,6 +105,7 @@ export default {
|
|||
name: 'Deck',
|
||||
|
||||
props: {
|
||||
session: String,
|
||||
deck: Object
|
||||
},
|
||||
|
||||
|
@ -120,10 +120,6 @@ export default {
|
|||
deleting: false
|
||||
}),
|
||||
|
||||
computed: {
|
||||
session: () => Cookies.get('session')
|
||||
},
|
||||
|
||||
methods: {
|
||||
save_deck(new_deck) {
|
||||
axios
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<template>
|
||||
<v-expansion-panel v-model="open">
|
||||
<NewDeck
|
||||
:session="session"
|
||||
@change="
|
||||
open = null
|
||||
refresh_decks()
|
||||
|
@ -10,6 +11,7 @@
|
|||
<Deck
|
||||
v-for="deck in linked"
|
||||
:deck="deck"
|
||||
:session="session"
|
||||
:key="deck.id"
|
||||
@change="refresh_decks"
|
||||
/>
|
||||
|
@ -17,7 +19,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import * as Cookies from 'js-cookie'
|
||||
import axios from '@/plugins/axios'
|
||||
import DeckJS from '@/classes/Deck'
|
||||
|
||||
|
@ -32,6 +33,10 @@ export default {
|
|||
NewDeck
|
||||
},
|
||||
|
||||
props: {
|
||||
session: String
|
||||
},
|
||||
|
||||
data: () => ({
|
||||
open: null
|
||||
}),
|
||||
|
@ -54,8 +59,6 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
session: () => Cookies.get('session'),
|
||||
|
||||
linked() {
|
||||
let result = []
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import * as Cookies from 'js-cookie'
|
||||
import axios from '@/plugins/axios'
|
||||
|
||||
import DeckEditor from './forms/DeckEditor.vue'
|
||||
|
@ -35,8 +34,8 @@ export default {
|
|||
DeckEditor
|
||||
},
|
||||
|
||||
computed: {
|
||||
session: () => Cookies.get('session')
|
||||
props: {
|
||||
session: String
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
@ -38,6 +38,10 @@ export default {
|
|||
FormDialog
|
||||
},
|
||||
|
||||
props: {
|
||||
session: String
|
||||
},
|
||||
|
||||
data: () => ({
|
||||
login: '',
|
||||
loginRules: [v => !!v || 'Please enter user name'],
|
||||
|
@ -51,7 +55,7 @@ export default {
|
|||
doLogin() {
|
||||
axios
|
||||
.post('/user/login', {
|
||||
session: Cookies.get('session'),
|
||||
session: this.session,
|
||||
login: this.login,
|
||||
password: this.password
|
||||
})
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<v-content>
|
||||
<v-container>
|
||||
<Header>
|
||||
<LoginForm />
|
||||
<LoginForm :session="session" />
|
||||
<RegisterForm />
|
||||
</Header>
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
|
||||
<template v-if="user">
|
||||
<p>user logged in: {{ user.login }}</p>
|
||||
|
||||
<DeckList />
|
||||
</template>
|
||||
|
||||
<DeckList :session="session" />
|
||||
</v-container>
|
||||
</v-content>
|
||||
</template>
|
||||
|
|
Reference in a new issue