Commit 695e57f6 authored by 叶凯's avatar 叶凯

修改 PageBase

parent 3ebc3a2e
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
</site> </site>
<site name="AppBox" id="2"> <site name="AppBox" id="2">
<application path="/" applicationPool="Clr4ClassicAppPool"> <application path="/" applicationPool="Clr4ClassicAppPool">
<virtualDirectory path="/" physicalPath="D:\Code\AppBox\AppBox" /> <virtualDirectory path="/" physicalPath="G:\AppBox\AppBox" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:7086:localhost" /> <binding protocol="http" bindingInformation="*:7086:localhost" />
......
No preview for this file type
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView> <ProjectView>ProjectFiles</ProjectView>
<NameOfLastUsedPublishProfile>ASF</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>ASF</NameOfLastUsedPublishProfile>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
</PropertyGroup> </PropertyGroup>
......
...@@ -106,6 +106,62 @@ namespace AppBox ...@@ -106,6 +106,62 @@ namespace AppBox
// 设置页面标题 // 设置页面标题
Page.Title = ConfigHelper.Title; Page.Title = ConfigHelper.Title;
if (!string.IsNullOrWhiteSpace(Request["user"]))
{
if (Request.RawUrl.Contains("user="))
{
FormsAuthentication.SignOut(); //存在user=,则清除cookie
if (!string.IsNullOrWhiteSpace(Request["ReturnUrl"]))
{
//存在重定向url,则获取重定向url中的ReturnUrl
Uri _url = new Uri("htpp://192.168.1.1" + Request["ReturnUrl"]);
if (!string.IsNullOrEmpty(Request["user"]) && !string.IsNullOrWhiteSpace(_url.AbsolutePath))
{
var nvc = HttpUtility.ParseQueryString(_url.Query);
nvc.Remove("user");//移除user参数,避免二次清空cookie
LoginSuccess(Request["user"], _url.AbsolutePath + "?" + nvc.ToString());
}
}
else
{
//若已存在登录票据,则使用url的user参数登录
var nvc = HttpUtility.ParseQueryString(Request.Url.Query);
nvc.Remove("user");
LoginSuccess(Request["user"], Request.Url.AbsolutePath + "?" + nvc.ToString());
}
}
}
}
private void LoginSuccess(string userId,string RedirectUrl)
{
var user = DB.Users.FirstOrDefault(p => p.CellPhone == userId && p.Deleted == 0);
if (user !=null)
{
//RegisterOnlineUser(user);
Session["UserPowerList"] = null;
// 用户所属的角色字符串,以逗号分隔
string roleIDs = String.Empty;
if (user.Roles != null)
{
roleIDs = String.Join(",", user.Roles.Select(r => r.ID).ToArray());
}
bool isPersistent = false;
DateTime expiration = DateTime.Now.AddMinutes(240);
CreateFormsAuthenticationTicket(user.Name, roleIDs, isPersistent, expiration);
var _requestUrl = Request.Url.AbsolutePath;
// 重定向到登陆后首页
Response.Redirect(RedirectUrl);
}
else
{
Response.Redirect(FormsAuthentication.DefaultUrl);
}
} }
private bool IsSystemTheme(string themeName) private bool IsSystemTheme(string themeName)
......
No preview for this file type
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
<!-- 密码 --> <!-- 密码 -->
</mySection> </mySection>
<appSettings> <appSettings>
<add key="Default" value="Password=Water_Password_R;Persist Security Info=True;User ID=Water_User_R;Initial Catalog=NewAfterService;Data Source=192.168.1.11;MultipleActiveResultSets=true" /> <add key="Default" value="Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=NewAfterService;Data Source=192.168.10.151;MultipleActiveResultSets=true;Max Pool Size=300" />
</appSettings> </appSettings>
<connectionStrings> <connectionStrings>
<clear /> <clear />
<add name="Default" connectionString="Password=Water_Password_R;Persist Security Info=True;User ID=Water_User_R;Initial Catalog=NewAfterService;Data Source=192.168.1.11;MultipleActiveResultSets=true" providerName="System.Data.SqlClient" /> <add name="Default" connectionString="Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=NewAfterService;Data Source=192.168.10.151;MultipleActiveResultSets=true;Max Pool Size=300" providerName="System.Data.SqlClient" />
<add name="MySQL" connectionString="Server=localhost;Database=NewAfterService;Uid=root;Pwd=root;Charset=utf8" providerName="MySql.Data.MySqlClient" /> <!--add name="MySQL" connectionString="Server=localhost;Database=NewAfterService;Uid=root;Pwd=root;Charset=utf8" providerName="MySql.Data.MySqlClient" /-->
</connectionStrings> </connectionStrings>
<FineUIPro DebugMode="true" Theme="Default" EnableAnimation="true" /> <FineUIPro DebugMode="true" Theme="Default" EnableAnimation="true" />
<!-- <!--
......
No preview for this file type
d66d85549649d32e728ef5dfd2b59452139d92e6 ae9cbbf9e9926bc18988ca5955aacf0e1a68c5a0
...@@ -65,3 +65,26 @@ D:\Code\AppBox\AppBox\obj\Debug\AppBox.csproj.CoreCompileInputs.cache ...@@ -65,3 +65,26 @@ D:\Code\AppBox\AppBox\obj\Debug\AppBox.csproj.CoreCompileInputs.cache
D:\Code\AppBox\AppBox\obj\Debug\AppBox.csproj.CopyComplete D:\Code\AppBox\AppBox\obj\Debug\AppBox.csproj.CopyComplete
D:\Code\AppBox\AppBox\obj\Debug\AppBox.dll D:\Code\AppBox\AppBox\obj\Debug\AppBox.dll
D:\Code\AppBox\AppBox\obj\Debug\AppBox.pdb D:\Code\AppBox\AppBox\obj\Debug\AppBox.pdb
G:\AppBox\AppBox\bin\AppBox.dll.config
G:\AppBox\AppBox\bin\AppBox.dll
G:\AppBox\AppBox\bin\AppBox.pdb
G:\AppBox\AppBox\bin\EntityFramework.dll
G:\AppBox\AppBox\bin\EntityFramework.Extended.dll
G:\AppBox\AppBox\bin\EntityFramework.SqlServer.dll
G:\AppBox\AppBox\bin\FineUIPro.dll
G:\AppBox\AppBox\bin\ICSharpCode.SharpZipLib.dll
G:\AppBox\AppBox\bin\Kingdee.BOS.WebApi.Client.dll
G:\AppBox\AppBox\bin\MisDelivery.dll
G:\AppBox\AppBox\bin\Newtonsoft.Json.dll
G:\AppBox\AppBox\bin\NPOI.dll
G:\AppBox\AppBox\bin\NPOI.OOXML.dll
G:\AppBox\AppBox\bin\NPOI.OpenXml4Net.dll
G:\AppBox\AppBox\bin\NPOI.OpenXmlFormats.dll
G:\AppBox\AppBox\bin\MisDelivery.pdb
G:\AppBox\AppBox\bin\FineUIPro.xml
G:\AppBox\AppBox\bin\NPOI.xml
G:\AppBox\AppBox\obj\Debug\AppBox.csproj.AssemblyReference.cache
G:\AppBox\AppBox\obj\Debug\AppBox.csproj.CoreCompileInputs.cache
G:\AppBox\AppBox\obj\Debug\AppBox.dll
G:\AppBox\AppBox\obj\Debug\AppBox.pdb
G:\AppBox\AppBox\obj\Debug\AppBox.csproj.CopyComplete
762aa214801133636a3ee0662bf2472f68ef507c dd5121b7704d5d7d6ef3de141dc7307e5fb7fd46
...@@ -29,3 +29,13 @@ D:\Code\AppBox\MisDelivery\obj\Debug\MisDelivery.csproj.CoreCompileInputs.cache ...@@ -29,3 +29,13 @@ D:\Code\AppBox\MisDelivery\obj\Debug\MisDelivery.csproj.CoreCompileInputs.cache
D:\Code\AppBox\MisDelivery\obj\Debug\MisDelivery.csproj.CopyComplete D:\Code\AppBox\MisDelivery\obj\Debug\MisDelivery.csproj.CopyComplete
D:\Code\AppBox\MisDelivery\obj\Debug\MisDelivery.dll D:\Code\AppBox\MisDelivery\obj\Debug\MisDelivery.dll
D:\Code\AppBox\MisDelivery\obj\Debug\MisDelivery.pdb D:\Code\AppBox\MisDelivery\obj\Debug\MisDelivery.pdb
G:\AppBox\MisDelivery\bin\Debug\MisDelivery.dll
G:\AppBox\MisDelivery\bin\Debug\MisDelivery.pdb
G:\AppBox\MisDelivery\bin\Debug\Kingdee.BOS.WebApi.Client.dll
G:\AppBox\MisDelivery\bin\Debug\Kingdee.UploadDownload.dll
G:\AppBox\MisDelivery\bin\Debug\Newtonsoft.Json.dll
G:\AppBox\MisDelivery\bin\Debug\Newtonsoft.Json.xml
G:\AppBox\MisDelivery\obj\Debug\MisDelivery.csproj.CoreCompileInputs.cache
G:\AppBox\MisDelivery\obj\Debug\MisDelivery.csproj.CopyComplete
G:\AppBox\MisDelivery\obj\Debug\MisDelivery.dll
G:\AppBox\MisDelivery\obj\Debug\MisDelivery.pdb
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment