<commit_before><template>
	<div class="login-box">
		<div class="login">
			<form @submit.prevent="login()">
				<div>
					<h5>username:</h5>
					<input type="text" class="form-control" v-model.trim="master.username">
				</div>
				<div>
					<h5>password:</h5>
					<input type="password" class="form-control" v-model.trim="master.password">	
				</div>
				<input type="submit" class="btn btn-info" @click="login()" value="登录">
			</form>
		</div>
	</div>
</template>

<script>
	import configs from '../../constants/configs'
	import axios from 'axios'; 
	export default{
		name: 'login',
		data() {
			return {
				master: {}
			}
		},
		methods: {
			login: function(){
				var vm = this;
				if(!vm.master.username || !vm.master.password){
					alert("未提供用户名或密码");
				}
				else{
					axios.post(configs.API_BASE + '/authorization', vm.master)
		            .then(function (res) {
		            	window.sessionStorage.setItem('token', res.data.token);
		            	window.location.href = '/blogs';
		            })
		            .catch(function (err) {
		            	alert(err.message);
		            });
				}
			}
		}
	}
</script>

<style>
	.login-box{
		margin: 60px auto;
		width: 400px;
		height: 240px;
		border: 1px solid #95a5a6;
	}

	.login{
		width: 80%;
    	margin: 10px auto;
    	display: flex;
    	flex-wrap: wrap;
    	flex-direction: column;
    }

    .login .btn{<commit_msg>update Login.vue<commit_after><template>
	<div class="login-box">
		<div class="login">
			<form @submit.prevent="login()">
				<div>
					<h5>username:</h5>
					<input type="text" class="form-control" v-model.trim="master.username">
				</div>
				<div>
					<h5>password:</h5>
					<input type="password" class="form-control" v-model.trim="master.password">	
				</div>
				<input type="submit" class="btn btn-info" @click="login()" value="登录">
			</form>
		</div>
	</div>
</template>

<script>
	import configs from '../../constants/configs'
	import axios from 'axios'; 
	export default{
		name: 'login',
		data() {
			return {
				master: {}
			}
		},
		methods: {
			login: function(){
				var vm = this;
				if(!vm.master.username || !vm.master.password){
					alert("未提供用户名或密码");
				}
				else{
					axios.post(configs.API_BASE + '/authorization', vm.master)
		            .then(function (res) {
		            	window.sessionStorage.setItem('token', res.data.token);
		            	window.location.href = configs.MANAGE_BASE + '/blogs';
		            })
		            .catch(function (err) {
		            	alert(err.message);
		            });
				}
			}
		}
	}
</script>

<style>
	.login-box{
		margin: 60px auto;
		width: 400px;
		height: 240px;
		border: 1px solid #95a5a6;
	}

	.login{
		width: 80%;
    	margin: 10px auto;
    	display: flex;
    	flex-wrap: wrap;
    	flex-direction: column;
    }

    .login .btn{
{'fraction_non_alphanumeric': 0.17659499471272472, 'fraction_numerical': 0.014804370814240395, 'mean_word_length': 2.2847222222222223, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '113942', 'n_tokens_mistral': 1240, 'n_tokens_neox': 1022, 'n_words': 195}