Fix login error
This commit is contained in:
parent
ebb457f58d
commit
00e81b8b26
3 changed files with 6 additions and 6 deletions
|
@ -10,7 +10,7 @@ export default {
|
||||||
url: 'http://localhost:8000/api/login',
|
url: 'http://localhost:8000/api/login',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'X-CSRFToken': cookies.get('csrf-token'),
|
'X-CSRFToken': cookies.get('csrftoken'),
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
loginName: email,
|
loginName: email,
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
"diaries": [
|
"diaries": [
|
||||||
{
|
{
|
||||||
"name": "Vulcan",
|
"name": "Vulcan",
|
||||||
"url": "cufs.vulcan.net.pl"
|
"url": "https://cufs.vulcan.net.pl/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Fakelog",
|
"name": "Fakelog",
|
||||||
"url": "cufs.fakelog.tk"
|
"url": "http://cufs.fakelog.tk/"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -69,9 +69,9 @@ export default Vue.extend({
|
||||||
async loginUser() {
|
async loginUser() {
|
||||||
Vue.set(this.$store.state, 'isLoading', true);
|
Vue.set(this.$store.state, 'isLoading', true);
|
||||||
const index = diary.diaries.findIndex((item) => item.name === this.selectedDiary);
|
const index = diary.diaries.findIndex((item) => item.name === this.selectedDiary);
|
||||||
console.log(index);
|
|
||||||
const response = await login.login(this.login, this.password,
|
const response = await login.login(this.login, this.password,
|
||||||
diary.diaries[index].name, diary.diaries[index].url);
|
'powiatwulkanowy', diary.diaries[index].url);
|
||||||
|
console.log(response);
|
||||||
this.$store.state.loginData = response.data;
|
this.$store.state.loginData = response.data;
|
||||||
console.log(this.$store.state.loginData);
|
console.log(this.$store.state.loginData);
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
itemSelected() {
|
itemSelected() {
|
||||||
if (this.selectedDiary === 'Fakelog') {
|
if (this.selectedDiary === 'Fakelog') {
|
||||||
this.login = 'jan@fakelog.cf';
|
this.login = 'jan@fakelog.tk';
|
||||||
this.password = 'jan123';
|
this.password = 'jan123';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue