Commit a76af235 by Administrator

Merge branch 'master' into 'dev'

# Conflicts:
#   src/components/product-intro.vue
#   src/views/home.vue
#   src/views/register.vue
parents 03ef7229 148bb131
<template> <template>
<div id="app"> <div id="app">
<!-- <Head /> -->
<router-view /> <router-view />
</div> </div>
</template> </template>
<script> <script>
// import Head from './components/head.vue'
export default { export default {
data() { data() {
return {} return {}
}, },
// components: { Head },
} }
</script> </script>
<style> <style>
......
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
}) })
}, },
login() { login() {
this.$router.push('/login') this.$router.push('/')
}, },
register() { register() {
this.$router.push('/register') this.$router.push('/register')
......
...@@ -48,11 +48,11 @@ const routes = [ ...@@ -48,11 +48,11 @@ const routes = [
name: 'register', name: 'register',
component: (resolve) => require(['../views/register'], resolve), component: (resolve) => require(['../views/register'], resolve),
}, },
{ // {
path: '/login', // path: '/login',
name: 'login', // name: 'login',
component: (resolve) => require(['../views/login'], resolve), // component: (resolve) => require(['../views/login'], resolve),
}, // },
{ {
path: '/contact', path: '/contact',
name: 'contact', name: 'contact',
......
...@@ -34,6 +34,27 @@ export default { ...@@ -34,6 +34,27 @@ export default {
this.$el.removeEventListener('scroll', this.onScroll) this.$el.removeEventListener('scroll', this.onScroll)
}, },
methods: { methods: {
submitForm(e) {
e.preventDefault()
this.$refs.ruleForm.validate((valid) => {
if (valid) {
const hash = md5.create()
hash.update(this.ruleForm.password)
const passwordHash = hash.hex()
let url = `business/user/login`
post(url, {
email: this.ruleForm.email,
password: passwordHash,
}).then((res) => {
if (res.code === 200) {
this.ruleForm = {}
this.$router.push('/contact')
}
})
}
})
},
onScroll() { onScroll() {
const top = this.$el.scrollTop const top = this.$el.scrollTop
if (top === 0) { if (top === 0) {
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
</div> </div>
<div style="margin-top: 20px; font-size: 14px; text-align: center"> <div style="margin-top: 20px; font-size: 14px; text-align: center">
已有账号? 已有账号?
<router-link class="link" to="/login">马上登录</router-link> <router-link class="link" to="/">马上登录</router-link>
</div> </div>
</div> </div>
</div> </div>
......
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