XiaoFeng.Mvc 5.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package XiaoFeng.Mvc --version 5.1.2                
NuGet\Install-Package XiaoFeng.Mvc -Version 5.1.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XiaoFeng.Mvc" Version="5.1.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XiaoFeng.Mvc --version 5.1.2                
#r "nuget: XiaoFeng.Mvc, 5.1.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install XiaoFeng.Mvc as a Cake Addin
#addin nuget:?package=XiaoFeng.Mvc&version=5.1.2

// Install XiaoFeng.Mvc as a Cake Tool
#tool nuget:?package=XiaoFeng.Mvc&version=5.1.2                

XiaoFeng.Mvc

fayelf

Nuget Downloads Nuget Nuget (with prereleases)

Nuget:XiaoFeng.Mvc

QQ群号 QQ群 公众号
748408911 QQ 群 畅聊了个科技

源码: https://github.com/zhuovi/xiaofeng

教程:https://www.yuque.com/fayelf/xiaofeng.mvc

.net core 基础类,快速开发CMS框架,真正的低代码平台,自带角色权限,WebAPI平台,后台管理,可托管到服务运行命令为:应用.exe install 服务名 服务说明,命令还有 delete 删除 start 启动 stop 停止。

感谢支持

名称 LOGO
JetBrains JetBrains
Visual Studio Visual Studio

XiaoFeng

XiaoFeng generator with XiaoFeng.

Install

.NET CLI

$ dotnet add package XiaoFeng.Mvc --version 5.1.2

Package Manager

PM> Install-Package XiaoFeng.Mvc --version 5.1.2

PackageReference

<PackageReference Include="XiaoFeng.Mvc" Version="5.1.2" />

Paket CLI

> paket add XiaoFeng.Mvc --version 5.1.2

Script & Interactive

> #r "nuget: XiaoFeng.Mvc, 5.1.2"

Cake

// Install XiaoFeng.Mvc as a Cake Addin
#addin nuget:?package=XiaoFeng.Mvc&version=5.1.2

// Install XiaoFeng.Mvc as a Cake Tool
#tool nuget:?package=XiaoFeng.Mvc&version=5.1.2

XiaoFeng 类库包含库

命名空间 所属类库 开源状态 说明 包含功能
XiaoFeng.Prototype XiaoFeng.Core 扩展库 ToCase 类型转换<br/>ToTimestamp,ToTimestamps 时间转时间戳<br/>GetBasePath 获取文件绝对路径,支持Linux,Windows<br/>GetFileName 获取文件名称<br/>GetMatch,GetMatches,GetMatchs,IsMatch,ReplacePatten,RemovePattern 正则表达式操作<br/>
XiaoFeng.Net XiaoFeng.Net 网络库 XiaoFeng网络库,封装了Socket客户端,服务端(Socket,WebSocket),根据当前库可轻松实现订阅,发布等功能。
XiaoFeng.Http XiaoFeng.Core 模拟请求库 模拟网络请求
XiaoFeng.Data XiaoFeng.Core 数据库操作库 支持SQLSERVER,MYSQL,ORACLE,达梦,SQLITE,ACCESS,OLEDB,ODBC等数十种数据库
XiaoFeng.Cache XiaoFeng.Core 缓存库 内存缓存,Redis,MemcachedCache,MemoryCache,FileCache缓存
XiaoFeng.Config XiaoFeng.Core 配置文件库 通过创建模型自动生成配置文件,可为xml,json,ini文件格式
XiaoFeng.Cryptography XiaoFeng.Core 加密算法库 AES,DES,RSA,MD5,DES3,SHA,HMAC,RC4加密算法
XiaoFeng.Excel XiaoFeng.Excel Excel操作库 Excel操作,创建excel,编辑excel,读取excel内容,边框,字体,样式等功能
XiaoFeng.Ftp XiaoFeng.Ftp FTP请求库 FTP客户端
XiaoFeng.IO XiaoFeng.Core 文件操作库 文件读写操作
XiaoFeng.Json XiaoFeng.Core Json序列化,反序列化库 Json序列化,反序列化库
XiaoFeng.Xml XiaoFeng.Core Xml序列化,反序列化库 Xml序列化,反序列化库
XiaoFeng.Log XiaoFeng.Core 日志库 写日志文件,数据库
XiaoFeng.Memcached XiaoFeng.Memcached Memcached缓存库 Memcached中间件,支持.NET框架、.NET内核和.NET标准库,一种非常方便操作的客户端工具。实现了Set,Add,Replace,PrePend,Append,Cas,Get,Gets,Gat,Gats,Delete,Touch,Stats,Stats Items,Stats Slabs,Stats Sizes,Flush_All,Increment,Decrement,线程池功能。
XiaoFeng.Redis XiaoFeng.Redis Redis缓存库 Redis中间件,支持.NET框架、.NET内核和.NET标准库,一种非常方便操作的客户端工具。实现了Hash,Key,String,ZSet,Stream,Log,List,订阅发布,线程池功能;
XiaoFeng.Threading XiaoFeng.Core 线程库 线程任务,线程队列
XiaoFeng.Mvc XiaoFeng.Mvc 低代码WEB开发框架 .net core 基础类,快速开发CMS框架,真正的低代码平台,自带角色权限,WebAPI平台,后台管理,可托管到服务运行命令为:应用.exe install 服务名 服务说明,命令还有 delete 删除 start 启动 stop 停止。
XiaoFeng.Proxy XiaoFeng.Proxy 代理库 开发中
XiaoFeng.TDengine XiaoFeng.TDengine TDengine 客户端 开发中
XiaoFeng.GB28181 XiaoFeng.GB28181 视频监控库,SIP类库,GB28181协议 开发中
XiaoFeng.Onvif XiaoFeng.Onvif 视频监控库Onvif协议 XiaoFeng.Onvif 基于.NET平台使用C#封装Onvif常用接口、设备、媒体、云台等功能, 拒绝WCF服务引用动态代理生成wsdl类文件 , 使用原生XML扩展标记语言封装参数,所有的数据流向都可控。
FayElf.Plugins.WeChat FayElf.Plugins.WeChat 微信公众号,小程序类库 微信公众号,小程序类库。
XiaoFeng.Mqtt XiaoFeng.Mqtt MQTT协议 XiaoFeng.Mqtt中间件,支持.NET框架、.NET内核和.NET标准库,一种非常方便操作的客户端工具。实现了MQTT客户端,MQTT服务端,同时支持TCP,WebSocket连接。支持协议版本3.0.0,3.1.0,5.0.0。
XiaoFeng.Modbus XiaoFeng.Modbus MODBUS协议 MODBUS协议,支持RTU、ASCII、TCP三种方式进行通信,自动离线保存服务端数据
XiaoFeng.DouYin XiaoFeng.DouYin 抖音开放平台SDK 抖音开放平台接口
XiaoFeng.KuaiShou XiaoFeng.KuaiShou 快手开放平台SDK 快手开放平台接口
XiaoFeng.Mvc.AdminWinDesk XiaoFeng.Mvc.AdminWinDesk XiaoFeng.Mvc后台皮肤 模仿windows桌面后台皮肤
FayElf.Cube.Blog FayElf.Cube.Blog XiaoFeng.Mvc开发的技术博客 使用低代码开发框架(XiaoFeng.Mvc)+Windows后台皮肤(XiaoFeng.Mvc.AdminWinDesk),开发的一个博客平台。
XiaoFeng.Ofd XiaoFeng.Ofd OFD读写库 OFD 读写处理库,支持文档的生成、文档编辑、文档批注、数字签名、文档合并、文档拆分、文档转换至PDF、文档查询等功能。
XiaoFeng.Templates XiaoFeng.Templates 项目模板 XiaoFeng.Mvc 低代码开发框架,用于创建 ASP.NET Core 应用程序的项目模板。此模板还可以用于 REST API 此模板还可以用于 REST API、Socket 项目模板、Mqtt 项目模板。

XiaoFeng.Mvc

操作说明

打开Program.cs入口文件

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/", () => "Hello World!");

app.Run();

把上边代码替换成

await XiaoFeng.Mvc.ApplicationManager.Load(args).RegisterStarted(a=>{
//启动完成后事件
}).RegisterStoping(a=>{
//停止中事件
}).RegisterStoped(a=>{
//停止后事件
}).RunAsync(() => XiaoFeng.Mvc.WebHost.Create(args, services =>
{
/*可配置services*/
}, app =>
{
/*
可配置app
引用中间件
配置路由
*/
}, endpoint =>
{
/*
配置路由
*/
}, true));

最后一个参数 init:false|true 这个参数是是否初始化数据库及配置,如果是true每次启动都会初始化数据库,如果数据库存在则更新,不存在则生成,如果是false是不会初如化数据库 接下来引用 System.Data.Sqlite 因为当前项目默认数据库用的是sqlite所以要引用,引用sqlite包后,启动项目即可。

配置文件

hosting.json 项目配置

针对站点服务器的配置以及开发中用到的生成模型配置

