Преглед на файлове

Merge branch '长阳分支中职' of http://8.141.155.183:3000/bjquanjiang/DigitalScholl into 长阳分支中职

长阳分支中职
ndbs преди 3 седмици
родител
ревизия
83b4cd5a29
променени са 8 файла, в които са добавени 88 реда и са изтрити 34 реда
  1. +1
    -0
      .gitignore
  2. +40
    -28
      Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs
  3. +3
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs
  4. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/Arrangelesson.cs
  5. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/SSOApi.cs
  6. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj
  7. +33
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Log/LogHelper.cs
  8. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Security/DESEncrypt.cs

+ 1
- 0
.gitignore Целия файл

@@ -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/Learun.Application.Web/Properties/PublishProfiles
/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/QRCode
/Learun.Framework.Ultimate V7/Learun.Application.WebApi/logs/

+ 40
- 28
Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs Целия файл

@@ -666,39 +666,51 @@ namespace Learun.Application.Web.Controllers
//修改用户的允许登录结束时间;
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("跳转失败");
}




+ 3
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs Целия файл

@@ -90,7 +90,7 @@ namespace Learun.Application.Web.Controllers
var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid);
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));
return SuccessString("true");
@@ -132,7 +132,7 @@ namespace Learun.Application.Web.Controllers
var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid);
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));
if (res.stateCode == 1)
@@ -182,7 +182,7 @@ namespace Learun.Application.Web.Controllers
var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid);
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));
if (res.stateCode == 1)


+ 6
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/Arrangelesson.cs Целия файл

@@ -44,6 +44,7 @@ namespace Learun.Application.WebApi.Modules
Get["/allschool"] = GetAllSchools;
Get["/allclasslesson"] = GetAllClassLesson;
Get["/allelelectivelesson"] = GetAllElectiveLesson;
Get["/allteacheruser"] = GetAllTeachersUsers;
//以下接口不往ArrangeLessonSync里记录已传数据
Get["/schoolNotRecord"] = GetSchoolsNotRecord;
@@ -115,6 +116,11 @@ namespace Learun.Application.WebApi.Modules
var result = empInfoIbll.GetAllList().Where(m => m.CheckMark == true).ToList();
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 _)
{
var result = companyIbll.GetList();


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/SSOApi.cs Целия файл

@@ -71,7 +71,7 @@ namespace Learun.Application.WebApi.Modules
var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid);
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));
return SuccessString("true");
@@ -114,7 +114,7 @@ namespace Learun.Application.WebApi.Modules
var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid);
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));
if (res.stateCode == 1)


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj Целия файл

@@ -95,6 +95,7 @@
<Compile Include="DataBase\FieldTypeHepler.cs" />
<Compile Include="DataBase\FieldValueParam.cs" />
<Compile Include="DataBase\DbWhere.cs" />
<Compile Include="Log\LogHelper.cs" />
<Compile Include="Mail\Model\MailAccount .cs" />
<Compile Include="Mail\Model\MailFile.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\Microsoft.DependencyValidation.Analyzers.dll" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">


+ 33
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Log/LogHelper.cs Целия файл

@@ -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
{


}
}
}
}

+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Security/DESEncrypt.cs Целия файл

@@ -42,7 +42,7 @@ namespace Learun.Util
}
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
byte[] inputByteArray;
inputByteArray = Encoding.Default.GetBytes(Text);
inputByteArray = Encoding.Default.GetBytes(Text ?? "");
des.Key = ASCIIEncoding.ASCII.GetBytes(key);
des.IV = ASCIIEncoding.ASCII.GetBytes(iv);
System.IO.MemoryStream ms = new System.IO.MemoryStream();


Зареждане…
Отказ
Запис