forked from CatcherXue/SmartAdmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de4afcd
commit 2e9625f
Showing
84 changed files
with
3,773 additions
and
41,189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2010 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartAdmin", "SmartAdmin\SmartAdmin.csproj", "{D6E561E0-04BF-4147-9D6B-0FFE768104BE}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartPortal", "SmartPortal\SmartPortal.csproj", "{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Express 2012 for Web | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartPortal", "SmartPortal\SmartPortal.csproj", "{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartAdmin", "SmartAdmin\SmartAdmin.csproj", "{D6E561E0-04BF-4147-9D6B-0FFE768104BE}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
using System.Web.Mvc; | ||
using Smart.Admin; | ||
using System.Drawing; | ||
using Smart.Admin.Helpers; | ||
|
||
namespace Smart.Admin.Controllers | ||
{ | ||
|
@@ -26,32 +27,6 @@ public class SystemController : Controller | |
[Filter.DefaultAuthorizationFilter] | ||
public ActionResult Index() | ||
{ | ||
//添加一条测试数据 | ||
/* | ||
Models.User user = new Models.User(); | ||
user.CurrentIPAddress = Request.UserHostAddress; | ||
user.EmailAddress = "[email protected]"; | ||
user.EndLoginDate = DateTime.Now; | ||
user.MutileOnLine = false; | ||
user.Nick = "飞翔的小鸟"; | ||
user.OnLine = false; | ||
user.Password = "123456789"; | ||
user.RegisterDate = DateTime.Now; | ||
user.UserName = new Random().Next(999999).ToString(); | ||
user.UserRole = "超级管理员"; | ||
smartAdminDB.Users.Add(user); | ||
smartAdminDB.SaveChanges(); | ||
var data = from u in smartAdminDB.Users | ||
//where u.UserName == user.UserName | ||
orderby u.RegisterDate descending | ||
select u; | ||
ViewBag.Data = data; | ||
*/ | ||
//return View("~/Views/System/Login.cshtml"); | ||
return View(); | ||
} | ||
|
||
|
@@ -95,7 +70,7 @@ public ActionResult Login(string username, string password, string code, string | |
ViewBag.Message = "用户名或密码错误,请重新登录"; | ||
return View("~/Views/System/Login.cshtml"); | ||
} | ||
|
||
//一周内免登陆设置 | ||
if (remember == "1") | ||
{ | ||
|
@@ -130,7 +105,6 @@ public ActionResult Login() | |
public ActionResult LoginOut(string username) | ||
{ | ||
Response.Cookies.Add(new HttpCookie("username", "")); | ||
//return View("~/Views/System/Login.cshtml"); | ||
|
||
return new RedirectResult("~/System/Login", false); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.Mvc; | ||
|
||
namespace Smart.Admin.Helpers | ||
{ | ||
/// <summary> | ||
/// UrlHelper扩展 | ||
/// </summary> | ||
public static class UrlHelperExtensions | ||
{ | ||
/// <summary> | ||
/// 带有Areas的url地址(链接) | ||
/// </summary> | ||
/// <param name="url"></param> | ||
/// <param name="path"></param> | ||
/// <returns></returns> | ||
public static string ContentArea(this UrlHelper url, string path) | ||
{ | ||
var area = url.RequestContext.RouteData.DataTokens["area"]; | ||
|
||
if (area != null) | ||
{ | ||
/* | ||
if (!string.IsNullOrEmpty(area.ToString())) | ||
area = "Areas/" + area; | ||
*/ | ||
|
||
if (path.StartsWith("~/")) | ||
path = path.Remove(0, 2); | ||
|
||
if (path.StartsWith("/")) | ||
path = path.Remove(0, 1); | ||
|
||
path = path.Replace("../", string.Empty); | ||
|
||
return VirtualPathUtility.ToAbsolute("~/" + area + "/" + path); | ||
} | ||
|
||
return string.Empty; | ||
} | ||
|
||
/// <summary> | ||
/// 带有Areas的url地址(素材) | ||
/// </summary> | ||
/// <param name="url"></param> | ||
/// <param name="path"></param> | ||
/// <returns></returns> | ||
public static string ContentAreaMaterial(this UrlHelper url, string path) | ||
{ | ||
var area = url.RequestContext.RouteData.DataTokens["area"]; | ||
|
||
if (area != null) | ||
{ | ||
if (!string.IsNullOrEmpty(area.ToString())) | ||
area = "Areas/" + area; | ||
|
||
if (path.StartsWith("~/")) | ||
path = path.Remove(0, 2); | ||
|
||
if (path.StartsWith("/")) | ||
path = path.Remove(0, 1); | ||
|
||
path = path.Replace("../", string.Empty); | ||
|
||
return VirtualPathUtility.ToAbsolute("~/" + area + "/" + path); | ||
} | ||
|
||
return string.Empty; | ||
} | ||
} | ||
} |
Oops, something went wrong.