mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-03 05:28:13 +00:00
changes: update card & auth
This commit is contained in:
+13
-5
@@ -16,6 +16,7 @@
|
||||
<br />
|
||||
<button>{{ loginState == LoginState.LOADING ? 'Logowanie...' : 'Zaloguj się' }}</button>
|
||||
</form>
|
||||
<p style="color: yellow; height: 25px">{{ errorMessage }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -35,14 +36,21 @@ enum LoginState {
|
||||
export default defineComponent({
|
||||
mixins: [dataMixin],
|
||||
|
||||
data() {
|
||||
return {
|
||||
errorMessage: '',
|
||||
};
|
||||
},
|
||||
|
||||
setup() {
|
||||
return {
|
||||
LoginState,
|
||||
AuthState,
|
||||
|
||||
name: '',
|
||||
password: '',
|
||||
loginState: LoginState.INITIALIZED,
|
||||
LoginState,
|
||||
store: useStore(),
|
||||
AuthState,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -80,7 +88,7 @@ export default defineComponent({
|
||||
this.loginState = LoginState.LOADED;
|
||||
|
||||
if (!e.response || e.response.status === undefined) {
|
||||
this.store.alertMessage = 'Wystąpił błąd podczas łączenia z serwerem!';
|
||||
this.errorMessage = 'Wystąpił błąd podczas łączenia z serwerem!';
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -88,11 +96,11 @@ export default defineComponent({
|
||||
const status: number = response.status;
|
||||
|
||||
if (status == 401) {
|
||||
this.store.alertMessage = 'Nieprawidłowe dane!';
|
||||
this.errorMessage = 'Nieprawidłowe dane!';
|
||||
return false;
|
||||
}
|
||||
|
||||
this.store.alertMessage = 'Wystąpił błąd podczas łączenia z serwerem!';
|
||||
this.errorMessage = 'Wystąpił błąd podczas łączenia z serwerem!';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user