|
@@ -1,7 +1,10 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="login-view-container">
|
|
<div class="login-view-container">
|
|
|
<div>
|
|
<div>
|
|
|
- <h1 class="title"><span>SEEC</span> 用户登录</h1>
|
|
|
|
|
|
|
+ <h1 class="title"><span>SEEC</span>用户登录</h1>
|
|
|
|
|
+ <router-link :to="{name: userInfo.type === 'TEACHER' ? 'teacher' : 'student'}">
|
|
|
|
|
+ <c-button v-if="userInfo.name" block icon="face" theme="green" class="mb-16">已登录用户:{{userInfo.name}}</c-button>
|
|
|
|
|
+ </router-link>
|
|
|
<c-input placeholder="邮箱" type="email" v-model="email"></c-input>
|
|
<c-input placeholder="邮箱" type="email" v-model="email"></c-input>
|
|
|
<section class="tip mb-24">
|
|
<section class="tip mb-24">
|
|
|
<div>关于邮箱的说明:</div>
|
|
<div>关于邮箱的说明:</div>
|
|
@@ -23,7 +26,7 @@
|
|
|
import CInput from '@/components/Basic/CInput'
|
|
import CInput from '@/components/Basic/CInput'
|
|
|
import CButton from '@/components/Basic/CButton'
|
|
import CButton from '@/components/Basic/CButton'
|
|
|
import Background from '@/components/Layouts/Background'
|
|
import Background from '@/components/Layouts/Background'
|
|
|
-import { loginByEmail } from '@/server/user'
|
|
|
|
|
|
|
+import { getUserInfo, loginByEmail } from '@/server/user'
|
|
|
import { SET_USER_INFO } from '@/store/types/main-types'
|
|
import { SET_USER_INFO } from '@/store/types/main-types'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -31,9 +34,15 @@ export default {
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
|
email: '',
|
|
email: '',
|
|
|
- password: ''
|
|
|
|
|
|
|
+ password: '',
|
|
|
|
|
+ userInfo: {}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted () {
|
|
|
|
|
+ getUserInfo().then(res => {
|
|
|
|
|
+ this.userInfo = res
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
formChecked () {
|
|
formChecked () {
|
|
|
return this.email && this.password
|
|
return this.email && this.password
|
|
@@ -80,9 +89,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
.title {
|
|
|
|
|
+ color: #6a7a8a;
|
|
|
span {
|
|
span {
|
|
|
font-family: 'Courier New', 'Courier', monospace;
|
|
font-family: 'Courier New', 'Courier', monospace;
|
|
|
font-size: 1.15em;
|
|
font-size: 1.15em;
|
|
|
|
|
+ color: #3a4a5a;
|
|
|
|
|
+ margin-right: 6px;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ top: 2px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|