多语言展示
当前在线:1624今日阅读:60今日分享:41

ASP.NETCOREidentity content页

ASP.NETCOREidentity consent页源代码示例下载链接:https://pan.baidu.com/s/1ZM96-kTsgP6rJynHpQWIqg 密码:ftz7
工具/原料

VS2017

方法/步骤
1

1新增viewmoel新建ConsentViewModelpublic class ConsentViewModel    {        public string ClientId { get; set; }        public string ClientName { get; set; }        public string ClientLogoUrl { get; set; }        public bool AllowRememberConsent { get; set; }        public IEnumerable IdentityScorpes { get; set; }        public IEnumerable ResourceScorps { get; set; }    }

3

新增view新增Index.cshtml@model ConsentViewModel

Consent Page

   
       
            @if (Model.IdentityScorpes.Any())            {               
                   
                                                    应用权限                                           
                   
                            @foreach (var item in Model.IdentityScorpes)                        {                            @Html.Partial('_ScopeListItem', item);                        }                   
               
            }            @if (Model.ResourceScorps.Any())            {               
                   
                                                    应用权限                                           
                   
                            @foreach (var item in Model.ResourceScorps)                        {                            @Html.Partial('_ScopeListItem', item);                        }                   
               
            }       
   

4

1新增view新增_ScopeListItem.cshtml@using MvcCookieAuthSample.Models;@model ScopeViewModel

  •     @Model.DisplsyName    @Model.Description
  • 5

    新增的文件结构

    6

    完成

    推荐信息