| 1234567891011121314151617181920212223 |
- @using Microsoft.AspNet.Identity
- @if (Request.IsAuthenticated)
- {
- using (Html.BeginForm("LogOff", "Account", new { area = "" }, FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
- {
- @Html.AntiForgeryToken()
- <ul class="nav navbar-nav navbar-right">
- <li>
- @Html.ActionLink("你好," + User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: new { area = "" }, htmlAttributes: new { title = "Manage" })
- </li>
- <li><a href="javascript:sessionStorage.removeItem('accessToken');$('#logoutForm').submit();">注销</a></li>
- </ul>
- }
- }
- else
- {
- <ul class="nav navbar-nav navbar-right">
- <li>@Html.ActionLink("注册", "Register", "Account", routeValues: new { area = "" }, htmlAttributes: new { id = "registerLink" })</li>
- <li>@Html.ActionLink("登录", "Login", "Account", routeValues: new { area = "" }, htmlAttributes: new { id = "loginLink" })</li>
- </ul>
- }
|