layui 2.02

This commit is contained in:
yubaolee 2017-08-30 16:49:28 +08:00
parent 5a47357f22
commit c1e84d7334
1093 changed files with 1153 additions and 226292 deletions

View File

@ -1,69 +1,72 @@
<%@ Template Language="C#" TargetLanguage="C#" Debug="True" Encoding="UTF-8" %> <%@ Template Language="C#" TargetLanguage="C#" Debug="True" Encoding="UTF-8" %>
<%@ Assembly Src="Model.cs" %> <%@ Assembly Src="Model.cs" %>
<%@ Assembly Src="Extensions.cs" %> <%@ Assembly Src="Extensions.cs" %>
<%@ Import Namespace="System.Collections.Generic" %> <%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Linq" %> <%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Text" %> <%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Text.RegularExpressions" %> <%@ Import Namespace="System.Text.RegularExpressions" %>
<%@ Import Namespace="SchemaMapper" %> <%@ Import Namespace="SchemaMapper" %>
<%@ Property Name="Entity" <%@ Property Name="Entity"
Type="SchemaMapper.Entity" %> Type="SchemaMapper.Entity" %>
<%@ Property Name="EntityNamespace" <%@ Property Name="EntityNamespace"
Type="System.String" %> Type="System.String" %>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <autogenerated> // <autogenerated>
// This code was generated by a CodeSmith Template. // This code was generated by a CodeSmith Template.
// //
// DO NOT MODIFY contents of this file. Changes to this // DO NOT MODIFY contents of this file. Changes to this
// file will be lost if the code is regenerated. // file will be lost if the code is regenerated.
// Author:Yubao Li // Author:Yubao Li
// </autogenerated> // </autogenerated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace <%= EntityNamespace %> namespace <%= EntityNamespace %>
{ {
/// <summary> /// <summary>
/// <%= Entity.Description %> /// <%= Entity.Description %>
/// </summary> /// </summary>
public partial class <%= Entity.ClassName.ToSafeName() %> public partial class <%= Entity.ClassName.ToSafeName() %> : Entity
{ {
public <%= Entity.ClassName.ToSafeName() %>() public <%= Entity.ClassName.ToSafeName() %>()
{ {
<% foreach(var p in Entity.Properties) { <% foreach(var p in Entity.Properties) {
string type = p.SystemType.ToNullableType(p.IsNullable == true); if(p.IsPrimaryKey ==true) continue;
if(type =="int" || type=="decimal") string type = p.SystemType.ToNullableType(p.IsNullable == true);
Response.WriteLine(" this."+p.PropertyName.ToSafeName()+"= 0;"); if(type =="int" || type=="decimal")
else if(type =="string") Response.WriteLine(" this."+p.PropertyName.ToSafeName()+"= 0;");
Response.WriteLine(" this."+p.PropertyName.ToSafeName()+"= string.Empty;"); else if(type =="string")
else if(type.ToLower().Contains("datetime")) Response.WriteLine(" this."+p.PropertyName.ToSafeName()+"= string.Empty;");
Response.WriteLine(" this."+p.PropertyName.ToSafeName()+"= DateTime.Now;"); else if(type.ToLower().Contains("datetime"))
} // foreach %> Response.WriteLine(" this."+p.PropertyName.ToSafeName()+"= DateTime.Now;");
<% foreach(var r in Entity.Relationships.Where(e => e.ThisCardinality == Cardinality.Many)) { %> } // foreach %>
<%= r.ThisPropertyName.ToSafeName() %> = new List<<%= r.OtherEntity.ToSafeName() %>>(); <% foreach(var r in Entity.Relationships.Where(e => e.ThisCardinality == Cardinality.Many)) { %>
<% } // foreach %> <%= r.ThisPropertyName.ToSafeName() %> = new List<<%= r.OtherEntity.ToSafeName() %>>();
} <% } // foreach %>
}
<% foreach(var p in Entity.Properties) { %>
/// <summary> <% foreach(var p in Entity.Properties) {
/// <%=p.Description %> if(p.IsPrimaryKey ==true) continue;
/// </summary> %>
public <%= p.SystemType.ToNullableType(p.IsNullable == true) %> <%= p.PropertyName.ToSafeName() %> { get; set; } /// <summary>
<% } // foreach %> /// <%=p.Description %>
/// </summary>
<% foreach(var r in Entity.Relationships) { %> public <%= p.SystemType.ToNullableType(p.IsNullable == true) %> <%= p.PropertyName.ToSafeName() %> { get; set; }
<% if(r.ThisCardinality == Cardinality.Many) { %> <% } // foreach %>
public virtual ICollection<<%= r.OtherEntity.ToSafeName() %>> <%= r.ThisPropertyName.ToSafeName() %> { get; set; }
<% } else { %> <% foreach(var r in Entity.Relationships) { %>
public virtual <%= r.OtherEntity.ToSafeName() %> <%= r.ThisPropertyName.ToSafeName() %> { get; set; } <% if(r.ThisCardinality == Cardinality.Many) { %>
<% } %> public virtual ICollection<<%= r.OtherEntity.ToSafeName() %>> <%= r.ThisPropertyName.ToSafeName() %> { get; set; }
<% } // foreach %> <% } else { %>
} public virtual <%= r.OtherEntity.ToSafeName() %> <%= r.ThisPropertyName.ToSafeName() %> { get; set; }
<% } %>
<% } // foreach %>
}
} }