{
/*Kestrel配置*/
  "Kestrel": {
    "Limits": {
      "MaxConcurrentConnections": 1000000,
      "MaxConcurrentUpgradedConnections": 100000,
      "MaxRequestBodySize": 10485760,
      "MaxRequestBufferSize": 10485760,
      "MaxRequestHeaderCount": 100000,
      "MaxRequestHeadersTotalSize": 1000000,
      "MaxRequestLineSize": 1000000,
      "MaxResponseBufferSize": 1000000,
      "KeepAliveTimeout": "0.00:05:00",
      "RequestHeadersTimeout": "0.00:00:30",
      "MinRequestBodyDataRate": {
        "BytesPerSecond": 240,
        "GracePeriod": "0.00:00:05"
      },
      "MinResponseDataRate": {
        "BytesPerSecond": 240,
        "GracePeriod": "0.00:00:05"
      },
      "Http2": {
        "MaxStreamsPerConnection": 1000,
        "MaxFrameSize": 16384,
        "HeaderTableSize": 4096,
        "MaxRequestHeaderFieldSize": 8192,
        "InitialConnectionWindowSize": 131072,
        "InitialStreamWindowSize": 98304
      },
      "Http3": {
        "HeaderTableSize": 4096,
        "MaxRequestHeaderFieldSize": 8192
      }
    },
    "DisableStringReuse": true,
    "AllowSynchronousIO": true,
    "AddServerHeader": false,
    "AllowResponseHeaderCompression": true,
    "AllowAlternateSchemes": false,
    "EnableAltSvc": false,
    "EndPoints": {
      "Http": {
        "Url": "http://*:8001"/*http监听*/
      },
      "Https": {
        "Url": "https://*:8002",/*https监听*/
        "SslProtocols": [ "Tls12", "Tls13" ],
        "Sni": {
          "*": {},
          "a.eelf.cn": {
            "Certificate": {
              "Path": "",/*pem路径*/
              "KeyPath": ""/*key路径*/
            }
          },
          "b.eelf.cn": {
            "Certificate": {
              "Path": "",/*证书路径*/
              "Password": ""/*证书密码*/
            }
          },
          "c.eelf.cn": {
            "Certificate": {
              "Subject": "",/*证书名称*/
              "Store": ""/*存储名称*/
            }
          }
        }
      }
    }
  },
  /*form配置*/
  "FormOptions": {
    "BufferBody": false,
    "BufferBodyLengthLimit": 10485760,
    "MemoryBufferThreshold": 65536,
    "MultipartBodyLengthLimit": 10485760,
    "MultipartBoundaryLengthLimit": 128,
    "MultipartHeadersCountLimit": 128,
    "MultipartHeadersLengthLimit": 16384,
    "KeyLengthLimit": 2048,
    "ValueLengthLimit": 4194304,
    "ValueCountLimit": 1024
  },
  /*HttpLogging配置*/
  "HttpLogging": {
    "LoggingFields": "All",
    "RequestHeaders": [ ":method", "Cookie", "Origin", "Referer", "If-Modified-Since", "If-None-Match", "sec-ch-ua", "sec-ch-ua-mobile", "sec-ch-ua-platform", "sec-fetch-site", "sec-fetch-mode", "sec-fetch-user", "sec-fetch-dest", "Upgrade-Insecure-Requests" ],
    "ResponseHeaders": [ "Company", "Author", "QQ", "Email", "Content-Encoding", "ETag", "Vary" ],
    "MediaTypeOptions": [ "text/html", "application/json", "text/javascript", "text/xml" ],
    "RequestBodyLogLimit": 10485760,
    "ResponseBodyLogLimit": 10485760
  },
  "W3CLogging": {
    "LoggingFields": "All",
    "FileName": "FAYELF-W3C-",
    "FileSizeLimit": 10485760,
    "FlushInterval": "0.00:00:05",
    "RetainedFileCountLimit": 1000,
    "LogDirectory": "./logs"
  },
  /*日志级别配置*/
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "System": "Information",
      "Microsoft": "Information"
    }
  },
  /*基础配置*/
  "Settings": {
    "IsRuning": true,/*是否运行,如果false则表示停止运行,实际站点在运行着,只是不让访问*/
    "Init": false,/*是否初始化数据,比如后台配置xml,配置文件等*/
    "EnableAdmin": false,/*是否启动后台*/
    "StartupAfterOpenHome": true,/*启动后是否通过浏览器打开当前系统访问地址*/
    "CloseDescription": "网站未授权...",/*关闭站点时,显示的内容*/
    "AdminHome": "",/*后台登录后进入的页面*/
    "VirtalFolder": "",/*虚拟目录*/
    "EnableAdministrator": false,/*是否启动超过管理员*/
    "Administrator": "9B76E4C95D2CFA2CFD55D119BCC37119586AAFD838D60561A8396ED00FF2D4AC"/*超级管理员账号及密码*/
  },
  /*版权信息*/
  "Copyright": {
    "Author": "Jacky",
    "Company": "FAYELF",
    "QQ": "7092734",
    "Email": "jacky@eelf.cn",
    "Phone": "15837199978",
    "Site": "www.eelf.cn",
    "Description": "Copyright © (2018 - 2025) FAYELF All Rights Reserved.",
    "Server": "FAYELF"
  },
  /*版本信息*/
  "Version": {
    "Cms": "3.0",
    "Admin": "3.0",
    "Api": "3.0"
  },
  /*生成模型信息*/
  "ModelData": {
    "Key": "FayElf.Cube.CMS",/*数据库key 是在DataBase.json中对应的key*/
    "NameSpace": "FayElf.CMS.Model",/*生成模型的命名空间*/
    "Path": "../FayElf.CMS.Model/Model"/*生成模型文件保存路径*/
  }
}

XiaoFeng.json 配置

{
  "Debug"/*是否启用调试*/: true,
  "Error"/*错误信息是否展示到页面 2抛出异常 1展示 0转向*/: 1,
  "MaxWorkerThreads"/*最大线程数量*/: 100,
  "IdleSeconds"/*消费日志空闲时长*/: 60,
  "DataEncrypt"/*是否启用数据加密*/: false,
  "DataKey"/*加密数据key*/: "7092734",
  "ServerLogging"/*是否开启请求日志*/: false,
  "IsIntercept"/*是否拦截*/: false,
  "SQLInjection"/*SQL注入串*/: "insert\\s+into |update |delete |select | union | join |exec |execute | exists|'|truncate |create |drop |alter |column |table |dbo\\.|sys\\.|alert\\(|<scr|ipt>|<script|confirm\\(|console\\.|\\.js|<\\/\\s*script>|now\\(\\)|getdate\\(\\)|time\\(\\)| Directory\\.| File\\.|FileStream |\\.Write\\(|\\.Connect\\(|<\\?php|show tables |echo | outfile |Request[\\.\\(]|Response[\\.\\(]|eval\\s*\\(|\\$_GET|\\$_POST|cast\\(|Server\\.CreateObject|VBScript\\.Encode|replace\\(|location|\\-\\-"
}

DataBase.json 数据库配置

项目中所有的数据库配置全在这个配置文件中

{
  "FayElf.Cube.Admin": [
    {
      "ProviderType" /*驱动类型*/: "SQLite",
      "ConnectionString" /*数据库连接字符串*/: "Data Source={/}\\AppData\\FayElf.Cube.Admin.db3;Version=3;Cache Size=5000;Pooling=True;Max Pool Size=100;",
      "IsTransaction" /*是否启用事务处理*/: true,
      "CommandTimeOut" /*执行超时时间*/: 300,
      "CacheTimeOut" /*缓存时长 单位为秒 0为永久缓存*/: 60,
      "CacheType" /*缓存类型 -1 默认,0 不缓存,1 内存,2 磁盘,3 Redis,4 Memcache,5 MongoDB*/: 0,
      "IsolationLevel" /*事务级别*/: 6,
      "IsPool" /*是否启用连接池*/: false,
      "MaxPool" /*连接池最大数量*/: 100
    }
  ]
}

Cache.json 缓存配置

{
  "CacheKey"/*缓存Key*/: "FAYELF_CACHE",
  "CacheType"/*缓存类型 不缓存: No,  内存: Memory,  磁盘: Disk,  Redis: Redis,  Memcache: Memcache,  MongoDB: MongoDB*/: "Memory",
  "CachePath"/*缓存路径*/: "Cache",
  "ConnectionConfig"/*数据库配置*/: {
    "ProviderType"/*驱动类型*/: "Redis",
    "ConnectionString"/*数据库连接字符串*/: "server=127.0.0.1;port=6379;password=;",
    "IsTransaction"/*是否启用事务处理*/: false,
    "CommandTimeOut"/*执行超时时间*/: 0,
    "CacheTimeOut"/*缓存时长 单位为秒 0为永久缓存*/: 600,
    "CacheType"/*缓存类型 -1 默认,    0 不缓存,    1 内存,    2 磁盘,    3 Redis,    4 Memcache,    5 MongoDB*/: 0,
    "IsolationLevel"/*事务级别*/: 6,
    "IsPool"/*是否启用连接池*/: false,
    "MaxPool"/*连接池最大数量*/: 100
  }
}

Logger.json 日志配置

{
  "OpenLog" /*开启日志*/: true,
  "StorageDays" /*日志存储天数*/: 30,
  "Path" /*日志存储路径*/: "Log",
  "FileLength" /*单文件最大内容长度 0不限制 单位字节*/: 10000000,
  "MaxThreads" /*最大线程数*/: 3,
  "LogLevel" /*日志级别*/: "Trace",
  "ConsoleFlags" /*输出控制台标识*/: "Trace, Debug, Task, Info, Warn, Error",
  "FileFlags" /*输出文件标识*/: "Trace, Debug, Task, Info, Warn, Error",
  "DataBaseFlags" /*输出数据库标识*/: "Trace, Debug, Task, Info, Warn, Error",
  "StorageType" /*存储类型*/: "File, Console",
  "ConnectionStringKey" /*数据库连接字符串KEY*/: null,
  "InsertSql" /*插入SQL数据标识 日志类型 { LogType } 日志消息 { Message } 日志错误ID { ErrorID } 错误堆栈 { StackTrace } 堆栈跟踪 { Tracking } 错误源 { DataSource } 类名 { ClassName } 方法名 { FunctionName } 访问地址 { RequestUrl } 日志时间 { AddTime }*/: "INSERT INTO ZW_Tb_Log(LogType,Message,StackTrace,Tracking,DataSource,AddTime) values('{LogType}','{Message}','{StackTrace}','{Tracking}','{DataSource}','{AddTime}');",
  "Fields" /*记录信息字段*/: "LogType,ErrorID,FunctionName,ClassName,Message,DataSource,StackTrace,Tracking,RequestUrl,AddTime",
  "MessageType" /*消息类型展示*/: "Name"
}

Upload.json 上传配置

