Browse Source

Merge branch 'master' of 123.57.209.16:bjquanjiang/DigitalScholl

中职版本
liangkun 4 years ago
parent
commit
82873730a2
5 changed files with 86 additions and 5 deletions
  1. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_ReceiveFile/Index.cshtml
  2. +3
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/SelectForm.js
  3. +71
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Common/Timeout.cs
  4. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj
  5. +10
    -3
      Learun.Framework.Ultimate V7/Quanjiang.DigitalScholl.WebLicense/LicenseChecker.cs

+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_ReceiveFile/Index.cshtml View File

@@ -25,7 +25,7 @@
<div class=" btn-group btn-group-sm">
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<div class=" btn-group btn-group-sm">
<a id="lr_Read" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;查阅</a>
<a id="lr_SpecifyReceiver" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;指定接收人</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>


+ 3
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/SelectForm.js View File

@@ -232,7 +232,9 @@ var bootstrap = function ($, learun) {
postitem.text += ",";
}
if (userlistselected[i] != 'null') {
postitem.text += userlistselectedobj[userlistselected[i]].F_RealName;
if (userlistselectedobj[userlistselected[i]]) {
postitem.text += userlistselectedobj[userlistselected[i]].F_RealName;
}
}
}
callBack(postitem, dfopid);


+ 71
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Common/Timeout.cs View File

@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Learun.Util.Common
{
public delegate bool DoHandler();

public class Timeout
{
private ManualResetEvent mTimeoutObject;
//标记变量
private bool mBoTimeout;

public DoHandler Do;

public Timeout()
{
// 初始状态为 停止
this.mTimeoutObject = new ManualResetEvent(true);
}
///<summary>
/// 指定超时时间 异步执行某个方法
///</summary>
///<returns>执行 是否超时</returns>
public bool DoWithTimeout(TimeSpan timeSpan)
{
if (this.Do == null)
{
return false;
}
this.mTimeoutObject.Reset();
this.mBoTimeout = true; //标记
this.Do.BeginInvoke(DoAsyncCallBack, null);
// 等待 信号Set
if (!this.mTimeoutObject.WaitOne(timeSpan, false))
{
this.mBoTimeout = true;
}
return this.mBoTimeout;
}
///<summary>
/// 异步委托 回调函数
///</summary>
///<param name="result"></param>
private void DoAsyncCallBack(IAsyncResult result)
{
try
{
//this.Do.EndInvoke(result);
//// 指示方法的执行未超时
//this.mBoTimeout = false;


this.mBoTimeout = this.Do.EndInvoke(result);
}
catch (Exception ex)
{
this.mBoTimeout = true;
}
finally
{
this.mTimeoutObject.Set();
}
}
}

}

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj View File

@@ -88,6 +88,7 @@
<ItemGroup>
<Compile Include="Attributes\EnumAttribute.cs" />
<Compile Include="Common\CommonHelper.cs" />
<Compile Include="Common\Timeout.cs" />
<Compile Include="Config\Config.cs" />
<Compile Include="DataBase\DataConvert.cs" />
<Compile Include="DataBase\FieldTypeHepler.cs" />


+ 10
- 3
Learun.Framework.Ultimate V7/Quanjiang.DigitalScholl.WebLicense/LicenseChecker.cs View File

@@ -6,10 +6,12 @@ using System.Net;
using System.Text;
using System.Threading.Tasks;
using Learun.Util;
using Learun.Util.Common;
using Newtonsoft.Json;

namespace Quanjiang.DigitalScholl.WebLicense
{

public class LicenseStatus
{
public bool Result { get; set; }
@@ -42,7 +44,6 @@ namespace Quanjiang.DigitalScholl.WebLicense
}

}

public static LicenseStatus CheckLicense()
{
StreamReader sr = null;
@@ -53,8 +54,14 @@ namespace Quanjiang.DigitalScholl.WebLicense



var maResult = GetMAManagementInfo();
if (!maResult)
Timeout timeout = new Timeout();
timeout.Do = GetMAManagementInfo;
bool bo = timeout.DoWithTimeout(new TimeSpan(0, 0, 0, 2));



//var maResult = GetMAManagementInfo();
if (!bo)
{
ls.Message = "未授权";
return ls;


Loading…
Cancel
Save