Merge branch 'feature/frontend-form-auth' into feature/login
This commit is contained in:
commit
6f7b9e0552
67
src/main/resources/public/index.html
Normal file
67
src/main/resources/public/index.html
Normal file
@ -0,0 +1,67 @@
|
||||
<!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>Авторизатор BitBucked MarkBot</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">Забубенитсья</button>
|
||||
<span>{{responseMessage}}</span>
|
||||
<p class="mt-5 mb-3 text-muted">© 2020 Made by @DR_Demons for @uppage bitbucked bot</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
|
||||
};
|
||||
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>
|
49
src/main/resources/public/static/css/signin.css
Normal file
49
src/main/resources/public/static/css/signin.css
Normal file
@ -0,0 +1,49 @@
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-box;
|
||||
display: flex;
|
||||
-ms-flex-align: center;
|
||||
-ms-flex-pack: center;
|
||||
-webkit-box-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-pack: center;
|
||||
justify-content: center;
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.form-signin {
|
||||
width: 100%;
|
||||
max-width: 330px;
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.form-signin .checkbox {
|
||||
font-weight: 400;
|
||||
}
|
||||
.form-signin .form-control {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
height: auto;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.form-signin .form-control:focus {
|
||||
z-index: 2;
|
||||
}
|
||||
.form-signin input[type="email"] {
|
||||
margin-bottom: -1px;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.form-signin input[type="password"] {
|
||||
margin-bottom: 10px;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user