Commit 3b610cb6 authored by yaobeibei's avatar yaobeibei

add login

parent 15b196a9
......@@ -39,40 +39,15 @@
},
mounted () {
// const self = this
// if (localStorage.getItem('sureLogin')) {
// self.onSubmit()
// }
let self = this
document.onkeydown = function (event) {
var e = event || window.event;
if (e && e.keyCode == 13) {
self.login({userEmail: self.from.userEmail, password: self.from.password})
}
};
},
methods: {
// onSubmit () {
// let self = this
// if (self.from.userName && self.from.password) {
// fetch('/api/login', {
// method: 'POST',
// headers: {'Content-Type': 'application/json;charset=UTF-8'},
// body: JSON.stringify(self.from)
// }).then(res => { return res.json() }).then(data => {
// console.log(data)
// if (data.status === 230) {
// sessionStorage.setItem('sureLogin', data.id)
// this.$router.push({path: '/'})
// } else {
// this.$message({
// showClose: true,
// message: data.message,
// type: 'error'
// })
// }
// })
// } else {
// this.$message({
// showClose: true,
// message: '请输入账号密码',
// type: 'error'
// })
// }
// },
...mapActions([
'login'
])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment