<commit_before><style lang="scss" scoped>
@import '../assets/scss/web/login';
</style>

<template>
  	<div class="login">
		<img src="../assets/imgs/logo.jpg"/>
	    <h1 class="hint">Welcome to  Merlin</h1>
		<div class="input-line">
			<input class="email" id="email" type="text" v-model="email" placeholder="Email"/>
		</div>
		<div class="input-line">
			<input class="pwd" type="password" id="pwd" v-model="password" placeholder="Password"/>
		</div>
		<div class="error">{{err}}</div>
		<button class="login-in" @click="login">SIGN IN</button>
		<a class="signup" href="/signup">Sign Up</a>
  	</div>
</template>

<script>
import * as types from '../store/mutation-types'

export default {
	name: 'login',
	data(){
		return{
			email: '',
			password: '',
			err: '',
		}
	},
	methods: {
		login: function(){
			var formData = new FormData();
			formData.append("email", this.email);
			formData.append("password", <PASSWORD>);
			
			fetch('https://huabinwen.com/login', {
        	    method: 'POST',
        	    credentials: 'include',
        	    body: formData
			}).then(response => response.json())
        	.then(data => {
				if(data && data.status === 0){
					this.$store.dispatch(types.SET_LOGIN_TOKEN, data.data)
					this.err = '登录成功'
					this.$router.push('/about')
				}else{
					this.err = '登录失败'
				}
			});
		},
	},
}
</script>
<commit_msg>跳转登录登录成功跳转回原路径<commit_after><style lang="scss" scoped>
@import '../assets/scss/web/login';
</style>

<template>
  	<div class="login">
		<img src="../assets/imgs/logo.jpg"/>
	    <h1 class="hint">Welcome to  Merlin</h1>
		<div class="input-line">
			<input class="email" id="email" type="text" v-model="email" placeholder="Email"/>
		</div>
		<div class="input-line">
			<input class="pwd" type="password" id="pwd" v-model="password" placeholder="Password"/>
		</div>
		<div class="error">{{err}}</div>
		<button class="login-in" @click="login">SIGN IN</button>
		<a class="signup" href="/signup">Sign Up</a>
  	</div>
</template>

<script>
import * as types from '../store/mutation-types'

export default {
	name: 'login',
	data(){
		return{
			email: '',
			password: '',
			err: '',
		}
	},
	methods: {
		login: function(){
			var formData = new FormData();
			formData.append("email", this.email);
			formData.append("password", <PASSWORD>);
			
			fetch('https://huabinwen.com/login', {
        	    method: 'POST',
        	    credentials: 'include',
        	    body: formData
			}).then(response => response.json())
        	.then(data => {
				if(data && data.status === 0){
					this.$store.dispatch(types.SET_LOGIN_TOKEN, data.data)
					this.err = '登录成功'
					this.$router.push(this.$route.query.redirect ? this.$route.query.redirect : '/about')
				}else{
					this.err = '登录失败'
				}
			});
		},
	},
}
</script>

{'fraction_non_alphanumeric': 0.21022524132999643, 'fraction_numerical': 0.0021451555237754737, 'mean_word_length': 3.145185185185185, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 55, 'https://': 2, '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': '3361753', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1036, 'n_words': 188}