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