先放几张网站图片:

  第一步先从layui 网站https://www.layui.com/doc/ 下载相关文件,复制到项目 wwwroot 目录下:

  

  然后在 _Layout.cshtml 中引用 layui.js 和 layui.css,以及添加左侧栏和头部布局(具体操作见 : https://www.layui.com/doc/element/nav.html)

  后端框架:

  

  控制器通过依赖注入引用服务(asp.net core 默认支持)。

  Startup.cs 配置数据库连接,Session(用于登录和菜单缓存),添加服务到服务容器。

public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
} public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMemoryCache();
services.AddSession(options => {
options.IdleTimeout = TimeSpan.FromMinutes();
});
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
}); services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(); services.AddMvc(
options =>
{
options.Filters.Add<HttpGlobalExceptionFilter>(); //加入全局异常类
}).SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
services.AddDbContext<AccessManagementContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"),
providerOptions => providerOptions.EnableRetryOnFailure()));
services.AddDbContext<LuJCDBContext>(options =>
options.UseSqlServer(Configuration["WMSConnectionStrings:DefaultConnection"],
providerOptions => providerOptions.EnableRetryOnFailure()));
services.AddTransient<CompanyServices, CompanyServices>();
services.AddTransient<BasicInfoServices, BasicInfoServices>();
services.AddTransient<AppMenuServices>();
services.AddTransient<IAccountServices,AccountServices>();
services.AddTransient<BranchServices>();
services.AddTransient<PresetFunctionServices>();
services.AddTransient<RoleServices>();
services.AddTransient<LocationServices>();
services.AddTransient<SupplierServices>();
services.AddTransient<CustomerServices>();
services.AddTransient<MeasureServices>();
services.AddTransient<ProductCategoryServices>();
services.AddTransient<ProductServices>();
services.AddTransient<InStorageServices>();
services.AddTransient<OutStorageServices>();
services.AddTransient<BadReportServices>();
services.AddTransient<CheckStockServices>();
services.AddTransient<LocalProductServices>();
//services.AddScoped<AddHeaderFilterWithDI>();
services.AddAutoMapper(typeof(Startup));
Mapper.Initialize(cfg =>
{
cfg.AddProfile<AccessManagementProfile>();
}
);
//Mapper.Initialize(cfg => cfg.CreateMap<AppMenu, AppMenuViewModel>());
} // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env,ILoggerFactory loggerFactory)
{
app.UseSession(); loggerFactory.AddNLog(); //添加NLog
NLog.LogManager.LoadConfiguration("nlog.config");
app.UseLog();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseAuthentication();
app.UseHttpsRedirection();
app.UseStaticFiles();
var cookiePolicyOptions = new CookiePolicyOptions
{
MinimumSameSitePolicy = SameSiteMode.Strict,
};
app.UseCookiePolicy(cookiePolicyOptions);
app.UseAccountSession();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
routes.MapAreaRoute("IMS", "IMS", "IMS/{controller}/{action}/{id?}",
defaults: new { Controller = "Location", Action = "Index" });
routes.MapAreaRoute("WMS", "WMS", "WMS/{controller}/{action}/{id?}",
defaults: new { Controller = "InStorage", Action = "Index" });
routes.MapAreaRoute("Report", "Report", "Report/{controller}/{action}/{id?}",
defaults: new { Controller = "LocalProduct", Action = "Index" });
}); }
}

