@@ -67,10 +67,10 @@ var bootstrap = function ($, learun) { | |||
var keyValue = $('#gridtable').jfGridValue('AId'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
id: 'Ass_AssetsInfoItemIndex', | |||
title: '资产明细', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/Index?AId=' + keyValue, | |||
width: 1000, | |||
width: 1300, | |||
height: 700, | |||
btn: null, | |||
end: function () { | |||
@@ -7,6 +7,7 @@ | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItem"> | |||
<div class="lr-form-item-title">明细编号<font face="宋体">*</font></div> | |||
<input id="AICode" hidden="hidden" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
<input id="AId" type="hidden" class="form-control"/> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItem"> | |||
<div class="lr-form-item-title">序号<font face="宋体">*</font></div> | |||
@@ -5,6 +5,10 @@ | |||
* 描 述:在册登记明细 | |||
*/ | |||
var acceptClick; | |||
var AId = request("AId");//资产主键(资产明细的父主键) | |||
if (!!AId) { | |||
$('#AId').val(AId); | |||
} | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
@@ -5,7 +5,7 @@ | |||
* 描 述:在册登记明细 | |||
*/ | |||
var refreshGirdData; | |||
var AId = request("AId"); | |||
var AId = request("AId");//点击登记在册资产-查看明细,会传值进来,代表资产主键(资产明细的父主键) | |||
var currentUser = request("currentUser");//我的资产需要用到 | |||
var IsDelete = request("IsDelete");//报废资产需要使用 | |||
var bootstrap = function ($, learun) { | |||
@@ -50,7 +50,7 @@ var bootstrap = function ($, learun) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/Form', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/Form?AId=' + AId, | |||
width: 800, | |||
height: 700, | |||
callBack: function (id) { | |||
@@ -216,7 +216,17 @@ var bootstrap = function ($, learun) { | |||
} | |||
}, | |||
{ label: "开始维修时间", name: "RStartTime", width: 100, align: "left" }, | |||
{ label: "维修人", name: "RRepairUserId", width: 100, align: "left" }, | |||
{ | |||
label: "维修人", name: "RRepairUserId", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('user', { | |||
key: value, | |||
callback: function (_data) { | |||
callback(_data.name); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "维修完成时间", name: "REndTime", width: 100, align: "left" }, | |||
{ label: "维修确认时间", name: "RConfirmTime", width: 100, align: "left" }, | |||
{ | |||
@@ -3,11 +3,11 @@ | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_CustomerService"> | |||
<div class="col-xs-6 lr-form-item" data-table="Sys_CustomerService"> | |||
<div class="lr-form-item-title">更新时间<font face="宋体">*</font></div> | |||
<input id="UpdateTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#UpdateTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_UpdateRecord"> | |||
<div class="col-xs-6 lr-form-item" data-table="Sys_UpdateRecord"> | |||
<div class="lr-form-item-title">更新版本<font face="宋体">*</font></div> | |||
<input id="VersionNum" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
@@ -15,5 +15,13 @@ | |||
<div class="lr-form-item-title">更新内容<font face="宋体">*</font></div> | |||
<textarea id="Content" class="form-control" style="height:100px;" isvalid="yes" checkexpession="NotNull"></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_UpdateRecord" > | |||
<div class="lr-form-item-title">是否APP<font face="宋体">*</font></div> | |||
<div id="IsApp" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_UpdateRecord" > | |||
<div class="lr-form-item-title">apk文件</div> | |||
<div id="AppUrl"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LR_Desktop/Views/Sys_UpdateRecord/Form.js") |
@@ -15,6 +15,10 @@ var bootstrap = function ($, learun) { | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#IsApp').lrDataItemSelect({ | |||
code: 'YesOrNoBit', | |||
}); | |||
$('#AppUrl').lrUploader(); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
@@ -12,7 +12,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_add" class="btn btn-default"><i class="fa fa-plus"></i> 录入</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 修改</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
@@ -62,12 +62,17 @@ var bootstrap = function ($, learun) { | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/LR_Desktop/Sys_UpdateRecord/GetPageList', | |||
headData: [ | |||
{ label: "更新时间", name: "UpdateTime", width: 130, align: "left" }, | |||
{ label: "更新版本", name: "VersionNum", width: 100, align: "left" }, | |||
{ label: "更新内容", name: "Content", width: 100, align: "left" }, | |||
{ | |||
label: "是否APP", name: "IsApp", width: 100, align: "left", formatter: function (cellvalue) { | |||
return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||
} | |||
} | |||
], | |||
mainId: 'Id', | |||
isPage: true, | |||
@@ -285,7 +285,6 @@ | |||
setTimeout(onload(), 10000); | |||
function onload() { | |||
$(".lr-desktop-panel").lrscroll(); | |||
top.learun.clientdata.getAsync("desktop", | |||
{ | |||
@@ -295,8 +294,8 @@ | |||
a(g.chart || []); | |||
} | |||
}); | |||
funopen(); | |||
} | |||
} | |||
funopen(); | |||
window.setInterval(funopen, 60000); | |||
//消息提醒 | |||
@@ -155,6 +155,8 @@ | |||
<add key="ACIp2" value="192.168.200.252"/> | |||
<!-- 是否强制验证强密码 --> | |||
<add key="verifypwd" value="false"/> | |||
<!-- 是否单客户端登录 --> | |||
<add key="verifyonelogin" value="false"/> | |||
<!--疫情防控组角色Id--> | |||
<add key="EpidemicControlTeamRoleId" value="87f38e4e-b0a6-472c-b01a-2620b8f1ec46" /> | |||
<!--注册教师生成编号 金隅:jy;西昌:xc;大厂:dc--> | |||
@@ -180,7 +180,7 @@ namespace Learun.Application.WebApi | |||
ReqParameter req = this.Bind<ReqParameter>(); | |||
loginMark = req.loginMark; | |||
token = req.token; | |||
if (path == "/learun/adms/user/login"|| path== "/learun/adms/user/logincodeverify" || path == "/learun/adms/user/loginbyIdCard" || path == "/" || path == "/bgimg" || path == "/learun/adms/user/img" || path == "/learun/adms/desktop/img"||path== "/learun/adms/user/imgfordc" || path == "/learun/adms/StampPersonal/img") | |||
if (path == "/learun/adms/user/login"|| path== "/learun/adms/user/logincodeverify" || path == "/learun/adms/user/loginbyIdCard" || path == "/" || path == "/bgimg" || path == "/learun/adms/user/img" || path == "/learun/adms/desktop/img"||path== "/learun/adms/user/imgfordc" || path == "/learun/adms/StampPersonal/img"||path== "/learun/adms/user/checkupdate") | |||
{// 登录接口,默认页面接口不做权限验证处理 | |||
return null; | |||
} | |||
@@ -8,6 +8,7 @@ using Nancy; | |||
using System.Collections.Generic; | |||
using System.Configuration; | |||
using System.Linq; | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using Learun.Cache.Base; | |||
using Learun.Cache.Factory; | |||
using Quanjiang.DigitalScholl.SendSms; | |||
@@ -37,10 +38,12 @@ namespace Learun.Application.WebApi | |||
Post["/loginbyIdCard"] = LoginByIdCard; | |||
Get["/info"] = Info; | |||
Get["/onedrivelogin"] = onedrivelogin; | |||
Get["/map"] = GetMap; | |||
Get["/img"] = GetImg; | |||
Get["/imgfordc"] = GetImgForDC; | |||
Get["/saveMap"] = GetSaveClassMap; | |||
Get["/checkupdate"] = CheckUpdate; | |||
} | |||
private UserIBLL userIBLL = new UserBLL(); | |||
@@ -50,6 +53,29 @@ namespace Learun.Application.WebApi | |||
CdMajorIBLL majorIbll = new CdMajorBLL(); | |||
private readonly ISms yixintongSms = new YixintongSms(); | |||
private ICache redisCache = CacheFactory.CaChe(); | |||
private Sys_UpdateRecordIBLL sysUpdateRecordIbll = new Sys_UpdateRecordBLL(); | |||
AnnexesFileIBLL annexesFileIbll=new AnnexesFileBLL(); | |||
/// <summary> | |||
/// 检查更新 | |||
/// </summary> | |||
/// <param name="_"></param> | |||
/// <returns></returns> | |||
private Response CheckUpdate(dynamic _) | |||
{ | |||
var update=sysUpdateRecordIbll.GetNewest(); | |||
if (update!=null&&!string.IsNullOrEmpty(update.AppUrl)) | |||
{ | |||
var downurl = annexesFileIbll.GetEntityByFolderId(update.AppUrl); | |||
if (downurl.F_FilePath.Contains("Resource")) | |||
{ | |||
return Success(new { version = update.VersionNum, content = update.Content, url ="/"+ downurl.F_FilePath.Substring(downurl.F_FilePath.IndexOf("Resource")) }); | |||
} | |||
return Success(new { version = update.VersionNum, content = update.Content, url = "" }); | |||
} | |||
return Success(new {version="1.0.0",content="",url=""}); | |||
} | |||
/// <summary> | |||
/// 登录二次短信验证 | |||
@@ -59,8 +85,8 @@ namespace Learun.Application.WebApi | |||
private Response LoginCodeVerify(dynamic _) | |||
{ | |||
MobileVerify mobileVerify = this.GetReqData<MobileVerify>(); | |||
var code=redisCache.Read<string>("studentuserlogin_" + mobileVerify.mobile); | |||
if (!string.IsNullOrEmpty(code)&& code==mobileVerify.verifycode) | |||
var code = redisCache.Read<string>("studentuserlogin_" + mobileVerify.mobile); | |||
if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode) | |||
{ | |||
return Success("验证成功。"); | |||
} | |||
@@ -114,10 +140,14 @@ namespace Learun.Application.WebApi | |||
//保存用户设备号 | |||
userIBLL.UpdateDeviceId(userEntity.F_UserId, loginModel.deviceid); | |||
OperatorResult res = OperatorHelper.Instance.IsOnLine(token, this.loginMark); | |||
res.userInfo.password = null; | |||
res.userInfo.secretkey = null; | |||
string verifyonelogin = Util.Config.GetValue("verifyonelogin"); | |||
if (string.IsNullOrEmpty(verifyonelogin) || verifyonelogin != "true") | |||
{ | |||
res.userInfo.logTime = null; | |||
} | |||
var studententity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(userEntity.F_Account); | |||
if (studententity != null) | |||
{ | |||
@@ -137,7 +167,7 @@ namespace Learun.Application.WebApi | |||
var result = yixintongSms.SendSmsToSingle(userEntity.F_Mobile, SmsType.LoginBind, listStr); | |||
if (result.Result.code == "0") | |||
{ | |||
redisCache.Write<string>("studentuserlogin_"+ userEntity.F_Mobile, raRndNum,new TimeSpan(0,5,0)); | |||
redisCache.Write<string>("studentuserlogin_" + userEntity.F_Mobile, raRndNum, new TimeSpan(0, 5, 0)); | |||
//日志 | |||
logEntity = new LogEntity(); | |||
logEntity.F_CategoryId = 3; | |||
@@ -170,7 +200,7 @@ namespace Learun.Application.WebApi | |||
logEntity.F_OperateType = "sms"; | |||
logEntity.F_OperateAccount = "system"; | |||
logEntity.F_ExecuteResult = 400; | |||
logEntity.F_ExecuteResultJson = "短信发送失败:" +e.Message; | |||
logEntity.F_ExecuteResultJson = "短信发送失败:" + e.Message; | |||
logEntity.F_Description = "短信发送:" + userEntity.F_Mobile; | |||
logEntity.WriteLog(); | |||
} | |||
@@ -186,7 +216,7 @@ namespace Learun.Application.WebApi | |||
baseinfo = res.userInfo, | |||
post = postIBLL.GetListByPostIds(res.userInfo.postIds), | |||
role = roleIBLL.GetListByRoleIds(res.userInfo.roleIds), | |||
pwd= pwd | |||
pwd = pwd | |||
}; | |||
return Success(jsonData); | |||
} | |||
@@ -228,7 +258,7 @@ namespace Learun.Application.WebApi | |||
{ | |||
//新增新生判断 | |||
var stuinfobasic = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(userEntity.F_EnCode); | |||
if (stuinfobasic!=null&&stuinfobasic.Grade!="21") | |||
if (stuinfobasic != null && stuinfobasic.Grade != "21") | |||
{ | |||
userEntity.LoginMsg = "只有新生支持身份证方式登录"; | |||
return Fail(userEntity.LoginMsg); | |||
@@ -274,7 +304,14 @@ namespace Learun.Application.WebApi | |||
} | |||
#endregion | |||
} | |||
private Response onedrivelogin(dynamic _) | |||
{ | |||
//多客户端登录判断 | |||
string logintime = redisCache.Read<string>("logintime" + userInfo.account, CacheId.loginInfo); | |||
return Success(new { | |||
logintime | |||
}); | |||
} | |||
/// <summary> | |||
/// 获取用户信息 | |||
/// </summary> | |||
@@ -102,6 +102,8 @@ | |||
<add key="ACIp2" value=""/> | |||
<!-- 是否强制验证强密码 --> | |||
<add key="verifypwd" value="false"/> | |||
<!-- 是否单客户端登录 --> | |||
<add key="verifyonelogin" value="false"/> | |||
<!--疫情防控组角色Id--> | |||
<add key="EpidemicControlTeamRoleId" value="87f38e4e-b0a6-472c-b01a-2620b8f1ec46" /> | |||
<add key="QJUrl" value="www.qj.com"/> | |||
@@ -675,21 +675,25 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
else | |||
{ | |||
entity.Create(); | |||
var assinfoEntity=new Ass_AssetsInfoEntity() | |||
if (string.IsNullOrEmpty(entity.AId)) | |||
{ | |||
AName= entity.AIASSName, | |||
ATId=entity.AIASSClass, | |||
AModel = entity.AISpecificationtype, | |||
AManufacturer = entity.AIManufacturer, | |||
ASource = entity.AIAddType, | |||
APrice = entity.AIAssValue, | |||
AUnit = entity?.AIUnits, | |||
ACode = Str.PinYin(entity.AIASSName), | |||
HasDetail = true | |||
}; | |||
assinfoEntity.Create(); | |||
entity.AId = assinfoEntity.AId; | |||
db.Insert(assinfoEntity); | |||
var assinfoEntity = new Ass_AssetsInfoEntity() | |||
{ | |||
AName = entity.AIASSName, | |||
ATId = entity.AIASSClass, | |||
AModel = entity.AISpecificationtype, | |||
AManufacturer = entity.AIManufacturer, | |||
ASource = entity.AIAddType, | |||
APrice = entity.AIAssValue, | |||
AUnit = entity?.AIUnits, | |||
ACode = Str.PinYin(entity.AIASSName), | |||
HasDetail = true | |||
}; | |||
assinfoEntity.Create(); | |||
entity.AId = assinfoEntity.AId; | |||
db.Insert(assinfoEntity); | |||
} | |||
db.Insert(entity); | |||
db.Commit(); | |||
} | |||
@@ -213,6 +213,25 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
} | |||
} | |||
public Sys_UpdateRecordEntity GetNewest() | |||
{ | |||
try | |||
{ | |||
return sys_UpdateRecordService.GetNewest(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -49,6 +49,12 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
[Column("ISAPP")] | |||
public bool? IsApp { get; set; } | |||
[Column("APPURL")] | |||
public string AppUrl { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
@@ -63,5 +63,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
Sys_UpdateRecordEntity GetOnlineUserNum(); | |||
List<UserEntity> GetOnlineUserInfo(); | |||
#endregion | |||
Sys_UpdateRecordEntity GetNewest(); | |||
} | |||
} |
@@ -32,16 +32,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.Id, | |||
t.VersionNum, | |||
t.Content, | |||
t.UpdateTime, | |||
t.CreateUserId, | |||
t.CreateUserName, | |||
t.CreateTime | |||
"); | |||
strSql.Append("SELECT * "); | |||
strSql.Append(" FROM Sys_UpdateRecord t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
@@ -273,5 +264,29 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
#endregion | |||
public Sys_UpdateRecordEntity GetNewest() | |||
{ | |||
try | |||
{ | |||
var list= this.BaseRepository().FindList<Sys_UpdateRecordEntity>("select * from Sys_UpdateRecord where IsApp=1 order by UpdateTime desc "); | |||
if (list.Count() > 0) | |||
{ | |||
return list.First(); | |||
} | |||
else | |||
return null; | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -154,6 +154,8 @@ namespace Learun.Util.Operat | |||
operatorInfo.iPAddress = Net.Ip; | |||
operatorInfo.browser = Net.Browser; | |||
operatorInfo.token = token; | |||
//登录时间记录 | |||
redisCache.Write<string>("logintime" + account, operatorInfo.logTime.ToDateTimeString(), CacheId.loginInfo); | |||
if (cookie) | |||
{ | |||
string cookieMark = WebHelper.GetCookie(LoginUserMarkKey).ToString(); | |||
@@ -167,6 +169,8 @@ namespace Learun.Util.Operat | |||
operatorInfo.loginMark = cookieMark; | |||
} | |||
WebHelper.WriteCookie(LoginUserToken, token); | |||
//登录时间记录 | |||
WebHelper.WriteCookie("logintime" + account, operatorInfo.logTime.ToDateTimeString()); | |||
} | |||
else | |||
{ | |||
@@ -229,6 +233,9 @@ namespace Learun.Util.Operat | |||
Dictionary<string, string> tokenMarkList = redisCache.Read<Dictionary<string, string>>(cacheKeyToken + operatorInfo.account, CacheId.loginInfo); | |||
tokenMarkList.Remove(loginMark); | |||
redisCache.Remove(cacheKeyOperator + loginMark, CacheId.loginInfo); | |||
//登录时间清除 | |||
redisCache.Remove("logintime" + operatorInfo.account, CacheId.loginInfo); | |||
WebHelper.RemoveCookie("logintime" + operatorInfo.account); | |||
redisCache.Write<Dictionary<string, string>>(cacheKeyToken + operatorInfo.account, tokenMarkList, CacheId.loginInfo); | |||
} | |||
} | |||
@@ -280,15 +287,32 @@ namespace Learun.Util.Operat | |||
tokenMarkList.Remove(loginMark); | |||
redisCache.Write<Dictionary<string, string>>(cacheKeyToken + operatorInfo.account, tokenMarkList, CacheId.loginInfo); | |||
redisCache.Remove(cacheKeyOperator + loginMark, CacheId.loginInfo); | |||
//登录时间清除 | |||
redisCache.Remove("logintime" + operatorInfo.account, CacheId.loginInfo); | |||
WebHelper.RemoveCookie("logintime" + operatorInfo.account); | |||
} | |||
else | |||
{ | |||
string verifyonelogin = Util.Config.GetValue("verifyonelogin"); | |||
if (!string.IsNullOrEmpty(verifyonelogin) && verifyonelogin == "true" && operatorInfo.account != "") | |||
{ | |||
if (operatorInfo.appId.Contains("PC")) | |||
{ | |||
//多客户端登录判断 | |||
string logintime = redisCache.Read<string>("logintime" + operatorInfo.account, CacheId.loginInfo); | |||
string cookielogintime = WebHelper.GetCookie("logintime" + operatorInfo.account); | |||
if (string.IsNullOrEmpty(logintime) || string.IsNullOrEmpty(cookielogintime) || logintime != cookielogintime) | |||
{ | |||
operatorResult.stateCode = 0; | |||
return operatorResult; | |||
} | |||
} | |||
} | |||
if (!string.IsNullOrEmpty(account) && account != operatorInfo.account) | |||
{ | |||
operatorResult.stateCode = 2; | |||
return operatorResult; | |||
} | |||
UserInfo userInfo = redisCache.Read<UserInfo>(cacheKeyInfo + operatorInfo.account, CacheId.loginInfo); | |||
if (userInfo == null || userInfo.loadTime == null || userInfo.loadTime <= DateTime.Now.AddMinutes(-5)) | |||
{ | |||
@@ -329,7 +353,7 @@ namespace Learun.Util.Operat | |||
var rolelist = userRelationIBLL.GetRoleListByUserId(userEntity.F_UserId); | |||
foreach (var roleEntity in rolelist) | |||
{ | |||
userInfo.roleName += roleEntity.F_FullName+ ","; | |||
userInfo.roleName += roleEntity.F_FullName + ","; | |||
} | |||
} | |||
userInfo.postIds = userRelationIBLL.GetObjectIds(userEntity.F_UserId, 2); | |||
@@ -352,6 +376,7 @@ namespace Learun.Util.Operat | |||
} | |||
else | |||
{ | |||
userInfo.logTime = operatorInfo.logTime; | |||
if (HttpContext.Current != null) | |||
{ | |||
HttpContext.Current.Items.Add("LoginUserInfo", userInfo); | |||
@@ -465,7 +490,7 @@ namespace Learun.Util.Operat | |||
logEntity.F_CategoryId = 3; | |||
logEntity.F_OperateTypeId = ((int)operateLogModel.type).ToString(); | |||
logEntity.F_OperateType = EnumAttribute.GetDescription(operateLogModel.type); | |||
logEntity.F_OperateAccount = operateLogModel.userInfo?.account+"("+ operateLogModel.userInfo.realName+ ")"; | |||
logEntity.F_OperateAccount = operateLogModel.userInfo?.account + "(" + operateLogModel.userInfo.realName + ")"; | |||
logEntity.F_OperateUserId = operateLogModel.userInfo?.userId; | |||
logEntity.F_Module = operateLogModel.title; | |||
logEntity.F_ExecuteResult = 1; | |||
@@ -120,7 +120,7 @@ namespace Learun.Util | |||
/// <summary> | |||
/// 登录时间 | |||
/// </summary> | |||
public DateTime logTime { get; set; } | |||
public DateTime? logTime { get; set; } | |||
/// <summary> | |||
/// 登录IP地址 | |||
/// </summary> | |||
@@ -2,7 +2,7 @@ export default { | |||
// 登录页显示的公司名称 | |||
"company": "数字化智慧校园", | |||
// App 版本号 | |||
"appVersion": "2.0", | |||
"appVersion": "1.0.0", | |||
// 是否允许用户注册 | |||
"enableSignUp": true, | |||
//请求数据的接口地址;可以配置多个,开发环境下登录页会出现选择菜单供您选择 | |||
@@ -18,10 +18,10 @@ export default { | |||
"apiHost": [ | |||
// "http://fwh.ldyesz.edu.cn:9000/",//H5打包 | |||
//"http://192.168.10.245:8000/",//app打包 | |||
"http://localhost:31173/", | |||
"http://192.168.10.122:8002/", | |||
], | |||
// "webHost": "http://10.10.4.45:8000/", | |||
"webHost": "http://localhost:20472/", | |||
"webHost": "http://192.168.10.122:8001/", | |||
// 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 | |||
"devAccount": [{ | |||
username: "system", | |||
@@ -124,12 +124,14 @@ | |||
chartsFontSize: 10, | |||
ready: false, | |||
CornerMarker: '' | |||
CornerMarker: '', | |||
timer:'' | |||
}; | |||
}, | |||
async onLoad(param) { | |||
await this.init(param); | |||
this.ON('home-openorclosetimer', this.openorclosetimer) | |||
}, | |||
async onShow() { | |||
if (this.ready) { | |||
@@ -151,18 +153,22 @@ | |||
// 页面初始化 | |||
async init(param) { | |||
this.HIDE_LOADING(); | |||
// 有参数表示可能是打开分享消息;将数据存入全局变量以备后续跳转 | |||
if (param && param.learun && param.pagePath) { | |||
this.SET_GLOBAL("jumpParam", param); | |||
} | |||
//单客户端登录判断 | |||
this.checkonedrivelogin(); | |||
// 登录状态无效,则跳转到登录页 | |||
const stateValid = await this.checkLoginState(); | |||
if (!stateValid) { | |||
this.RELAUNCH_TO("/pages/login"); | |||
return; | |||
} | |||
// #ifdef APP | |||
//检查更新 | |||
this.checkupdate(); | |||
// #endif | |||
// 图表相关参数初始化 | |||
this.initCharts(); | |||
@@ -208,8 +214,71 @@ | |||
} | |||
return; | |||
} | |||
//间隔10秒请求 | |||
this.timer= setInterval(()=>{ | |||
this.checkonedrivelogin() | |||
},10000) | |||
}, | |||
async checkupdate(){ | |||
var result=true; | |||
var appinfo = await this.HTTP_GET("learun/adms/user/checkupdate"); | |||
if(appinfo) | |||
{ | |||
if(appinfo.url) | |||
{ | |||
var appversion=this.CONFIG('appVersion'); | |||
var webHost=this.CONFIG('webHost'); | |||
if(appinfo.version!=appversion) | |||
{ | |||
result=false; | |||
uni.showModal({ | |||
showCancel:false, | |||
title: '发现新版本:'+appinfo.version, | |||
content: '请您立即更新,否则会造成使用不稳定或出现错误', | |||
success: function (res) { | |||
if (res.confirm) { | |||
//下载 | |||
plus.runtime.openURL(webHost+appinfo.url.replace(/\\/g, "\/")); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
} | |||
return result; | |||
}, | |||
//验证多客户端登录 | |||
async checkonedrivelogin() | |||
{ | |||
const token = this.GET_GLOBAL("token") || uni.getStorageSync("token"); | |||
if (!token || token === "null" || token === "undefined") { | |||
this.RELAUNCH_TO("/pages/login"); | |||
this.HIDE_LOADING(); | |||
return false; | |||
} | |||
this.SET_GLOBAL("token", token); | |||
var logintime=this.GET_STORAGE("logintime"); | |||
if(logintime) | |||
{ | |||
var userInfo = await this.HTTP_GET("learun/adms/user/onedrivelogin"); | |||
if (userInfo) { | |||
if(userInfo.logintime!=logintime) | |||
{ | |||
clearInterval(this.timer); | |||
this.RELAUNCH_TO("/pages/login"); | |||
} | |||
} | |||
else{ | |||
clearInterval(this.timer); | |||
this.RELAUNCH_TO("/pages/login"); | |||
} | |||
} | |||
}, | |||
openorclosetimer(){ | |||
this.timer&&clearInterval(this.timer); | |||
}, | |||
// 验证登录状态 | |||
async checkLoginState() { | |||
const token = this.GET_GLOBAL("token") || uni.getStorageSync("token"); | |||
@@ -250,7 +319,6 @@ | |||
user.miniProgram = true; | |||
} | |||
this.SET_GLOBAL("loginUser", user); | |||
return true; | |||
}, | |||
@@ -104,6 +104,8 @@ export default { | |||
}, | |||
async onLoad() { | |||
this.EMIT('home-openorclosetimer') | |||
this.OFF('home-openorclosetimer') | |||
await this.init() | |||
}, | |||
@@ -122,7 +124,38 @@ export default { | |||
this.password = account.password | |||
} | |||
this.ready = true | |||
// #ifdef APP | |||
this.checkupdate(); | |||
// #endif | |||
}, | |||
async checkupdate(){ | |||
var result=true; | |||
var appinfo = await this.HTTP_GET("learun/adms/user/checkupdate"); | |||
if(appinfo) | |||
{ | |||
if(appinfo.url) | |||
{ | |||
var appversion=this.CONFIG('appVersion'); | |||
var webHost=this.CONFIG('webHost'); | |||
if(appinfo.version!=appversion) | |||
{ | |||
result=false; | |||
uni.showModal({ | |||
showCancel:false, | |||
title: '发现新版本:'+appinfo.version, | |||
content: '请您立即更新,否则会造成使用不稳定或出现错误', | |||
success: function (res) { | |||
if (res.confirm) { | |||
//下载 | |||
plus.runtime.openURL(webHost+appinfo.url.replace(/\\/g, "\/")); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
} | |||
return result; | |||
}, | |||
// 点击新用户注册 | |||
signUp() { | |||
@@ -147,6 +180,10 @@ export default { | |||
// type=null 时表示使用账号密码登录 | |||
// type='weixin'/'alipay'/'dingtalk' 时表示使用小程序一键登录 | |||
async login(type) { | |||
// #ifdef APP | |||
if(!await this.checkupdate()) | |||
return; | |||
// #endif | |||
if(this.isCode){ | |||
this.checkverifycode() | |||
return | |||
@@ -219,7 +256,7 @@ export default { | |||
this.SET_GLOBAL('token', token) | |||
this.SET_GLOBAL('loginUser', user) | |||
this.SET_STORAGE("logintime",user.logTime); | |||
this.SET_STORAGE('token', token) | |||
this.HIDE_LOADING() | |||
@@ -258,7 +295,7 @@ export default { | |||
this.SET_GLOBAL('token', this.resData.token) | |||
this.SET_GLOBAL('loginUser', this.resData.user) | |||
this.SET_STORAGE("logintime",this.resData.user.logTime); | |||
this.SET_STORAGE('token', this.resData.token) | |||
this.TAB_TO('/pages/home') | |||
this.HIDE_LOADING() | |||