@@ -82,3 +82,4 @@ Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js | |||||
/Learun.Framework.Ultimate V7/LearunApp-2.2.0/.hbuilderx/launch.json | /Learun.Framework.Ultimate V7/LearunApp-2.2.0/.hbuilderx/launch.json | ||||
/Learun.Framework.Ultimate V7/Learun.Application.Web/Properties/PublishProfiles | /Learun.Framework.Ultimate V7/Learun.Application.Web/Properties/PublishProfiles | ||||
/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/QRCode | /Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/QRCode | ||||
/Learun.Framework.Ultimate V7/Learun.Application.WebApi/logs/ |
@@ -666,39 +666,51 @@ namespace Learun.Application.Web.Controllers | |||||
//修改用户的允许登录结束时间; | //修改用户的允许登录结束时间; | ||||
userBll.UpdateAllowEndTime(userEntity.F_UserId, 0); | userBll.UpdateAllowEndTime(userEntity.F_UserId, 0); | ||||
if (!Returnurl.IsEmpty() && !appid.IsEmpty()) | |||||
try | |||||
{ | { | ||||
var perm_application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | |||||
if (perm_application != null) | |||||
if (!Returnurl.IsEmpty() && !appid.IsEmpty()) | |||||
{ | { | ||||
//var userinfo = LoginUserInfo.Get(); | |||||
//写入当前请求所登录的用户 | |||||
var type = 0;//1学生 0教师 | |||||
if (userEntity.F_Description == "学生") | |||||
var perm_application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | |||||
if (perm_application != null) | |||||
{ | { | ||||
type = 1; | |||||
} | |||||
var url = HttpUtility.UrlDecode(Returnurl); | |||||
if (url.Contains("?")) | |||||
{ | |||||
url += "&appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userEntity.F_RealName, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userEntity.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userEntity.F_EnCode, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); | |||||
} | |||||
else | |||||
{ | |||||
url += "?appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userEntity.F_RealName, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userEntity.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userEntity.F_EnCode, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); | |||||
//var userinfo = LoginUserInfo.Get(); | |||||
//写入当前请求所登录的用户 | |||||
var type = 0;//1学生 0教师 | |||||
if (userEntity.F_Description == "学生") | |||||
{ | |||||
type = 1; | |||||
} | |||||
var url = HttpUtility.UrlDecode(Returnurl); | |||||
if (url.Contains("?")) | |||||
{ | |||||
url += "&appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userEntity.F_RealName, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userEntity.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userEntity.F_EnCode, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); | |||||
} | |||||
else | |||||
{ | |||||
url += "?appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userEntity.F_RealName, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userEntity.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userEntity.F_EnCode, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); | |||||
} | |||||
Returnurl = url; | |||||
} | } | ||||
Returnurl = url; | |||||
Perm_FunctionVisitEntity functionVisitEntity = new Perm_FunctionVisitEntity(); | |||||
functionVisitEntity.Create(); | |||||
functionVisitEntity.Fid = perm_application.FId; | |||||
functionVisitEntity.PDate = DateTime.Now; | |||||
functionVisitEntity.PUId = userEntity.F_UserId; | |||||
functionVisitEntity.PUName = userEntity.F_RealName; | |||||
functionVisitEntity.PIsLoginSuccess = true; | |||||
functionVisitEntity.PContent = "成功跳转到:" + Returnurl; | |||||
functionVisitIbll.SaveEntity(null, functionVisitEntity); | |||||
return Success("登录成功", new { FInterfaceUrl = Returnurl }); | |||||
} | } | ||||
Perm_FunctionVisitEntity functionVisitEntity = new Perm_FunctionVisitEntity(); | |||||
functionVisitEntity.Create(); | |||||
functionVisitEntity.Fid = perm_application.FId; | |||||
functionVisitEntity.PDate = DateTime.Now; | |||||
functionVisitEntity.PUId = userEntity.F_UserId; | |||||
functionVisitEntity.PUName = userEntity.F_RealName; | |||||
functionVisitEntity.PIsLoginSuccess = true; | |||||
functionVisitEntity.PContent = "成功跳转到:" + Returnurl; | |||||
functionVisitIbll.SaveEntity(null, functionVisitEntity); | |||||
return Success("登录成功", new { FInterfaceUrl = Returnurl }); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
logEntity.F_ExecuteResult = 0; | |||||
logEntity.F_ExecuteResultJson = "跳转失败:" + ex; | |||||
logEntity.F_SourceContentJson = "Returnurl:" + Returnurl + " appid:" + appid; | |||||
logEntity.WriteLog(); | |||||
return Fail("跳转失败"); | |||||
} | } | ||||
@@ -90,7 +90,7 @@ namespace Learun.Application.Web.Controllers | |||||
var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | ||||
if (application != null) | if (application != null) | ||||
{ | { | ||||
if (Md5Helper.Encrypt(application.FSecret, 32) == appkey) | |||||
if (Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) == appkey) | |||||
{ | { | ||||
OperatorHelper.Instance.EmptyCurrent(DESEncrypt.Decrypt(t), DESEncrypt.Decrypt(m)); | OperatorHelper.Instance.EmptyCurrent(DESEncrypt.Decrypt(t), DESEncrypt.Decrypt(m)); | ||||
return SuccessString("true"); | return SuccessString("true"); | ||||
@@ -132,7 +132,7 @@ namespace Learun.Application.Web.Controllers | |||||
var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | ||||
if (application != null) | if (application != null) | ||||
{ | { | ||||
if (Md5Helper.Encrypt(application.FSecret, 32) == appkey) | |||||
if (Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) == appkey) | |||||
{ | { | ||||
OperatorResult res = OperatorHelper.Instance.IsOnLine(DESEncrypt.Decrypt(t), DESEncrypt.Decrypt(m)); | OperatorResult res = OperatorHelper.Instance.IsOnLine(DESEncrypt.Decrypt(t), DESEncrypt.Decrypt(m)); | ||||
if (res.stateCode == 1) | if (res.stateCode == 1) | ||||
@@ -182,7 +182,7 @@ namespace Learun.Application.Web.Controllers | |||||
var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | ||||
if (application != null) | if (application != null) | ||||
{ | { | ||||
if (Md5Helper.Encrypt(application.FSecret, 32) == appkey) | |||||
if (Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) == appkey) | |||||
{ | { | ||||
OperatorResult res = OperatorHelper.Instance.IsOnLine(DESEncrypt.Decrypt(t), DESEncrypt.Decrypt(m)); | OperatorResult res = OperatorHelper.Instance.IsOnLine(DESEncrypt.Decrypt(t), DESEncrypt.Decrypt(m)); | ||||
if (res.stateCode == 1) | if (res.stateCode == 1) | ||||
@@ -44,6 +44,7 @@ namespace Learun.Application.WebApi.Modules | |||||
Get["/allschool"] = GetAllSchools; | Get["/allschool"] = GetAllSchools; | ||||
Get["/allclasslesson"] = GetAllClassLesson; | Get["/allclasslesson"] = GetAllClassLesson; | ||||
Get["/allelelectivelesson"] = GetAllElectiveLesson; | Get["/allelelectivelesson"] = GetAllElectiveLesson; | ||||
Get["/allteacheruser"] = GetAllTeachersUsers; | |||||
//以下接口不往ArrangeLessonSync里记录已传数据 | //以下接口不往ArrangeLessonSync里记录已传数据 | ||||
Get["/schoolNotRecord"] = GetSchoolsNotRecord; | Get["/schoolNotRecord"] = GetSchoolsNotRecord; | ||||
@@ -115,6 +116,11 @@ namespace Learun.Application.WebApi.Modules | |||||
var result = empInfoIbll.GetAllList().Where(m => m.CheckMark == true).ToList(); | var result = empInfoIbll.GetAllList().Where(m => m.CheckMark == true).ToList(); | ||||
return Success(result); | return Success(result); | ||||
} | } | ||||
private Response GetAllTeachersUsers(dynamic _) | |||||
{ | |||||
var result = userIbll.GetAllList().Where(m => m.F_DeleteMark == 0 && m.F_EnabledMark == 1 && m.F_Description == "教师").ToList(); | |||||
return Success(result); | |||||
} | |||||
private Response GetAllSchools(dynamic _) | private Response GetAllSchools(dynamic _) | ||||
{ | { | ||||
var result = companyIbll.GetList(); | var result = companyIbll.GetList(); | ||||
@@ -71,7 +71,7 @@ namespace Learun.Application.WebApi.Modules | |||||
var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | ||||
if (application != null) | if (application != null) | ||||
{ | { | ||||
if (Md5Helper.Encrypt(application.FSecret, 32) == appkey) | |||||
if (Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) == appkey) | |||||
{ | { | ||||
OperatorHelper.Instance.EmptyCurrent(DESEncrypt.Decrypt(t), DESEncrypt.Decrypt(m)); | OperatorHelper.Instance.EmptyCurrent(DESEncrypt.Decrypt(t), DESEncrypt.Decrypt(m)); | ||||
return SuccessString("true"); | return SuccessString("true"); | ||||
@@ -114,7 +114,7 @@ namespace Learun.Application.WebApi.Modules | |||||
var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); | ||||
if (application != null) | if (application != null) | ||||
{ | { | ||||
if (Md5Helper.Encrypt(application.FSecret, 32) == appkey) | |||||
if (Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) == appkey) | |||||
{ | { | ||||
OperatorResult res = OperatorHelper.Instance.IsOnLine(DESEncrypt.Decrypt(t), DESEncrypt.Decrypt(m)); | OperatorResult res = OperatorHelper.Instance.IsOnLine(DESEncrypt.Decrypt(t), DESEncrypt.Decrypt(m)); | ||||
if (res.stateCode == 1) | if (res.stateCode == 1) | ||||
@@ -95,6 +95,7 @@ | |||||
<Compile Include="DataBase\FieldTypeHepler.cs" /> | <Compile Include="DataBase\FieldTypeHepler.cs" /> | ||||
<Compile Include="DataBase\FieldValueParam.cs" /> | <Compile Include="DataBase\FieldValueParam.cs" /> | ||||
<Compile Include="DataBase\DbWhere.cs" /> | <Compile Include="DataBase\DbWhere.cs" /> | ||||
<Compile Include="Log\LogHelper.cs" /> | |||||
<Compile Include="Mail\Model\MailAccount .cs" /> | <Compile Include="Mail\Model\MailAccount .cs" /> | ||||
<Compile Include="Mail\Model\MailFile.cs" /> | <Compile Include="Mail\Model\MailFile.cs" /> | ||||
<Compile Include="Mail\Model\MailModel.cs" /> | <Compile Include="Mail\Model\MailModel.cs" /> | ||||
@@ -154,6 +155,7 @@ | |||||
<Analyzer Include="..\..\..\packages\Microsoft.DependencyValidation.Analyzers.0.10.0\analyzers\dotnet\cs\Microsoft.DependencyValidation.Analyzers.resources.dll" /> | <Analyzer Include="..\..\..\packages\Microsoft.DependencyValidation.Analyzers.0.10.0\analyzers\dotnet\cs\Microsoft.DependencyValidation.Analyzers.resources.dll" /> | ||||
<Analyzer Include="..\..\..\packages\Microsoft.DependencyValidation.Analyzers.0.10.0\analyzers\dotnet\Microsoft.DependencyValidation.Analyzers.dll" /> | <Analyzer Include="..\..\..\packages\Microsoft.DependencyValidation.Analyzers.0.10.0\analyzers\dotnet\Microsoft.DependencyValidation.Analyzers.dll" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup /> | |||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> | <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> | ||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||||
@@ -0,0 +1,33 @@ | |||||
using System; | |||||
using System.IO; | |||||
namespace Learun.Util.Log | |||||
{ | |||||
public class LogHelper | |||||
{ | |||||
public static void Info(string msg) | |||||
{ | |||||
try | |||||
{ | |||||
#region log | |||||
//文件路径 | |||||
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs"); | |||||
if (!Directory.Exists(path)) | |||||
{ | |||||
Directory.CreateDirectory(path); | |||||
} | |||||
//文件 | |||||
string fileName = Path.Combine(path, $"{DateTime.Now:yyyyMMdd}.log"); | |||||
string message = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss} logInfo:{msg}。{Environment.NewLine}"; | |||||
File.AppendAllText(fileName, message); | |||||
#endregion | |||||
} | |||||
catch | |||||
{ | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -42,7 +42,7 @@ namespace Learun.Util | |||||
} | } | ||||
DESCryptoServiceProvider des = new DESCryptoServiceProvider(); | DESCryptoServiceProvider des = new DESCryptoServiceProvider(); | ||||
byte[] inputByteArray; | byte[] inputByteArray; | ||||
inputByteArray = Encoding.Default.GetBytes(Text); | |||||
inputByteArray = Encoding.Default.GetBytes(Text ?? ""); | |||||
des.Key = ASCIIEncoding.ASCII.GetBytes(key); | des.Key = ASCIIEncoding.ASCII.GetBytes(key); | ||||
des.IV = ASCIIEncoding.ASCII.GetBytes(iv); | des.IV = ASCIIEncoding.ASCII.GetBytes(iv); | ||||
System.IO.MemoryStream ms = new System.IO.MemoryStream(); | System.IO.MemoryStream ms = new System.IO.MemoryStream(); | ||||