Authored by yyq

登录状态

... ... @@ -29,6 +29,11 @@ module.exports = () => {
} else {
header.requestHeaderData('boys').then(result => {
Object.assign(data, result);
// 登录状态
if (req.user.uid) {
data.pageHeader.userName = req.user.username;
}
res.render(path, data);
}).catch(next);
}
... ...
... ... @@ -15,8 +15,14 @@
<div class="header-tools right">
<ul>
<li>
<a href="//www.yohoblk.com/passport/login">登录</a> |
<a href="//www.yohoblk.com/passport/reg/index">注册</a>
{{#if userName}}
Hi~
<a href="//www.yohoblk.com/me">{{userName}}</a>
<a href="//www.yohoblk.com/passport/logout">[退出]</a>
{{^}}
<a href="//www.yohoblk.com/passport/login">登录</a> |
<a href="//www.yohoblk.com/passport/reg/index">注册</a>
{{/if}}
</li>
<li>
<a href="#">个人中心</a>
... ...
... ... @@ -2,8 +2,16 @@
<div class="center-content">
<div class="main-logo"></div>
<ul class="header-tools right clearfix">
<li><a href="#">首页</a></li>
<li><a href="#">帮助中心</a></li>
{{#if userName}}
Hi~
<a href="//www.yohoblk.com/me">{{userName}}</a>
<a href="//www.yohoblk.com/passport/logout">[退出]</a>
{{^}}
<a href="//www.yohoblk.com/passport/login">登录</a> |
<a href="//www.yohoblk.com/passport/reg/index">注册</a>
{{/if}}
<li><a href="//www.yohoblk.com">首页</a></li>
<li><a href="//www.yohoblk.com/help">帮助中心</a></li>
<li>客服电话<span>400-9889-9646</span></li>
</ul>
</div>
... ...