{
  "IsOpen"/*是否开启上传*/: true,
  "IsCheckTrojan"/*是否检测文件木马*/: true,
  "TrojanFeature"/*木马特征*/: "request[\\[\\(\\s]|eval|alert|document\\.|response\\.|system|excute|redirect|delete |create |exec |select |update |\\.asp|\\.php|\\.aspx|\\.ashx|\\.jsp|\\.asmx|\\.js| table | file|for\\(|foreach|drop |alter |dbo\\.|sys\\.|<script|\\.getfolder|\\.createfolder|\\.deletefolder|\\.createdirectory|\\.deletedirectory|\\.saveas|wscript\\.shell|script\\.encode|server\\.|\\.createobject|execute|activexobject|language=|echo|<\\?php|iframe",
  "MaxLength"/*最大允许上传大小 单位为B 默认为10M*/: 1048576000,
  "FileNameFormat"/*生成文件名格式*/: "ELF_{yyyy}{MM}{dd}{HH}{mm}{ss}{fff}_{rnd4}.{ext}",
  "UploadPath"/*上传目录*/: "UpLoadFiles",
  "Default"/*默认上传类型配置*/: {
    "Path"/*存放文件夹名*/: "Other",
    "Ext"/*后缀名 多个用逗号隔开*/: "html,htm,txt,xml,jpg,jpeg,gif,bmp,png,rar,zip,7z,doc,xls,ppt,pdf,wmv,wma,flv,mp3,mp4,wpeg,swf"
  },
  "Data"/*上传类型配置*/: {
    "Warn": {
      "Path": "Voice",
      "Ext": "avi,mp3,wav"
    }
  },
  "ImageCompressEnable"/*是否启用图片压缩*/: true,
  "ImageCompressLength"/*图片压缩最长边限制*/: 1000,
  "ImageCompressQuality"/*图片压缩质量*/: 100,
  "IsDomain"/*上传路径是否带域名*/: false,
  "Domain"/*域名*/: ""
}

StaticFiles.xml 静态目录配置

<?xml version="1.0" encoding="utf-8"?>
<Root>
  <StaticFile DirectoryBrowsing="false">
    <ServerPath><![CDATA[Html]]></ServerPath>
  </StaticFile>
  <StaticFile DirectoryBrowsing="false">
    <ServerPath><![CDATA[UEditor]]></ServerPath>
    <RequestPath><![CDATA[/UEditor]]></RequestPath>
  </StaticFile>
  <StaticFile DirectoryBrowsing="false">
    <ServerPath><![CDATA[UploadFiles]]></ServerPath>
    <RequestPath><![CDATA[/UploadFiles]]></RequestPath>
  </StaticFile>
</Root>

ProgramSet.json 项目配置

{
  "AppId"/*应用ID*/: "100001",
  "ProgramName"/*项目名称*/: "魔法精灵",
  "ProgramSite"/*项目网址*/: "www.eelf.cn",
  "KeyWords"/*关键词*/: "魔法精灵",
  "Description"/*项目描述*/: "魔法精灵",
  "Logo": "",
  "IsOpenRegister"/*是否开放注册*/: false,
  "IsLogin"/*是否开放登录*/: false,
  "IsRuning"/*网站是否运行*/: true,
  "CloseDescription"/*关闭站点说明*/: "网站维护中...",
  "LayOut"/*前台模板页*/: "/_Views/Shared/_CMSLayout.cshtml",
  "AdminLayOut"/*后台模板页*/: "/_Views/Shared/_AdminLayout.cshtml",
  "EnableCompress"/*是否启用压缩功能*/: true,
  "IsOpenSSL"/*是否开启SSL*/: false,
  "IsTicket"/*是否验证票据*/: false,
  "AdminAreaName"/*后台目录名*/: "Admin",
  "UserAreaName"/*前台会员目录名*/: "User",
  "IsOpenApi"/*是否开启WebAPI*/: false,
  "IsToolsApi"/*是否显示通用API*/: false,
  "IsSign"/*是否验证签名*/: false,
  "SignKey"/*签名Key*/: "",
  "SignTimeOut"/*签名超时时间*/: 300,
  "AllowCross"/*是否允许跨域访问*/: false,
  "BaiduMapKey"/*百度地图Key*/: "",
  "AdminLoginCaptcha"/*后台登录验证码类型*/: "ClickPicture",
  "AdminLoginCaptchaLength"/*后台登录验证码位数*/: 5,
  "MemberLoginCaptcha"/*会员登录验证码类型*/: "DbNull",
  "MemberLoginCaptchaLength"/*会员登录验证码位数*/: 5,
  "EditorUploadType"/*编辑器上传权限*/: "Anonymous",
  "OpenOSS"/*是否启用OSS存储*/: false,
  "OssType"/*存储类型*/: "Local",
  "RegistrationCode"/*注册码*/: "",
  "FrameOptions"/*允许嵌入框架类型*/: "NONE",
  "AllowFromUri"/*允许嵌入的域名*/: "",
  "ContentSecurityPolicy"/*内容安全策略(CSP)*/: "",
  "Headers"/*Header头*/: "",
  "IsWebSocket"/*是否启用WebSocket*/: true,
  "WebSocketPath"/*WebSocket路径*/: "ws",
  "UserLogin"/*前台登录路径*/: "/{User}/Login",
  "AdminLogin"/*后台登录路径*/: "{Admin}/Login",
  "AdminLoginUrl"/*后台登录请求地址*/: "",
  "UserStateRedisConnectionString"/*登录状态存储Redis连接串*/: "",
  "UserStateStorage"/*前台登录状态存储类型*/: "Cookie",
  "AdminStateStorage"/*后台登录状态存储类型*/: "Cookie",
  "IsOpenHttpLog"/*启用Http日志*/: false,
  "IsOpenW3CLog"/*启用W3C日志*/: false,
  "IsParsePhone"/*是否解析手机归属地*/: false,
  "IsParseIP"/*是否解析IP地址*/: false,
  "IsParseCity"/*是否解析城市编码地址*/: false,
  "Error"/*错误信息是否展示到页面 2抛出异常 1展示 0转向*/: "Show",
  "AdminTheme"/*后台主题*/: "",
  "WindowsWidth"/*后台弹窗默认宽*/: 685,
  "WindowsHeight"/*后台弹窗默认高*/: 685,
  "UEditorDomain"/*编辑器域名*/: "",
  "ToolbarEvent"/*Toolbar事件*/: "Reload, Filter, Print, Exports",
  "UserAccountMinimumLength"/*前台账号最小长度*/: 5,
  "UserPasswordMinimumLength"/*前台密码最小长度*/: 5,
  "UserAccountPolicy"/*前台账号规则*/: "",
  "UserPasswordPolicy"/*前台密码规则*/: "",
  "AdminAccountMinimumLength"/*后台账号最小长度*/: 5,
  "AdminPasswordMinimumLength"/*后台密码最小长度*/: 5,
  "AdminAccountPolicy"/*后台账号规则*/: "",
  "AdminPasswordPolicy"/*后台密码规则*/: "",
  "RedirectDomain"/*允许跳转外站域名*/: "wpa.qq.com,github.com"
}

ContentType.xml 站点支持文件类型

<?xml version="1.0" encoding="utf-8"?>
<Root>
  
  <TConfig>
    
    <Ext><![CDATA[.wmv]]></Ext>
    
    <Mime><![CDATA[video/x-ms-wmv]]></Mime>
  </TConfig>
  <TConfig>
    
    <Ext><![CDATA[.mp4]]></Ext>
    
    <Mime><![CDATA[video/mpeg4]]></Mime>
  </TConfig>
  <TConfig>
    
    <Ext><![CDATA[.mpeg]]></Ext>
    
    <Mime><![CDATA[video/mpg]]></Mime>
  </TConfig>
  <TConfig>
    
    <Ext><![CDATA[.mpg]]></Ext>
    
    <Mime><![CDATA[video/mpg]]></Mime>
  </TConfig>
</Root>

后台页面配置

后台页面配置文件都是系统通过后台控制器自动生成的文件,我们只需要作微调即可,也可以从后台页面配置管理去操作页面里的属性值。

后台页面配置文件都存放于根目录下 Config/Admin中,我们这里拿一个后台管理账号配置来解释一下。

Pages节点下包括了 5个Page 分别是 List 列表页 Delete 删除页 Add 添加 Edit页 编辑 Detail 详情页

