69 lines
2.7 KiB
HTML
69 lines
2.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<script src="https://unpkg.com/vue"></script>
|
|
<meta charset="UTF-8">
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
<title>Авторизатор BitbucketBot</title>
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
|
<link href="static/css/signin.css" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
<div class="form-signin">
|
|
<h1 class="h3 mb-3 font-weight-normal">Авторизатор</h1>
|
|
<label for="telegramId" class="sr-only">Введите что-то тут...</label>
|
|
<input type="text" v-model="telegramId" id="telegramId" name="telegramId" class="form-control"
|
|
placeholder="Telegram Id">
|
|
<label for="login" class="sr-only">Введите что-то тут...</label>
|
|
<input type="text" v-model="login" id="login" name="login" class="form-control" placeholder="Username">
|
|
<label for="token" class="sr-only">И еще что то тут...</label>
|
|
<input type="text" v-model="token" id="token" class="form-control" placeholder="Token">
|
|
<button @click="auth" class="btn btn-lg btn-primary btn-block" style="margin: 10px">Забубениться</button>
|
|
<span>{{responseMessage}}</span>
|
|
<p class="mt-5 mb-3 text-muted">© 2020 Made by @DR_Demons for @uPagge bitbucketbot</p>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
'use strict'
|
|
new Vue({
|
|
el: '#app',
|
|
data: function () {
|
|
return {
|
|
telegramId: '',
|
|
login: '',
|
|
token: '',
|
|
responseMessage: ''
|
|
}
|
|
},
|
|
methods: {
|
|
auth: async function () {
|
|
const url = '/api/user/reg';
|
|
const data = {
|
|
telegramId: this.telegramId,
|
|
login: this.login,
|
|
token: this.token,
|
|
responseMessage: this.responseMessage
|
|
};
|
|
try {
|
|
const response = await fetch(url, {
|
|
method: 'POST',
|
|
body: JSON.stringify(data),
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
}
|
|
});
|
|
const json = await response.json();
|
|
console.log('Успех:', JSON.stringify(json));
|
|
} catch (error) {
|
|
console.error('Ошибка:', error);
|
|
}
|
|
console.log(4)
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
</body>
|
|
</html>
|