View File

@ -1,167 +1,167 @@
// *********************************************************************** // ***********************************************************************
// Assembly : OpenAuth.App // Assembly : OpenAuth.App
// Author : yubaolee // Author : yubaolee
// Created : 07-08-2016 // Created : 07-08-2016
// //
// Last Modified By : yubaolee // Last Modified By : yubaolee
// Last Modified On : 07-08-2016 // Last Modified On : 07-08-2016
// Contact : Microsoft // Contact : Microsoft
// File: AuthUtil.cs // File: AuthUtil.cs
// *********************************************************************** // ***********************************************************************
using System; using System;
using System.Configuration; using System.Configuration;
using System.Web; using System.Web;
using Infrastructure; using Infrastructure;
using OpenAuth.App.ViewModel; using OpenAuth.App.ViewModel;
namespace OpenAuth.App.SSO namespace OpenAuth.App.SSO
{ {
/// <summary> /// <summary>
/// 第三方网站登录验证类 /// 第三方网站登录验证类
/// <para>登录时:</para> /// <para>登录时:</para>
/// <code> /// <code>
/// var result = AuthUtil.Login(AppKey, username, password); /// var result = AuthUtil.Login(AppKey, username, password);
/// if (result.Success) /// if (result.Success)
/// return Redirect("/home/index?Token=" + result.Token); /// return Redirect("/home/index?Token=" + result.Token);
/// </code> /// </code>
/// </summary> /// </summary>
public class AuthUtil public class AuthUtil
{ {
static HttpHelper _helper = new HttpHelper(ConfigurationManager.AppSettings["SSOPassport"]); static HttpHelper _helper = new HttpHelper(ConfigurationManager.AppSettings["SSOPassport"]);
private static string GetToken() private static string GetToken()
{ {
string token = HttpContext.Current.Request.QueryString["Token"]; string token = HttpContext.Current.Request.QueryString["Token"];
if (!String.IsNullOrEmpty(token)) return token; if (!String.IsNullOrEmpty(token)) return token;
var cookie = HttpContext.Current.Request.Cookies["Token"]; var cookie = HttpContext.Current.Request.Cookies["Token"];
return cookie == null ? String.Empty : cookie.Value; return cookie == null ? String.Empty : cookie.Value;
} }
public static bool CheckLogin(string token, string remark = "") public static bool CheckLogin(string token, string remark = "")
{ {
if (String.IsNullOrEmpty(token) || String.IsNullOrEmpty(GetToken())) if (String.IsNullOrEmpty(token) || String.IsNullOrEmpty(GetToken()))
return false; return false;
var requestUri = String.Format("/api/Check/GetStatus?token={0}&requestid={1}", token, remark); var requestUri = String.Format("/api/Check/GetStatus?token={0}&requestid={1}", token, remark);
try try
{ {
var value = _helper.Get(null, requestUri); var value = _helper.Get(null, requestUri);
return Boolean.Parse(value); return Boolean.Parse(value);
} }
catch (Exception ex) catch (Exception ex)
{ {
throw ex; throw ex;
} }
} }
/// <summary> /// <summary>
/// 检查用户登录状态 /// 检查用户登录状态
/// <para>通过URL中的Token参数或Cookie中的Token</para> /// <para>通过URL中的Token参数或Cookie中的Token</para>
/// </summary> /// </summary>
/// <param name="remark">备注信息</param> /// <param name="remark">备注信息</param>
public static bool CheckLogin(string remark="") public static bool CheckLogin(string remark="")
{ {
return CheckLogin(GetToken(), remark); return CheckLogin(GetToken(), remark);
} }
/// <summary> /// <summary>
/// 获取当前登录的用户信息 /// 获取当前登录的用户信息
/// <para>通过URL中的Token参数或Cookie中的Token</para> /// <para>通过URL中的Token参数或Cookie中的Token</para>
/// </summary> /// </summary>
/// <param name="remark">The remark.</param> /// <param name="remark">The remark.</param>
/// <returns>LoginUserVM.</returns> /// <returns>LoginUserVM.</returns>
public static UserWithAccessedCtrls GetCurrentUser(string remark = "") public static UserWithAccessedCtrls GetCurrentUser(string remark = "")
{ {
var requestUri = String.Format("/api/Check/GetUser?token={0}&requestid={1}", GetToken(), remark); var requestUri = String.Format("/api/Check/GetUser?token={0}&requestid={1}", GetToken(), remark);
try try
{ {
var value = _helper.Get<UserWithAccessedCtrls>(null, requestUri); var value = _helper.Get<UserWithAccessedCtrls>(null, requestUri);
return value; return value;
} }
catch (Exception ex) catch (Exception ex)
{ {
throw ex; throw ex;
} }
} }
/// <summary> /// <summary>
/// 获取当前登录的用户名 /// 获取当前登录的用户名
/// <para>通过URL中的Token参数或Cookie中的Token</para> /// <para>通过URL中的Token参数或Cookie中的Token</para>
/// </summary> /// </summary>
/// <param name="remark">The remark.</param> /// <param name="remark">The remark.</param>
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
public static string GetUserName(string remark = "") public static string GetUserName(string remark = "")
{ {
var requestUri = String.Format("/api/Check/GetUserName?token={0}&requestid={1}", GetToken(), remark); var requestUri = String.Format("/api/Check/GetUserName?token={0}&requestid={1}", GetToken(), remark);
try try
{ {
var value = _helper.Get<string>(null, requestUri); var value = _helper.Get<string>(null, requestUri);
return value; return value;
} }
catch (Exception ex) catch (Exception ex)
{ {
throw ex; throw ex;
} }
} }
/// <summary> /// <summary>
/// 登陆接口 /// 登陆接口
/// </summary> /// </summary>
/// <param name="appKey">应用程序key.</param> /// <param name="appKey">应用程序key.</param>
/// <param name="username">用户名</param> /// <param name="username">用户名</param>
/// <param name="pwd">密码</param> /// <param name="pwd">密码</param>
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
public static LoginResult Login(string appKey, string username, string pwd) public static LoginResult Login(string appKey, string username, string pwd)
{ {
var requestUri = "/api/Check/Login"; var requestUri = "/api/Check/Login";
try try
{ {
var value = _helper.Post(new var value = _helper.Post(new
{ {
AppKey = appKey, AppKey = appKey,
UserName = username, UserName = username,
Password = pwd Password = pwd
}, requestUri); }, requestUri);
var result = JsonHelper.Instance.Deserialize<LoginResult>(value); var result = JsonHelper.Instance.Deserialize<LoginResult>(value);
return result; return result;
} }
catch (Exception ex) catch (Exception ex)
{ {
return null; return null;
} }
} }
/// <summary> /// <summary>
/// 注销 /// 注销
/// </summary> /// </summary>
public static bool Logout() public static bool Logout()
{ {
var token = GetToken(); var token = GetToken();
if (String.IsNullOrEmpty(token)) return true; if (String.IsNullOrEmpty(token)) return true;
var requestUri = String.Format("/api/Check/Logout?token={0}&requestid={1}", token, ""); var requestUri = String.Format("/api/Check/Logout?token={0}&requestid={1}", token, "");
try try
{ {
var value = _helper.Post(null, requestUri); var value = _helper.Post(null, requestUri);
return true; return true;
} }
catch (Exception ex) catch (Exception ex)
{ {
return false; return false;
} }
} }
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 891 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 831 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 879 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 519 B

Some files were not shown because too many files have changed in this diff Show More