天天看點

EIP權限工作流平台總結-2前端架構

  1.預覽位址:www.eipflow.com

     (1) 權限工作流:www.demo.eipflow.com/Account/Login

     (2) 基礎權限版:www.auth.eipflow.com/Account/Login

     (3) Net4.5開源版:http://www.open.eipflow.com/Account/Login

    2.Adminlte(https://adminlte.io/)

     Adminlte是國外一款開源免費的Bootstrap背景模闆,內建了大多數背景系統需要的控件,如Tab,Table,Checkbox,報表等

     學習參考位址:

https://gitee.com/zhougaojun/KangarooAdmin

https://blog.csdn.net/jrn1012/article/details/54096408

https://www.cnblogs.com/roy-blog/p/8280933.html?utm_source=debugrun&utm_medium=referral

http://adminlte.la998.com/

https://www.jianshu.com/p/e80b1f5001eb

     多标簽模式:

https://gitee.com/weituotian/AdminLTE-With-Iframe

     Vue模式

https://devjin0617.github.io/vue2-admin-lte/

https://github.com/r0r1/vuejs-AdminLTE

   3.Asp.Net Core2.1 Mvc區域,使用區域,可以有效的對業務進行隔離,各種業務及分工可以更靈活 

wwwroot:放置系統需要的靜态資源如js,css,圖檔等

      

EIP權限工作流平台總結-2前端架構

app:所有區域子產品使用的Js

           

EIP權限工作流平台總結-2前端架構

build:所有自動化壓縮後的檔案存放目錄,生産環境全部使用壓縮後的js,css,主要使用bundleconfig.json進行配置,安裝功能插件

   參考:https://www.cnblogs.com/tdfblog/p/bundling-and-minification-in-asp-net-core.html

     

EIP權限工作流平台總結-2前端架構
EIP權限工作流平台總結-2前端架構
EIP權限工作流平台總結-2前端架構

css:系統中需要用到的Css檔案

          

EIP權限工作流平台總結-2前端架構

lIb:使用的第三方元件

EIP權限工作流平台總結-2前端架構

upload:一些上傳的檔案存放目錄,也可單獨放到檔案伺服器上

EIP權限工作流平台總結-2前端架構

   areas:區域,根據功能子產品進行劃分,基于此套系統開發時,新系統即可開一個新的區域進行隔離,如Oa,Crm,PDM等等,區域裡面隻會有控制器和頁面

EIP權限工作流平台總結-2前端架構

            baseController:所有前端頁面的基類,主要實作頁面的緩存   

using Microsoft.AspNetCore.Mvc;

namespace EIP
{
    /// <summary>
    /// 添加緩存
    /// </summary>
    [ResponseCache(CacheProfileName = "EipCacheProfiles")]
    public class BaseController : Controller
    {

    }
}      

    Startup:系統啟動項配置,可配置緩存相關參數,BaseController中的緩存名即從此檔案進行配置      

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace EIP
{
    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.AddMvc(option => option.CacheProfiles.Add("EipCacheProfiles", new CacheProfile
            {
                Duration = 86400
            }));

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
            services.Configure<FormOptions>(x => {
                x.ValueLengthLimit = int.MaxValue;
                x.MultipartBodyLengthLimit = int.MaxValue;
            });
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseCookiePolicy();
            //添加區域支援
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "areas",
                    template: "{area:exists}/{controller=Home}/{action=Index}/{id?}"
                );
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
    }
}