commencer cleanup
This commit is contained in:
parent
04fd45a792
commit
5fd32ef333
2
.env.sample
Normal file
2
.env.sample
Normal file
@ -0,0 +1,2 @@
|
||||
VITE_CONJUREOS_HOST=
|
||||
VITE_CONJUREOS_MQTT=
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -26,3 +26,4 @@ coverage
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
.env
|
||||
|
||||
@ -12,9 +12,13 @@ const isLoginIn = ref(false)
|
||||
const login = (form) => {
|
||||
const formData = new FormData(form)
|
||||
isLoginIn.value = true
|
||||
|
||||
const myHeaders = new Headers();
|
||||
myHeaders.append("API-Version", 1);
|
||||
fetch(apiHost + 'login', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
body: formData,
|
||||
headers: myHeaders
|
||||
})
|
||||
.then((response) => {
|
||||
isLoginIn.value = false
|
||||
|
||||
@ -5,15 +5,19 @@ import {usePlayerAuthStore} from '@/stores/player-auth';
|
||||
import router from '@/router';
|
||||
|
||||
const apiHost = import.meta.env.VITE_CONJUREOS_HOST
|
||||
|
||||
const errorStore = useErrorStore()
|
||||
|
||||
const isLoginIn = ref(false)
|
||||
const signup = (form) => {
|
||||
const formData = new FormData(form);
|
||||
isLoginIn.value = true
|
||||
const myHeaders = new Headers();
|
||||
myHeaders.append("API-Version", 1);
|
||||
fetch(apiHost + 'signup', {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
headers: myHeaders
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.status !== 200)
|
||||
|
||||
@ -19,8 +19,11 @@ const game = ref(undefined)
|
||||
const isActivating = ref(false)
|
||||
console.log(route, route.meta)
|
||||
onMounted(() => {
|
||||
const myHeaders = new Headers();
|
||||
myHeaders.append("API-Version", 1);
|
||||
fetch(apiHost + 'games/' + gameId.value, {
|
||||
method: 'GET',
|
||||
headers: myHeaders
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((result) => {
|
||||
@ -40,6 +43,7 @@ function activate() {
|
||||
method: 'POST', headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': `Bearer ${auth.value.token}`,
|
||||
'API-Version': 1,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
@ -68,6 +72,7 @@ function deactivate() {
|
||||
method: 'POST', headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': `Bearer ${auth.value.token}`,
|
||||
'API-Version': 1,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
|
||||
@ -14,8 +14,11 @@ const gamelistStore = useGamelistStore()
|
||||
const {list: gamelist} = storeToRefs(gamelistStore)
|
||||
|
||||
onMounted(() => {
|
||||
const myHeaders = new Headers();
|
||||
myHeaders.append("API-Version", 1);
|
||||
fetch(apiHost + 'games', {
|
||||
method: 'GET',
|
||||
headers: myHeaders
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((result) => {
|
||||
|
||||
@ -16,12 +16,14 @@ export default {
|
||||
submitForm() {
|
||||
const form = this.$refs.uploadForm
|
||||
const formData = new FormData(form)
|
||||
console.log("Upload")
|
||||
|
||||
fetch(apiHost + 'games', {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
headers: {
|
||||
Authorization: authStr.getAuth()
|
||||
Authorization: authStr.getAuth(),
|
||||
'API-Version': 1
|
||||
}
|
||||
})
|
||||
.then((response) => response.text())
|
||||
|
||||
@ -21,9 +21,12 @@ const submit = (form) => {
|
||||
const formData = new FormData(form)
|
||||
formData.set('token', route.query.token.toString())
|
||||
isLoginIn.value = true
|
||||
const myHeaders = new Headers();
|
||||
myHeaders.append("API-Version", 1);
|
||||
fetch(apiHost + route.query.action, {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
body: formData,
|
||||
headers: myHeaders,
|
||||
})
|
||||
.then((response) => {
|
||||
isLoginIn.value = false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user