| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- @model Winsoft.GOV.XF.WX.Models.ManageLoginsViewModel
- @using Microsoft.Owin.Security
- @{
- ViewBag.Title = "管理你的外部登录名";
- }
- <h2>@ViewBag.Title。</h2>
- <p class="text-success">@ViewBag.StatusMessage</p>
- @{
- var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes();
- if (loginProviders.Count() == 0) {
- <div>
- <p>
- There are no external authentication services configured. See <a href="https://go.microsoft.com/fwlink/?LinkId=313242">this article</a>
- for details on setting up this ASP.NET application to support logging in via external services.
- </p>
- </div>
- }
- else
- {
- if (Model.CurrentLogins.Count > 0)
- {
- <h4>已注册的登录名</h4>
- <table class="table">
- <tbody>
- @foreach (var account in Model.CurrentLogins)
- {
- <tr>
- <td>@account.LoginProvider</td>
- <td>
- @if (ViewBag.ShowRemoveButton)
- {
- using (Html.BeginForm("RemoveLogin", "Manage"))
- {
- @Html.AntiForgeryToken()
- <div>
- @Html.Hidden("loginProvider", account.LoginProvider)
- @Html.Hidden("providerKey", account.ProviderKey)
- <input type="submit" class="btn btn-default" value="删除" title="从你的帐户中删除此 @account.LoginProvider 登录名" />
- </div>
- }
- }
- else
- {
- @:
- }
- </td>
- </tr>
- }
- </tbody>
- </table>
- }
- if (Model.OtherLogins.Count > 0)
- {
- using (Html.BeginForm("LinkLogin", "Manage"))
- {
- @Html.AntiForgeryToken()
- <div id="socialLoginList">
- <p>
- @foreach (AuthenticationDescription p in Model.OtherLogins)
- {
- <button type="submit" class="btn btn-default" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="使用你的 @p.Caption 帐户登录">@p.AuthenticationType</button>
- }
- </p>
- </div>
- }
- }
- }
- }
|