<?xml version="1.0" encoding="utf-8"?>
<Pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" DataName="FayElf.Cube.Admin" TypeName="XiaoFeng.Mvc.Config.Page.AdminAdminUser" Description="管理员管理页配置">
	<Page Name="Delete" DataName="FayElf.Cube.Admin" Description="删除" PageType="Delete" ModelType="XiaoFeng.Mvc.Model.Admin.ZWTbAdminListModel, XiaoFeng.Mvc" IsPage="true" IsToolBar="true" IsBox="true" IsNum="true" PageSize="10">
	</Page>
	<Page Name="List" DataName="FayElf.Cube.Admin" Description="管理员列表" PageType="List" ModelType="XiaoFeng.Mvc.Model.Admin.VIEWAdminModel, XiaoFeng.Mvc" IsPage="true" IsToolBar="true" SqlOrder="Id desc" IsBox="true" IsNum="true" PageSize="20">
		<Script>
			<![CDATA[      
     var SetPass = function(o,data,json){
	     ZW.CMS.SetFieldData(AdminAreaName +'/AdminUser',{WhereName:'ID',WhereValue:json["ID"],FieldName:'Pass',FieldValue:data.elem.checked});
	     return;
     }    
    ]]>
		</Script>
		<LayScript>
			<![CDATA[
      if(event == 'resetpwd'){
        $.ajax({
          type:"post",
          url:Path + 'ResetPwd',
          data:{ID:data.ID},
          success:function(e){
            if(e.status == 'success'){
              layer.alert(e.message,{icon:1});
            }else{
              layer.alert('操作失败['+e.message+']',{icon:2});
            }
          }
        });
      }
    ]]>
		</LayScript>
		<Tabs TabType="DbNull" EventType="DbNull" />
		<Fields>
			<Field Name="ID" Description="ID" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="false" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="Account" Description="用户账号" FieldType="label" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="160" MinWidth="0" Height="0" Visible="true" Link="Detail" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="GroupName" IsField="false" Description="所属角色" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="RealName" Description="真实姓名" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="100" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="GroupID" Description="GroupID" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="false" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="Phone" Description="手机" FieldType="labeltext" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="180" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="Pass" Description="状态" FieldType="checkbox1" Data="正常|锁定" DefaultValue="" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="100" MinWidth="0" Height="0" Visible="true" Format="" Align="center" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="SetPass" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="LoginCount" Description="登录次数" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="90" MinWidth="0" Height="0" Visible="true" Format="" Align="center" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="LoginTime" Description="登录时间" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="145" MinWidth="0" Height="0" Visible="true" Format="" ValueFormat="Date:yyyy-MM-dd HH:mm:ss" Align="center" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
		</Fields>
		<Buttons Width="0">
			<Button AuthID="3" ButtonType="button" Event="DbNull" Class="layui-btn-danger" Title="批量删除" lay-event="deletes" lay-submit="true" win-type="Null" win-width="0" win-height="0" Visible="true"><![CDATA[<i class="layui-icon">&#xe640;</i>批量删除]]></Button>
			<Button AuthID="1" ButtonType="button" Event="DbNull" Class="" Title="添加" lay-event="add" lay-submit="true" win-type="Null" win-width="0" win-height="550" Visible="true"><![CDATA[<i class="layui-icon">&#xe654;</i>添加]]></Button>
		</Buttons>
		<Menus Width="135">
			<Button AuthID="4" ButtonType="button" Event="DbNull" Class="layui-btn-xs" Title="详情" lay-event="detail" lay-submit="false" win-type="Null" win-width="0" win-height="0" Visible="true"><![CDATA[<i class="layui-icon">&#xe65f;</i>]]></Button>
			<Button AuthID="2" ButtonType="button" Event="DbNull" Class="layui-btn-xs" Title="编辑" lay-event="edit" lay-submit="false" win-type="Null" win-width="0" win-height="0" Visible="true"><![CDATA[<i class="layui-icon">&#xe642;</i>]]></Button>
			<Button AuthID="3" ButtonType="button" Event="DbNull" Class="layui-btn-xs layui-btn-danger" Title="删除" lay-event="delete" lay-submit="false" win-type="Null" win-width="0" win-height="0" Visible="true"><![CDATA[<i class="layui-icon">&#xe640;</i>]]></Button>
			<Button AuthID="2" ButtonType="button" Event="DbNull" Class="layui-btn-xs layui-btn-warm" Title="重置密码" lay-event="resetpwd" lay-submit="false" win-type="Null" win-width="0" win-height="0" Visible="true"><![CDATA[<i class="zw-icon">&#xe104;</i>]]></Button>
		</Menus>
		<Querys>
			<Query Name="key" Description="关键词" FieldType="text" DefaultValue="" Must="true" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="(Account like '%{0}%' or RealName like '%{0}%' or NickName like '%{0}%' or Email like '%{0}%')" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="key" InLine="true" PassWordType="DbNull" />
			<Query Name="Pass" Description="管理员状态" FieldType="select" Data="正常$1|锁定$0" DefaultValue="" Must="true" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="Pass" InLine="true" PassWordType="DbNull" />
			<Query Name="GroupID" Description="角色" FieldType="select" Data="SQL:select Name,ID from ZW_Tb_Groups#FayElf.Cube.Admin" DefaultValue="" Must="true" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="instr(','||GroupID||',',','||{0}||',')>0" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="GroupID" InLine="true" PassWordType="DbNull" />
		</Querys>
	</Page>
	<Page Name="Edit" DataName="FayElf.Cube.Admin" Description="编辑管理员" PageType="Update" ModelType="XiaoFeng.Mvc.Model.Admin.ZWTbAdminListModel, XiaoFeng.Mvc" SqlOrder="AddDate Desc" IsPage="false" IsToolBar="false" IsBox="false" IsNum="false" PageSize="20">
		<Tabs TabType="DbNull" EventType="DbNull" />
		<Fields>
			<Field Name="Account" Description="用户账号" FieldType="text" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="false" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="RealName" Description="真实姓名" FieldType="text" Data="" DefaultValue="" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
			<Field Name="NickName" Description="昵称" FieldType="text" Data="" DefaultValue="" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
			<Field Name="Email" Description="Email" FieldType="text" Data="" DefaultValue="" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
			<Field Name="Phone" Description="手机" FieldType="text" Data="" DefaultValue="" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
			<Field Name="Pass" Description="用户状态" FieldType="checkbox1" Data="启用|禁用" DefaultValue="true" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="GroupID" Description="角色" FieldType="xmselect" Data="SQL:select Name,ID from ZW_Tb_Groups#FayElf.Cube.Admin" DefaultValue="" Placeholder="" Must="true" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="FunctionID" Description="功能ID" FieldType="text" Data="jacky" DefaultValue="" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="false" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
		</Fields>
	</Page>
	<Page Name="Add" DataName="FayElf.Cube.Admin" Description="添加管理员" PageType="Add" ModelType="XiaoFeng.Mvc.Model.Admin.ZWTbAdminListModel, XiaoFeng.Mvc" IsPage="false" IsToolBar="false" IsBox="true" IsNum="true" PageSize="20">
		<Tabs TabType="DbNull" EventType="DbNull" />
		<Fields>
			<Field Name="Account" Description="用户账号" FieldType="text" Data="" DefaultValue="" Placeholder="" Must="true" MinLength="5" MaxLength="30" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="true" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="Account" InLine="false" PassWordType="DbNull" />
			<Field Name="PassWord" Description="用户密码" FieldType="password" DefaultValue="" Must="true" MinLength="5" MaxLength="30" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="AdminPassWord" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="PassWord" InLine="false" PassWordType="ConfirmStrength" />
			<Field Name="RealName" Description="真实姓名" FieldType="text" Data="" DefaultValue="" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="RealName" InLine="true" PassWordType="DbNull" />
			<Field Name="NickName" Description="昵称" FieldType="text" Data="" DefaultValue="" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="NickName" InLine="true" PassWordType="DbNull" />
			<Field Name="Email" Description="Email" FieldType="text" Data="" DefaultValue="" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="Email" InLine="true" PassWordType="DbNull" />
			<Field Name="Phone" Description="手机" FieldType="text" Data="" DefaultValue="" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="Phone" InLine="true" PassWordType="DbNull" />
			<Field Name="Pass" Description="用户状态" FieldType="checkbox1" Data="启用|禁用" DefaultValue="true" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="Pass" InLine="false" PassWordType="DbNull" />
			<Field Name="GroupID" Description="角色" FieldType="xmselect" Data="SQL:select Name,ID from ZW_Tb_Groups#FayElf.Cube.Admin" DefaultValue="" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="GroupID" InLine="false" PassWordType="DbNull" />
			<Field Name="FunctionID" Description="功能ID" FieldType="text" Data="" DefaultValue="jacky" Placeholder="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="false" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" lay-filter="FunctionID" InLine="false" PassWordType="DbNull" />
		</Fields>
	</Page>
	<Page Name="Detail" DataName="FayElf.Cube.Admin" Description="管理员详情" PageType="Detail" ModelType="XiaoFeng.Mvc.Model.Admin.VIEWAdminModel, XiaoFeng.Mvc" IsPage="false" IsToolBar="false" IsBox="true" IsNum="true" PageSize="10">
		<Tabs TabType="Group" EventType="DbNull" />
		<Fields>
			<Field Name="Account" Description="用户账号" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="RealName" Description="真实姓名" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
			<Field Name="NickName" Description="昵称" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
			<Field Name="Email" Description="Email" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
			<Field Name="Phone" Description="手机" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
			<Field Name="Pass" Description="用户状态" FieldType="label" Data="[.zw-tag-success:正常]$true|[.zw-tag-disabled:锁定]$false" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="FunctionID" Description="功能ID" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="trie" PassWordType="DbNull" />
			<Field Name="GroupName" Description="角色" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="LoginCount" Description="登录次数" FieldType="label" Data="" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
			<Field Name="LoginTime" Description="登录时间" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" ValueFormat="Date:yyyy-MM-dd HH:mm:ss" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
			<Field Name="LoginIP" Description="登录IP" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
			<Field Name="AddDate" Description="创建时间" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" ValueFormat="Date:yyyy-MM-dd HH:mm:ss" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="true" PassWordType="DbNull" />
		</Fields>
	</Page>
	<Page Name="ModifyPwd" DataName="FayElf.Cube.Admin" Description="修改密码" PageType="Update" ModelType="XiaoFeng.Mvc.Model.Admin.ZWTbAdminListModel, XiaoFeng.Mvc" IsPage="true" IsToolBar="true" IsBox="true" IsNum="true" PageSize="10">
		<Tabs TabType="DbNull" EventType="DbNull" />
		<Fields>
			<Field Name="Account" Description="用户账号" FieldType="text" Data="" DefaultValue="" Must="true" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="false" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="PassWord" Description="原密码" FieldType="password" Data="" DefaultValue="" Must="true" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="NewPassWord" Description="新密码" FieldType="password" DefaultValue="" Must="true" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="ConfirmStrength" />
		</Fields>
	</Page>
	<Page Name="Profile" DataName="FayElf.Cube.Admin" Description="管理员详情" PageType="Detail" ModelType="XiaoFeng.Mvc.Model.Admin.VIEWAdminModel, XiaoFeng.Mvc" IsPage="false" IsToolBar="false" IsBox="true" IsNum="true" PageSize="10">
		<Tabs TabType="Group" EventType="DbNull" />
		<Fields>
			<Field Name="Account" Description="用户账号" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="RealName" Description="真实姓名" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="NickName" Description="昵称" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="Email" Description="Email" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="Phone" Description="手机" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
			<Field Name="GroupName" IsField="false" Description="角色" FieldType="label" DefaultValue="" Must="false" MinLength="-1" MaxLength="-1" Sort="true" Width="0" MinWidth="0" Height="0" Visible="true" Format="" Align="left" Unique="false" Encrypt="No" Disabled="true" Checked="false" CallBack="" Resize="true" Event="DbNull" InLine="false" PassWordType="DbNull" />
		</Fields>
	</Page>
</Pages>

Page 属性介绍

属性名 值类型 说明
Name 字符串 页面名称
DataName 字符串 数据库名称 也就是DataBase.json 中的key
Description 字符串 页面说明
PageType PageType枚举 页面类型,标识当前配置页是什么类型的有 Add,List,Delete,Edit等详情见下面的PageType枚举
ModelType 字符串 当前数据表模型名称如 XiaoFeng.Mvc.Model.Admin.VIEWAdminModel, XiaoFeng.Mvc
IsPage 布尔型 是否带有分布功能,列表才起作用
IsToolBar 布尔型 是否启用ToolBar功能,列表有效
SqlOrder 字符串 列表排序
IsBox 布尔型 列表行前是否有复选框列
IsNum 布尔型 列表行前是否有序号列
PageSize 数字型 表示列表页每页多少条数据
RowClickCallBack 字符串 行点击回调函数
CellEditCallBack 字符串 单元格点击编辑回调函数
PageUrl 字符串 当前列表页请求数据地址,默认不填自动请求默认的请求数据接口
PrimaryKey 字符串 表主键字段
ListType ListType枚举 详情见下面的ListType枚举,主要是用于列表是否折叠功能
ParentID 字符串或数值类型 父节点ID,主要用于有父节点可折叠的列表
IconIndex 数值型 图标放在第几列
Method 字符串 请求类型GET,POST,HEAD,OPTIONS,DELETE等
Width 字符串或数字 设置容器宽度,默认是自适应,如果是像素则为数字类型,百分比用字符串类型
Height 字符串或数字 设置容器高度,默认是自适应,如果是像素则为数字类型,百分比用字符串类型
Skin ListSkin枚举 列表边框风格
Size ListSize枚举 表格尺寸
Even 布尔型 是否开启隔行背景
ClassName 字符串 表格样式

Page 节点介绍

节点名称 值类型 说明
Script 字符串 全局javascript脚本
LoadScript 字符串 页面加载完后调用javascript脚本
LoadDataScript 字符串 加载完数据脚本javascript脚本
LayScript 字符串 LayScript javascript脚本
SubmitScript 字符串 表单提交时 javascript脚本
SearchScript 字符串 搜索提交时 javascript脚本
SqlWhere 字符串 SQL条件
Tabs 集合 切换卡,详情见下面表格说明
Fields 集合 字段控件集合,详情见下面表格说明
Buttons 集合 按扭控件集合,详情见下面表格说明
Menus 集合 行菜单控件集合,详情见下面表格说明
Querys 集合 搜索控件集合,详情见下面表格说明
HeadTemplate 模板 头部模板
FootTemplate 模板 尾部模板
FormPlugins 字符串 当前页面所用到的控件插件
TreeTableTree 集合 treetable组件特定属性集

Tabs 切换卡属性

属性名称 值类型 说明
TabType 枚举 TabType枚举,详情见下面枚举
Class 字符串 样式类
ActiveClass 字符串 激活样式类
EventType 枚举 事件类型,详情见下面枚举
CallBack 字符串 事件回调函数或脚本

Tabs 切换卡节点

属性名称 值类型 说明
Tab 集合 一个切换卡片,详情见下面卡片属性

Tab 切换卡节点

属性名称 值类型 说明
Name 字符串 切换卡节点名称
Description 字符串 节点说明
Class 字符串 节点样式类名
Index 数值型 索引排序
Style 字符串 节点样式内容
Visible 布尔型 是否显示,true为显示,false为隐藏
Url 字符串 节点内容Url,默认为空,自动对应当前页面下切换卡内容,如果设置url,则切换卡内容为url内容

Fields 字段集合属性

暂时没有,以后肯定会用

Fields 字段集合节点

属性名称 值类型 说明
Field 集合 字段属性集合,详情见下面字段属性

Field 字段属性

属性名称 值类型 说明 适用页面类型
Name 字符串 字段名称 所有
Description 字符串 字段说明 所有
Class 字符串 字段样式类名 所有
Style 字符串 字段样式内容 所有
Visible 布尔型 是否显示,true为显示,false为隐藏 所有
FieldType 枚举 字段控件类型,设置当前控件为输入框还是密码框,多选框等,详情见下面的枚举 FieldType 所有
DefaultValue 字符串 控件默认值 所有
Data 字符串 主要用至下拉框数据 所有
Placeholder 字符串 HTML5控件显示值 所有
Must 布尔型 控件是否是必填 所有
Tips 字符串 控件提示信息 所有
Pattern 正式表达式 控件值符合规则 Add,Edit
MinLength 数值型 控件值最小长度 Add,Edit
MaxLength 数值型 控件值最大长度 Add,Edit
MinValue 数值型 控件值最小值 Add,Edit
MaxValue 数值型 控件值最大值 Add,Edit
Sort 布尔型 控件是否有排序功能,用于表类型为List时使用 List
Width 数值型 控件宽度 所有
MinWidth 数值型 控件最小宽度 所有
Height 数值型 控件高度 所有
MinHeight 数值型 控件最小高度 所有
Format 字符串 条件格式,用于搜索框中查询SQL List
ValueFormat 字符串 值格式 Detail,List
Link 字符串 连接事件名称 Detail,List
Align 字符串 控件布局,值为 left,center,right 所有
Unique 布尔型 是否是唯一,在提交表单中使用则会自动增加验证是否是唯一事件 Add,Edit
Encrypt 枚举 加密类型,详情见下面枚举EncryptType Add,Edit
Disabled 布尔型 是否可用,见Html5中的disabled Add,Edit
Checked 布尔型 是否选中 所有
Unit 单位 控件单位 所有
TabName 字符串 所属那个切换卡,就是Tab属性中的Name 所有
FirstOption 字符串 默认选项,主要用于下拉框首选项的配置 所有
Event 枚举 控件事件,详情见下面EventType 所有
Resize 布尔型 是否可拖动 列表,多文本框
LayFilter 字符串 Layui的Filter Add,Edit
InLine 布尔型 是否独立一行 所有
PassWordType 枚举 密码框类型,详情见下面PassWordType枚举 Add,Edit
AuthID 字符串 权限ID 所有
ForeginKey 字符串 外键 所有
IsField 布尔型 是否是数据库表字段 所有
Condition 字符串 控件条件,当前值为Field的内容值 所有
FixedValue 字符串 控件固定值 所有
Fixed 字符串 控件固定方向 所有
ShowEye 布尔型 主要用于密码框中是否显示眼睛图标 Add,Edit
ShowClear 布尔型 主要用于输入框中是否有一个清空图标 Add,Edit
Options 字符串 多种控件的配置数据 所有
Step 数值型 步长 所有
AutoComplete 枚举 自动完成,详情见下面AutoCompleteType Add,Edit
ReadOnly 布尔型 是否是只读 Add,Edit
Rows 数值型 行数,用于多文本输入框 Add,Edit
Columns 数值型 列数,用于多文本输入框 Add,Edit
PageModel 枚举 页面模式,用于混合页时,比如一个页里有多个配置Page时使用 所有
PageUrl 字符串 页面地址 所有
HeaderLevel 数值型 头级别,主要用于合并头

Button 字段属性

属性名称 值类型 说明
Name 字符串 字段名称
AuthID 字符串 权限ID
ButtonType 枚举 按扭类型,详情见下面ButontType枚举字段
Evemt 枚举 事件类型,详情见下面EventType枚举字段
Description 字符串 字段说明
Class 字符串 字段样式类名
Style 字符串 字段样式内容
Visible 布尔型 是否显示,true为显示,false为隐藏
Content 字符串 当前节点内容,主要是Button文本内容
Title 字符串 鼠标放在按扭上的都显示内容
LayEvent 字符串 Layui中事件名称
LayFilter 字符串 Layui中lay-filter内容
LaySubmit 布尔型 是否是提交按扭
Value 字符串 按扭值
Url 字符串 按扭请求地址或方法
Data 字符串 当按扭类型ButtonType为dropdown时使用
WindowType 枚举 弹出窗口类型,仅当弹出窗口时使用,详情见下面WindowType枚举
WindowWidth 数值型 弹出窗口的宽度
WindowHeight 数值型 弹出窗口的高度

Query字段属性

这两种都是继承了 Button 的字段属性

PageType 枚举 页面类型
/// <summary>
/// 页面类型
/// </summary>
public enum PageType
{
    /// <summary>
    /// 详情
    /// </summary>
    [Description("详情")]
    Detail = 0,
    /// <summary>
    /// 添加
    /// </summary>
    [Description("添加")]
    Add = 1,
    /// <summary>
    /// 编辑
    /// </summary>
    [Description("编辑")]
    Update = 2,
    /// <summary>
    /// 列表
    /// </summary>
    [Description("列表")]
    List = 3,
    /// <summary>
    /// 混合
    /// </summary>
    [Description("混合")]
    Mix = 4,
    /// <summary>
    /// 代码编辑
    /// </summary>
    [Description("代码编辑")]
    EditCode = 5,
    /// <summary>
    /// 代码预览
    /// </summary>
    [Description("代码预览")]
    ViewCode = 6,
    /// <summary>
    /// 删除
    /// </summary>
    [Description("删除")]
    Delete = 7
}
ListType 枚举 列表类型
/// <summary>
/// 列表类型
/// </summary>
public enum ListType
{
    /// <summary>
    /// List
    /// </summary>
    [Description("List")]
    List = 0,
    /// <summary>
    /// TreeList
    /// </summary>
    [Description("TreeList")]
    TreeList = 1,
    /// <summary>
    /// TreeTable
    /// </summary>
    [Description("TreeTable")]
    TreeTable = 2
}
TabType 枚举 选项卡类型
/// <summary>
/// 选项卡类型
/// </summary>
public enum TabType
{
    /// <summary>
    /// 无
    /// </summary>
    [Description("无")]
    DbNull = 0,
    /// <summary>
    /// 组项
    /// </summary>
    [Description("组项")]
    Group = 1,
    /// <summary>
    /// 切换卡
    /// </summary>
    [Description("切换卡")]
    Tab = 2
}
EventType 枚举 事件类型
/// <summary>
/// 事件类型
/// </summary>
public enum EventType
{
    /// <summary>
    /// 空
    /// </summary>
    [Description("空")]
    DbNull = 0,
    /// <summary>
    /// 单击
    /// </summary>
    [Description("单击")]
    click = 1,
    /// <summary>
    /// 双击
    /// </summary>
    [Description("双击")]
    dblclick = 2,
    /// <summary>
    /// 改变
    /// </summary>
    [Description("改变")]
    change = 3,
    /// <summary>
    /// 获取焦点
    /// </summary>
    [Description("获取焦点")]
    focus = 4,
    /// <summary>
    /// 失去焦点
    /// </summary>
    [Description("失去焦点")]
    blur = 5,
    /// <summary>
    /// 鼠标经过
    /// </summary>
    [Description("鼠标经过")]
    mouseover = 6,
    /// <summary>
    /// 鼠标离开
    /// </summary>
    [Description("鼠标离开")]
    mouseout = 7,
    /// <summary>
    /// 鼠标放上
    /// </summary>
    [Description("鼠标放上")]
    mouseup = 8,
    /// <summary>
    /// 鼠标按下
    /// </summary>
    [Description("鼠标按下")]
    mousedown = 9,
    /// <summary>
    /// 鼠标移动
    /// </summary>
    [Description("鼠标移动")]
    mousemove = 10,
    /// <summary>
    /// 某个键盘的键被按下
    /// </summary>
    [Description("某个键盘的键被按下")]
    keydown = 11,
    /// <summary>
    /// 某个键盘的键被按下或按住
    /// </summary>
    [Description("某个键盘的键被按下或按住")]
    keypress = 12,
    /// <summary>
    /// 某个键盘的键被松开
    /// </summary>
    [Description("某个键盘的键被松开")]
    keyup = 13,
    /// <summary>
    /// 加载出错
    /// </summary>
    [Description("加载出错")]
    error = 14,
    /// <summary>
    /// 加载完成
    /// </summary>
    [Description("加载完成")]
    load = 15,
    /// <summary>
    /// 文本选中
    /// </summary>
    [Description("文本选中")]
    select = 16
}
FieldType 枚举 输入控件类型
/// <summary>
/// 输入控件类型
/// </summary>
public enum FieldType
{
    /// <summary>
    /// 显示
    /// </summary>
    [Description("显示")]
    [FormPlugin("form")]
    label = 0,
    /// <summary>
    /// 文本输入框
    /// </summary>
    [Description("文本输入框")]
    [FormPlugin("form")]
    text = 1,
    /// <summary>
    /// 文本密码框
    /// </summary>
    [Description("文本密码框")]
    [FormPlugin("form")]
    password = 2,
    /// <summary>
    /// 多文本框
    /// </summary>
    [Description("多文本框")]
    [FormPlugin("form")]
    textarea = 3,
    /// <summary>
    /// 下拉框
    /// </summary>
    [Description("下拉框")]
    [FormPlugin("form")]
    select = 4,
    /// <summary>
    /// 隐藏域
    /// </summary>
    [Description("隐藏域")]
    [FormPlugin("form")]
    hidden = 5,
    /// <summary>
    /// 复选框
    /// </summary>
    [Description("复选框")]
    [FormPlugin("form")]
    checkbox = 6,
    /// <summary>
    /// 单选框
    /// </summary>
    [Description("单选框")]
    [FormPlugin("form")]
    radio = 7,
    /// <summary>
    /// 验证码
    /// </summary>
    [Description("验证码")]
    [FormPlugin("element")]
    checkcode = 8,
    /// <summary>
    /// 编辑器
    /// </summary>
    [Description("编辑器")]
    [FormPlugin("element")]
    editor = 9,
    /// <summary>
    /// 权限模块
    /// </summary>
    [Description("权限模块")]
    [FormPlugin("groups")]
    groups = 10,
    /// <summary>
    /// 上传控件
    /// </summary>
    [Description("上传控件")]
    [FormPlugin("upload")]
    file = 11,
    /// <summary>
    /// 多文件上传控件
    /// </summary>
    [Description("多文件上传控件")]
    [FormPlugin("upload")]
    files = 12,
    /// <summary>
    /// 多下拉控件
    /// </summary>
    [Description("多下拉控件")]
    [FormPlugin("select")]
    selects = 13,
    /// <summary>
    /// 日期+时间
    /// </summary>
    [Description("日期+时间")]
    [FormPlugin("laydate")]
    datetime = 14,
    /// <summary>
    /// 日期
    /// </summary>
    [Description("日期")]
    [FormPlugin("laydate")]
    date = 15,
    /// <summary>
    /// 时间
    /// </summary>
    [Description("时间")]
    [FormPlugin("laydate")]
    time = 16,
    /// <summary>
    /// 城市
    /// </summary>
    [Description("城市")]
    [FormPlugin("city")]
    city = 17,
    /// <summary>
    /// 地图
    /// </summary>
    [Description("地图")]
    [FormPlugin("element")]
    map = 18,
    /// <summary>
    /// 拾取坐标
    /// </summary>
    [Description("拾取坐标")]
    [FormPlugin("element")]
    pointmap = 19,
    /// <summary>
    /// 切换复制框
    /// </summary>
    [Description("切换复制框")]
    [FormPlugin("form")]
    checkbox1 = 20,
    /// <summary>
    /// 点击复选框
    /// </summary>
    [Description("点击复选框")]
    [FormPlugin("form")]
    checkbox2 = 21,
    /// <summary>
    /// 页面
    /// </summary>
    [Description("页面")]
    [FormPlugin("element")]
    page = 22,
    /// <summary>
    /// 代码块
    /// </summary>
    [Description("代码块")]
    [FormPlugin("code")]
    code = 23,
    /// <summary>
    /// 代码编辑器
    /// </summary>
    [Description("代码编辑器")]
    [FormPlugin("element")]
    editorcode = 24,
    /// <summary>
    /// 日期区间
    /// </summary>
    [Description("日期区间")]
    [FormPlugin("laydate")]
    dates = 25,
    /// <summary>
    /// 搜索下拉框
    /// </summary>
    [Description("搜索下拉框")]
    [FormPlugin("form")]
    searchselect = 26,
    /// <summary>
    /// 图片控件
    /// </summary>
    [Description("图片控件")]
    [FormPlugin("element")]
    image = 27,
    /// <summary>
    /// 带输入框颜色选择器
    /// </summary>
    [Description("带输入框颜色选择器")]
    [FormPlugin("colorpicker")]
    textcolor = 28,
    /// <summary>
    /// 颜色选择器
    /// </summary>
    [Description("颜色选择器")]
    [FormPlugin("colorpicker")]
    color = 29,
    /// <summary>
    /// 滑块
    /// </summary>
    [Description("滑块")]
    [FormPlugin("slider")]
    slider = 30,
    /// <summary>
    /// 输入框滑块
    /// </summary>
    [Description("输入框滑块")]
    [FormPlugin("slider")]
    textslider = 31,
    /// <summary>
    /// 点击输入框
    /// </summary>
    [Description("点击输入框")]
    [FormPlugin("form")]
    labeltext = 32,
    /// <summary>
    /// 换行
    /// </summary>
    [Description("换行线")]
    [FormPlugin("element")]
    hr = 33,
    /// <summary>
    /// 评分
    /// </summary>
    [Description("评分")]
    [FormPlugin("rate")]
    rate = 34,
    /// <summary>
    /// 换行
    /// </summary>
    [Description("换行")]
    [FormPlugin("element")]
    br = 35,
    /// <summary>
    /// 省市县区街道村选择器
    /// </summary>
    [Description("省市县区街道村选择器")]
    [FormPlugin("citypicker")]
    citypicker = 36,
    /// <summary>
    /// 规格
    /// </summary>
    [Description("规格")]
    [FormPlugin("faysku")]
    sku = 37,
    /// <summary>
    /// 数字输入框
    /// </summary>
    [Description("数字输入框")]
    [FormPlugin("form")]
    number = 38,
    /// <summary>
    /// HTML内容
    /// </summary>
    [Description("HTML内容")]
    [FormPlugin("element")]
    html = 39,
    /// <summary>
    /// 电量
    /// </summary>
    [Description("电量")]
    [FormPlugin("element")]
    power = 40,
    /// <summary>
    /// 进度条
    /// </summary>
    [Description("进度条")]
    [FormPlugin("element")]
    progress = 41,
    /// <summary>
    /// 可输入下拉框
    /// </summary>
    [Description("可输入下拉框")]
    [FormPlugin("form")]
    inputselect = 42,
    /// <summary>
    /// 上传外网文件
    /// </summary>
    [Description("上传外网文件")]
    [FormPlugin("upload")]
    filetext = 43,
    /// <summary>
    /// 上传外网多文件
    /// </summary>
    [Description("上传外网多文件")]
    [FormPlugin("upload")]
    filestext = 44,
    /// <summary>
    /// 多选下拉框
    /// </summary>
    [Description("多选下拉框")]
    [FormPlugin("xmSelect")]
    selectplus = 45,
    /// <summary>
    /// 上传控件不自动上传
    /// </summary>
    [Description("上传控件")]
    [FormPlugin("upload")]
    fileselect = 46,
    /// <summary>
    /// 上传控件多文件不自动上传
    /// </summary>
    [Description("上传控件多文件")]
    [FormPlugin("upload")]
    fileselects = 47,
    /// <summary>
    /// 审批流程
    /// </summary>
    [Description("审批流程")]
    [FormPlugin("fayaudit")]
    audit = 48,
    /// <summary>
    /// 输入标签
    /// </summary>
    [Description("输入标签")]
    [FormPlugin("inputtags")]
    inputtags = 49,
    /// <summary>
    /// 树形下拉框
    /// </summary>
    [Description("树形下拉框")]
    [FormPlugin("xmSelect")]
    xmselect = 50,
    /// <summary>
    /// 日期+时间区间
    /// </summary>
    [Description("日期+时间区间")]
    [FormPlugin("laydate")]
    datetimes = 51,
    /// <summary>
    /// 年区间
    /// </summary>
    [Description("年区间")]
    [FormPlugin("laydate")]
    years = 52,
    /// <summary>
    /// 年月区间
    /// </summary>
    [Description("年月区间")]
    [FormPlugin("laydate")]
    months = 53,
    /// <summary>
    /// 时间区间
    /// </summary>
    [Description("时间区间")]
    [FormPlugin("laydate")]
    times = 54,
    /// <summary>
    /// 年
    /// </summary>
    [Description("年")]
    [FormPlugin("laydate")]
    year = 55,
    /// <summary>
    /// 年月
    /// </summary>
    [Description("年月")]
    [FormPlugin("laydate")]
    month = 56,
    /// <summary>
    /// 图标框
    /// </summary>
    [Description("图标框")]
    [FormPlugin("selecticon")]
    icons = 57,
    /// <summary>
    /// 附件
    /// </summary>
    [Description("附件")]
    [FormPlugin("element")]
    attach = 58,
    /// <summary>
    /// MD编辑器
    /// </summary>
    [Description("MD编辑器")]
    [FormPlugin("element")]
    editormd = 59,
    /// <summary>
    /// 点击多文本输入框
    /// </summary>
    [Description("点击多文本输入框")]
    [FormPlugin("form")]
    labeltextarea = 60,
    /// <summary>
    /// 下拉式菜单
    /// </summary>
    [Description("下拉式菜单")]
    [FormPlugin("dropdown")]
    dropdown = 61
}
EncryptType 枚举 加密类型
/// <summary>
/// 加密类型
/// </summary>
public enum EncryptType
{
    /// <summary>
    /// 不加密
    /// </summary>
    [Description("不加密")]
    No = 0,
    /// <summary>
    /// 可逆加密
    /// </summary>
    [Description("可逆加密")]
    Reversible = 1,
    /// <summary>
    /// 不可逆加密
    /// </summary>
    [Description("不可逆加密")]
    Irreversible = 2,
    /// <summary>
    /// 管理员密码加密
    /// </summary>
    [Description("管理员密码加密")]
    AdminPassWord = 3,
    /// <summary>
    /// 用户密码加密
    /// </summary>
    [Description("用户密码加密")]
    UserPassWord = 4
}
PassWordType 枚举 密码框类型
/// <summary>
/// 密码框类型
/// </summary>
public enum PassWordType
{
    /// <summary>
    /// 正常密码框
    /// </summary>
    [Description("正常密码框")]
    DbNull = 0,
    /// <summary>
    /// 确认密码
    /// </summary>
    [Description("确认密码")]
    Confirm = 1,
    /// <summary>
    /// 强度
    /// </summary>
    [Description("验证密码强度")]
    [FormPlugin("strength")] 
    Strength = 2,
    /// <summary>
    /// 确认密码和验证密码强度
    /// </summary>
    [Description("确认加密码强度")]
    [FormPlugin("strength")]
    ConfirmStrength = 3
}
AutoCompleteType 枚举 自动完成类型
/// <summary>
/// 自动完成类型
/// </summary>
public enum AutoCompleteType
{
    /// <summary>
    /// 无
    /// </summary>
    [EnumName("")]
    [Description("无")]
    None = 0,
    /// <summary>
    /// 开启
    /// </summary>
    [EnumName("on")]
    [Description("开启")] 
    On = 1,
    /// <summary>
    /// 关闭
    /// </summary>
    [EnumName("off")]
    [Description("关闭")] 
    Off = 2,
    /// <summary>
    /// 新密码
    /// </summary>
    [EnumName("new-password")]
    [Description("新密码")] 
    NewPassword = 3
}
PageMoel 枚举 页面模式
/// <summary>
/// 页面模式
/// </summary>
public enum PageMode
{
    /// <summary>
    /// 混合模式
    /// </summary>
    [Description("混合模式")]
    Mix = 0,
    /// <summary>
    /// 独立模式
    /// </summary>
    [Description("独立模式")]
    Alone = 1
}
ButtonType 枚举 按扭类型
/// <summary>
/// 按扭类型
/// </summary>
public enum ButtonType
{
    /// <summary>
    /// 默认按扭
    /// </summary>
    [Description("默认按扭")]
    [FormPlugin()]
    button = 0,
    /// <summary>
    /// 提交按扭
    /// </summary>
    [Description("提交按扭")]
    [FormPlugin()]
    submit = 1,
    /// <summary>
    /// 重置按扭
    /// </summary>
    [Description("重置按扭")]
    [FormPlugin()]
    reset = 2,
    /// <summary>
    /// 按扭
    /// </summary>
    [Description("按扭")]
    [FormPlugin()]
    input = 3,
    /// <summary>
    /// 下拉框
    /// </summary>
    [Description("下拉框")]
    [FormPlugin("dropdown")]
    select = 4,
    /// <summary>
    /// 下拉框
    /// </summary>
    [Description("下拉框")]
    [FormPlugin("dropdown")]
    dropdown = 5
}
WindowType 枚举 窗口类型
/// <summary>
/// 窗口类型
/// </summary>
public enum WindowType
{
    /// <summary>
    /// 无
    /// </summary>
    [Description("无")]
    Null = 0,
    /// <summary>
    /// Tab窗体
    /// </summary>
    [Description("Tab窗体")]
    Tab = 1,
    /// <summary>
    /// 弹窗窗体
    /// </summary>
    [Description("弹窗窗体")]
    Open = 2,
    /// <summary>
    /// 浏览器窗体
    /// </summary>
    [Description("浏览器窗体")]
    Blank = 3,
    /// <summary>
    /// 框架窗体
    /// </summary>
    [Description("框架窗体")]
    Iframe = 4
}
ListType 枚举 列表类型
/// <summary>
/// 列表类型
/// </summary>
public enum ListType
{
    /// <summary>
    /// List
    /// </summary>
    [Description("List")]
    List = 0,
    /// <summary>
    /// TreeList
    /// </summary>
    [Description("TreeList")]
    TreeList = 1,
    /// <summary>
    /// TreeTable
    /// </summary>
    [Description("TreeTable")]
    TreeTable = 2
}
ListSize 枚举 列表尺寸
/// <summary>
/// 列表尺寸
/// </summary>
public enum ListSize
{
    /// <summary>
    /// 
    /// </summary>
    sm = 0,
    /// <summary>
    /// 
    /// </summary>
    md = 1,
    /// <summary>
    /// 
    /// </summary>
    lg = 2
}
ListSkin 枚举 列表皮肤
/// <summary>
/// 列表皮肤
/// </summary>
public enum ListSkin
{
    /// <summary>
    /// 
    /// </summary>
    grid = 0,
    /// <summary>
    /// 
    /// </summary>
    line = 1,
    /// <summary>
    /// 
    /// </summary>
    row = 2,
    /// <summary>
    /// 
    /// </summary>
    nob = 3
}

生成模型

假设当前间点访问地址为http://localhost:5000;

那么生成模型网址为: http://localhost:5000/XiaoFeng/CreateModel?namespace=XiaoFeng.Mvc.Models&TableName=&ViewName=

namespace 代表生成模型的命名空间 不设置值的话默认提取hosting.json中的 namespace TableName 生成那些表的模型,不设置是生成数据库中所有表模型 ViewName 生成那些视图的模型,不设置是生成数据库中所有视图模型

新建项目

新建一个空项目,把根目录下的 appsettings.json,appsettings.Development.json两个配置文件删除,因为我们项目暂不用它,主要用hosting.json作为配置。

接着把 XiaoFeng.Mvc 从nuget中引用到项目中

接着打开 Program.cs文件

代码如下

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/", () => "Hello World!");

app.Run();

把上面的代码删除掉,输入以下代码

await ApplicationManager.Load(args).
RegisterStarted(app =>
{
    //项目启动后事件,不处理则不用注册当前事件
}).
RegisterStoping(app =>
{
    //项目停止中事件,不处理则不用注册当前事件
}).
RegisterStoped(app =>
{
    //项目停止后事件,不处理则不用注册当前事件
}).
RunAsync(() => WebHost.CreateHost(args, services =>
{
    //注册服务
}, app =>
{
    //启用功能
    //配置路由
}, endpoint =>
{
    //配置路由
})).ConfigureAwait(false);

如果用不到注册事件处理的话就可以直接不用注册可以写成如下

await ApplicationManager.Load(args).
RunAsync(() => WebHost.CreateHost(args, services =>
{
    //注册服务
}, app =>
{
    //启用功能
    //配置路由
}, endpoint =>
{
    //配置路由
})).ConfigureAwait(false);

接着就是启动运行即可,看到下边内容后代表已经启动起来了.

 |- 系统启动完成(FAYELF)
 |
 |- 启动时间:2023-12-08 14:58:31.0896883
 |
 |- 监听地址:
 |
 |---- http://localhost:8001
 |
 |---- https://localhost:8002
 |
 |- 站点目录:
 |
 |- E:\Work\Test\FayElf.Cube.TestWeb
 |
 |- 静态目录:
 |
 |---- /                     =>     Html
 |---- /UEditor              =>     UEditor
 |---- /UploadFiles          =>     UploadFiles
 |---- /Temp                 =>     Temp/UploadFiles

这时候项目根目录会自动生成配置文件,都在Config文件夹中


1.Cache.json 缓存配置文件

2.DataBase.json 数据库配置文件

3.hosting.json 站点配置文件

4.ProgramSet.json 项目配置文件

5.StaticFiles.xml 静态文件目录配置文件

6.Upload.json 上传配置文件

7.XiaoFeng.json XiaoFeng组件配置文件


在上边都已经对以上文件内容的解释说明,在这里就不在赘述。

到此新建一个项目已经完成

ServiceCollection 配置

项目启动时里面的 services=>{}当前委托

注册全局 Json序列化配置

用 XiaoFeng.Json 替换掉 微软的 System.Text.Json 当然也可以不替换默认用 微软的json序列化

services.AddControllers().AddXiaoFengJson(options =>
{
    options.DefaultSettings = new JsonSerializerSetting
    {
        DateTimeFormat = "yyyy-MM-dd HH:mm:ss.fffffff",
        GuidFormat = "N",
        EnumValueType = EnumValueType.Name
    };
});

WebApplication 应用配置

Endpoint 路由配置

基类控制器

ControllerBaseX 基类控制器

内部方法

1.Value(stirng key) 获取Get,Post,Header中的值,并设置获取不到值后的默认值 2.Get(string key) 获取参数中的值 3.Post(string key) 获取表单中的值 4.GetSession(string key) 获取Session中的值 5.SetSession(string key,object value) 设置Session值 6.GetCookie(string key) 获取cookie值 7.SetCookie(string key,string value) 设置cookie值 8.DeleteCookie(string key,CookieOptions options) 删除cookie值 9.GetHeader(string key) 获取header中的值 10.AppendHeader(string key,string value) 附加header值 11.AddHeader(string key,string value) 添加header值 12.RemoveHeader(string key) 移除header值 13.Claims方法有 登入SignInAsync,登出SignOutAsync,获取登录数据GetAsync 三种方法 14.返回Json结构方法 Json,JsonSuccess,JsonError,JsonOK 15.返回Xml结构方法 Xml,XmlSuccess,XmlError,XmlOK 16.属性 AreaName 区域名称,ControllerName 控制器名称,ActionName 方法名称, QueryString 参数,IsHttps 判断客户端请求是否是https 17.返回错误视图方法 ErrorView 18.执行前方法 OnActionExecuting(ActionExecutingContext context); 19.执行后方法 OnActionExecuted(ActionExecuteContext context);

EntityController 前台基类控制器

AdminEntityController 后台基类控制器

AdminConfigConfigController 后台配置基类控制器

AdminConfigsConfigController 后台配置列表基类控制器

BaseAPIController webapi基类控制器介绍

作者介绍


更新日志

2024-09-11 v 5.1.2

1.优化后台logo不存在时切换成默认logo;

2.优化表单值原有值后设置为空时不更新的bug;

3.优化XiaoFengJsonInputFormatter中body回滚bug;

4.修复多下拉框搜索时检索不到数据的bug;

5.更新获取IP,获取手机号api;

6.修复field中event事件不生效bug;

7.增加图标字体;优化平台语言类库;

8.升级layui到2.9.14版本;

9.增加后台数据库编辑器;

10.优化后台加载菜单速度;

11.优化后台样式;

12.优化安全防护除去后台正常的不拦截;

13.优化上传附件路径;

14.增加控件类型 pre;

15.验证码,后台,用户记录cookie名称由原来的ZW_前缀改为ELF_前缀;

2024-05-20 v 5.1.1

1.修复最大化最小化判断时的bug;

2.修改生成模型时数据库key的问题;

3.增加 ZW.CMS.Common.CreateUUID 方法;

4.增加安全配置功能;调整xmselect主题色;

5.后台js精简;

6.包所有js,css引用压缩后的文件;

7.优化数字输入框比正常输入框长的问题;

8.增加控件类型province,region;

9.更新城市插件子节点child改为children;

10.优化地图选点插件;优化上传插件;

11.恢复用SkiaSharp库写ClickPicture验证码样式;

12.优化输入框颜色可以自定义;

13.增加线程列表;

14.修改Select插件默认子节点名称从child改为children;

15.更新AdminConfigsControllers控制器的注入;

16.修复svg图在上传控件中不显示的bug;

17.增加访问安全管理;

18.修正帐号中的帐号改成账;

19.升级layui至2.9.10;

2024-03-01 v 5.1.0

1.把对Response的扩展WriteAsync改为WriteHtmlAsync;

2.优化Response.Headers.Add改为Response.Headers.Append;

3.系统配置增加验证码字体配置;

4.优化websocket测试页,增加是否自动连接,页面重构适应手机端;

5.修复全站目录都静态化的bug;

6.后台增加生成数据库模型功能;

7.增加发现攻击进行拦截访问功能;

8.原生成模型网址增加账号密码访问;

2024-02-19 v 5.0.1

1.修复不开启后台功能webapi权限入库报错的bug;

2.WebApi增加WebEventSource事件标识 ,并增加调试功能;

3.优化列表翻页到非第一页时,修改或删除后跳到第一页的bug;

4.修复List在Tab中变量冲突bug;

5.PageData增加TryGetValue方法;

6.WebApi调试器增加参数请求来源Query,Body,Form,Route,Header,Services;

2024-02-01 v 5.0.0

1.修复上传控件不自动上传的bug;

2.增加图片不缓存配置;升级layui至2.9.6;

3.增加后台列表类型TreeTable;

4.增加日期控制Max,Min,Range属性;

5.增加表格头可合并列,合等制表功能;

6.Field列增加HeaderLevel头级别属性;

7.升级获取配置表格列;

8.图片组件由System.Drawing.Common转成SkiaShartp组件;

9.二维码生成功能由原来的QrCode转成SkiaSharp组件来生成;

10.WebApi页增加参数为模型对象时解析出Json展示在WebAPI中;

11.修复处理请求头时,从body里把数据取走后导致api中参数[frombody]取不到数据的bug;

12.扩展Request获取Body各种值(GetFormBody,GetFormBodyDictionary,GetFormBodyJsonValue,GetFormBodyBytes,GetFormBodyString,TryBodyGetValue),替换掉Common中的静态方法;

2023-11-20 v 3.5.0

1.增加hosting.json可以配置多个域名及证书;

2.优化启动项;

3.优化页面配置页;

4.增加8.0框架适配;

5.增加ContentType后台配置;

6.增加AdminConfigsController基类;

7.增加MemberConfigsController基类;

8.升级layui至2.8.18;

2023-10-27 v 3.4.0

1.修改上传一直无限上传的bug;

2.优化模板中同时出现多种类型变量时只处理一个的bug;

3.优化详情,编辑页读取数据字段从配置中读取;

4.修复日期区间读取值格式误写成数据格式;

5.优化自定义权限枚举;

6.增加账号密码最小长度,规则配置;

7.优化Html.Editor扩展;

8.增加Field属性AutoComplete,ReadOnly;

9.增加转向外部站点连接的配置;

2023-09-23 v 3.3.0

1.增加公共属性IsInit判断当前项目是否初如化;

2.增加安全性,生成模型控制器验证站点是否初始化过,如果初如化过就不再生成模型;

3.WebAPI增加密码访问;增加登录接口配置;

4.增加搜索框放入form表单中;

5.修复密码复杂度插件未引用问题;

6.修复webapi模拟提交选择application/json时无输入数据的地方;

7.增加上传临时文件夹设置;

8.修复枚举转换select text读取value的bug;

9.Field配置增加Options插件配置;

10.更新layui到2.8.17;

11.更新数字输入控件;

12.更新控件拉取数据;

13.更新表格列表右键菜单;

14.升级图片路径问题;

15.修复FormPlugins为XmlElement节点;

16.增加列表toolbar事件后台可配;

17.列表图片为空时可设置不显示,或显示自定义图片;

18.ApplicationManager增加系统启动后事件,停止中事件,停止后事件;

19.去除netstartdard2.1框架支持;

20.表格列表增加Fixed固定列,值为left,right;

21.修复读取XiaoFeng类库中枚举失败的bug;

22.优化WebApi访问权限;

v 3.2.0 2023-08-22

1.增加公共属性IsInit判断当前项目是否初如化;

2.增加安全性,生成模型控制器验证站点是否初始化过,如果初如化过就不再生成模型;

3.WebAPI增加密码访问;

4.增加登录接口配置;增加搜索框放入form表单中;

5.修复密码复杂度插件未引用问题;

6.修复webapi模拟提交选择application/json时无输入数据的地方;

7.增加上传临时文件夹设置;

8.修复枚举转换select text读取value的bug;

9.Field配置增加Options插件配置;

10.更新layui到2.8.15;

11.更新数字输入控件;

12.更新控件拉取数据;

13.更新表格列表右键菜单;

14.升级图片路径问题;

15.修复FormPlugins为XmlElement节点;

16.增加列表toolbar事件后台可配;

17.列表图片为空时可设置不显示,或显示自定义图片;

18.ApplicationManager增加系统启动后事件,停止中事件,停止后事件;

19.去除netstartdard2.1框架支持;

20.表格列表增加Fixed固定列,值为left,right

v 3.1.6 2023-05-19

1.增加公共属性IsInit判断当前项目是否初如化;

2.增加安全性,生成模型控制器验证站点是否初始化过,如果初如化过就不再生成模型;

v 3.1.5 2023-05-06

1.修复后台路径改变后,设置桌面快捷方式路径问题;

2.修复从本路跳到外站检查bug;

3.优化跳出本站外网站的过滤;layui升级到2.8.0;

4.修复layui中控件部分bug;

5.增加替换默认json解析器到XiaoFeng.json;

6.优化API,Admin Json配置为空是使用默认配置;


Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on XiaoFeng.Mvc:

Package Downloads
XiaoFeng.Mvc.AdminWinDesk

后台模板

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.1.7 92 11/10/2024
5.1.6 88 11/3/2024
5.1.5 99 11/3/2024
5.1.3 113 10/17/2024
5.1.2 180 9/11/2024
5.1.1 143 5/20/2024
5.1.0 239 3/2/2024
5.0.1 176 2/19/2024
5.0.0 154 2/1/2024
3.5.0 268 11/20/2023
3.4.0 195 10/27/2023
3.3.0 246 9/26/2023
3.2.0 305 8/22/2023
3.1.5 273 5/16/2023
3.1.3 354 4/24/2023
3.1.2 387 3/15/2023
3.1.1 510 3/2/2023
3.1.0 426 2/6/2023
3.0.5 389 12/30/2022
3.0.3 397 12/12/2022
3.0.2 435 11/25/2022
3.0.1 409 11/15/2022
2.16.9 491 10/24/2022
2.16.8 503 9/26/2022
2.16.5 490 9/5/2022
2.16.2 575 7/19/2022
2.16.1 627 7/17/2022
2.16.0 707 7/13/2022
2.15.2 674 7/8/2022
2.15.1 678 7/3/2022
2.14.5 630 6/28/2022
2.14.3 722 6/16/2022
2.14.1 692 5/31/2022
2.11.2022.526 661 5/27/2022
2.9.2022.523 786 5/23/2022
2.8.2022.523 774 5/23/2022
2.7.2022.523 641 5/23/2022
1.5.64.605 844 6/5/2020

优化后台logo不存在时切换成默认logo;优化表单值原有值后设置为空时不更新的bug;优化XiaoFengJsonInputFormatter中body回滚bug;修复多下拉框搜索时检索不到数据的bug;更新获取IP,获取手机号api;修复field中event事件不生效bug;增加图标字体;优化平台语言类库;升级layui到2.9.14版本;增加后台数据库编辑器;优化后台加载菜单速度;优化后台样式;优化安全防护除去后台正常的不拦截;优化上传附件路径;增加控件类型 pre;验证码,后台,用户记录cookie名称由原来的ZW_前缀改为ELF_前缀;