-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
146 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
<v-container style="height: 100%; align-items: center; display: flex"> | ||
<v-container style="border: white solid; width: 80vh"> | ||
<v-select label="Mitarbeiter:" v-model="selectedEmployee" :items="employees"/> | ||
<v-btn @click="setEmployee" style="width: 100%">Login</v-btn> | ||
</v-container> | ||
</v-container> | ||
|
||
</template> | ||
|
||
<script> | ||
import RESTUtils from "@/utils/RESTUtils"; | ||
import store from "@/main"; | ||
export default { | ||
name: "Login", | ||
data() { | ||
return { | ||
employees: [], | ||
selectedEmployee: null, | ||
} | ||
}, | ||
methods: { | ||
getEmployees: function () { | ||
RESTUtils.sendGetRequest("/employee/shortnames") | ||
.then(response => { | ||
this.employees = response.data | ||
}) | ||
}, | ||
setEmployee: function () { | ||
if (this.selectedEmployee === null) { | ||
this.$root.$refs.vtoast.show( | ||
{ | ||
message: 'Naja vielleicht das nächste mal :)', | ||
color: 'failed' | ||
} | ||
) | ||
} else { | ||
RESTUtils.sendGetRequest("/employee/getIdForShortName?shortName=" + this.selectedEmployee) | ||
.then(response => { | ||
store.commit("setEmployeeShortName", this.selectedEmployee) | ||
store.commit("setEmployeeId", response.data) | ||
}) | ||
} | ||
} | ||
}, | ||
created() { | ||
this.getEmployees(); | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import RESTUtils from "@/utils/RESTUtils"; | ||
import {tr} from "vuetify/locale"; | ||
|
||
const USERUtils = { | ||
async validateUser(id, shortname) { | ||
const employee = { | ||
id: id, | ||
shortName: shortname | ||
} | ||
let response = await RESTUtils.sendPostRequest("/employee/validate", employee) | ||
console.log(response.data) | ||
return response.data | ||
} | ||
} | ||
|
||
export default USERUtils; |