提交 caad1e2f authored 作者: lihuihui's avatar lihuihui

修改登录

上级 4f3c83c2
......@@ -25,8 +25,17 @@
</li>
</template>
</ul>
<!-- <div class="login"><span @click="isLogin = true">用户登录</span>/<span @click="$router.push({ path: '/register' })">注册</span></div> -->
<div class="login">
<template v-if="isLogin">
<span @click="handleLogout">退出</span>
</template>
<template v-else>
<span @click="handleLogin">用户登录</span>
/
<span @click="handleRegister">注册</span>
</template>
</div>
<!-- <div class="login">
<template v-if="isLogin">
<div>{{ user.nickname || user.realname }}</div>
<span>|</span>
......@@ -37,18 +46,18 @@
<span>|</span>
<div @click="handleLogin">登录</div>
</template>
</div>
</div> -->
</div>
</div>
<login v-if="isLogin" @reg="reg" @closeMask="closeMask"></login>
<vue-passport ref="passport" @ready="onReady" :options="options"></vue-passport>
</header>
</template>
<script>
import login from './login'
// import login from './login'
export default {
components: {
login
// login
},
data() {
return {
......@@ -193,7 +202,8 @@ export default {
this.passport.logout()
this.isLogin = false
window.G.UserInfo = {}
this.$router.push('/')
// window.location.href = window.location.href
// this.$router.push('/')
},
onReady(isLogin, user = {}) {
// this.isLogin = isLogin
......@@ -202,7 +212,7 @@ export default {
},
loginSuccess(data) {
this.passport.checkLoginStatus((isLogin, user = {}) => {
// this.isLogin = isLogin
this.isLogin = isLogin
this.user = user
this.$router.push('/my')
})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论