asp.net core + layui.js 搭建仓储系统的更多相关文章

  1. Asp.net Core + Log4net + ELK 搭建日志中心

    原文:Asp.net Core + Log4net + ELK 搭建日志中心 Docker中一键安装ELK 对于这种工具类的东西,第一步就直接到docker的hub中查找了,很幸运,不仅有Elasti ...

  2. ASP.NET Core下FreeSql的仓储事务

    ASP.NET Core下FreeSql的仓储事务 第一步:配置 Startup.cs 注入 引入包 dotnet add package FreeSql dotnet add package Fre ...

  3. ASP.NET Core 使用 JWT 搭建分布式无状态身份验证系统

    为什么使用 Jwt 最近,移动开发的劲头越来越足,学校搞的各种比赛都需要用手机 APP 来撑场面,所以,作为写后端的,很有必要改进一下以往的基于 Session 的身份认证方式了,理由如下: 移动端经 ...

  4. ASP.NET Core 一步步搭建个人网站(7)_Linux系统移植

    摘要 考虑我们为什么要选择.NET Core? 因为它面向的是高性能服务器开发,抛却了 AspNet 的臃肿组件,非常轻量,加上微软的跨平台战略,对 Docker 的亲和性,对于开发人员也非常友好,所 ...

  5. ASP.NET Core 一步步搭建个人网站(持续更新中~~~)

    摘要 ASP.NET Core2.0发布有一阵子了,这是.NET 开源跨平台的一个重大里程碑, 也意味着比1.0版本要更加成熟.目前.net core具有开源.跨平台.灵活部署.模块化架构等等特性,吸 ...

  6. ASP.NET Core + Vue.js 开发

    1.新建 项目文件夹 pro,在 VS CODE 打开终端,输入dotnet new mvc 命令,新建asp.net core项目. 2.在Startup.cs添加webpack的引用与配置 usi ...

  7. ASP.NET Core 一步步搭建个人网站(1)_环境搭建

    ASP.NET Core2.0发布有一阵子了,这是.NET 开源跨平台的一个重大里程碑, 也意味着比1.0版本要更加成熟.目前.net core具有开源.跨平台.灵活部署.模块化架构等等特性,吸引着一 ...

  8. asp.net core结合NLog搭建ELK实时日志分析平台

    0.整体架构 整体架构目录:ASP.NET Core分布式项目实战-目录 一.介绍ELK 1.说明(此篇ELK采用rpm的方式安装在服务器上)-牛刀小试 承接上一篇文章的内容准备部署ELK来展示asp ...

  9. 使用asp.net core 3.0 搭建智能小车1

    跟随.net core 3.0 一起发布的System.Device.Gpio 1.0已经可以让我们用熟悉的C#原汁原味的开发莓派上面的GPIO了.并且在 Iot.Device.Bindings这个包 ...

随机推荐

  1. Unity/C#基础复习(5) 之 浅析观察者、中介者模式在游戏中的应用与delegate原理

    参考资料 [1] <Unity 3D脚本编程 使用C#语言开发跨平台游戏>陈嘉栋著 [2] @张子阳[C#中的委托和事件 - Part.1] http://www.tracefact.ne ...

  2. python基础知识补充

    set 集合 {} 无序 集合天然去重 增 : s.add s.update 迭代添加 删 : s.pop( ) 随机删除 返回删除值 s.clear( ) 清空 获取到的是 set( ) del s ...

  3. unity之初级

  4. 使用WPF为Powershell程序制作GUI界面

    1. 使用Xaml创建应用界面 打开visual studio,创建一个新的项目,在已安装模板中选择Visual C# →Wpf应用. 完成创建后,我们得到如下图所示的应用界面. wpf界面是基于xa ...

  5. python3 使用urllib报错urlopen error EOF occurred in violation of protocol (_ssl.c:841)

    python3源码: import urllib.request from bs4 import BeautifulSoup response = urllib.request.urlopen(&qu ...

  6. Oracle数据库中心双活之道:ASM vs VPLEX (转)

    双活方案对比:ASM vs V-PLEX 作者:王文杰 Oracle公司 Principle system analyst Oracle高级服务部 Oracle数据库中心的灾备的演变,经历了多年的演变 ...

  7. (六)分布式通信----MessagePack序列化

    1. .Net Core的序列化方式 1.1 json.Net 常用的工具包,如Newtonsoft.Json, 它是基于json格式的序列化和反序列化的组件 json.net 有以下优点: 侵入性: ...

  8. 【Leetcode】【简单】【122. 买卖股票的最佳时机 II】【JavaScript】

    题目描述 122. 买卖股票的最佳时机 II 给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格. 设计一个算法来计算你所能获取的最大利润.你可以尽可能地完成更多的交易(多次买卖一支股票) ...

  9. 快速掌握SPSS数据分析

      SPSS难吗?无非就是数据类型的区别后,就能理解应该用什么样的分析方法,对应着分析方法无非是找一些参考资料进行即可.甚至在线网页SPSS软件直接可以将数据分析结果指标人工智能地分析出来,这有多难呢 ...

  10. phpcms v9.6.0任意文件上传漏洞(CVE-2018-14399)

    phpcms v9.6.0任意文件上传漏洞(CVE-2018-14399) 一.漏洞描述 PHPCMS 9.6.0版本中的libs/classes/attachment.class.php文件存在漏洞 ...