fix
This commit is contained in:
parent
e97a318237
commit
bc88340480
@ -37,7 +37,13 @@
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(response => response.json())
|
.then(response => {
|
||||||
|
if (response.status == 401) {
|
||||||
|
router.push('/login');
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return response.json()
|
||||||
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
team.value = data
|
team.value = data
|
||||||
const newActions = team.value?.actions
|
const newActions = team.value?.actions
|
||||||
@ -46,7 +52,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
router.push('/login');
|
|
||||||
console.error('Ошибка:', error)
|
console.error('Ошибка:', error)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { getApiUrl } from './net';
|
import { getApiUrl } from './net';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const login = ref("")
|
const login = ref(sessionStorage.getItem("teamId") || "")
|
||||||
const password = ref("")
|
const password = ref(sessionStorage.getItem("password") || "")
|
||||||
const buttonText = ref("Вход")
|
const buttonText = ref("Вход")
|
||||||
const errorMsg = ref("")
|
const errorMsg = ref("")
|
||||||
|
|
||||||
@ -32,6 +32,9 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (response.status == 401) {
|
if (response.status == 401) {
|
||||||
|
if (login.value == "" && password.value == "") {
|
||||||
|
return
|
||||||
|
}
|
||||||
errorMsg.value = "Не верны название команды или пароль"
|
errorMsg.value = "Не верны название команды или пароль"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -42,6 +45,9 @@
|
|||||||
})
|
})
|
||||||
.finally(() => {buttonText.value = oldText});
|
.finally(() => {buttonText.value = oldText});
|
||||||
}
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
onClickLogin()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user