From cdb36ece59050290a30ca6ee03f4890d30d15911 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Fri, 14 Jul 2023 17:30:02 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E7=AE=A1=E7=90=86=E4=BC=98=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Ass_AssetsInfo/Index.js | 4 +-- .../Views/Ass_AssetsInfoItem/Form.cshtml | 1 + .../Views/Ass_AssetsInfoItem/Form.js | 4 +++ .../Views/Ass_AssetsInfoItem/Index.js | 4 +-- .../Views/Ass_Repair/Index.js | 12 ++++++- .../Ass_AssetsInfoItemService.cs | 32 +++++++++++-------- 6 files changed, 38 insertions(+), 19 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfo/Index.js index baf118ae5..73da44ac3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfo/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfo/Index.js @@ -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 () { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Form.cshtml index 83a11a01a..00232d22b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Form.cshtml @@ -7,6 +7,7 @@
明细编号*
+
序号*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Form.js index f68a30b54..641f206aa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Form.js @@ -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"; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.js index f43014606..0b432ef33 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.js @@ -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) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Repair/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Repair/Index.js index 9bd72f753..283dce94d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Repair/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Repair/Index.js @@ -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" }, { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs index 5b7878189..e3f17b1a9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs @@ -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(); } From e37373662fe83dcadfadeabbbe51f990e91874e4 Mon Sep 17 00:00:00 2001 From: liangkun Date: Fri, 14 Jul 2023 20:51:56 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=8D=95=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Sys_UpdateRecord/Form.cshtml | 12 ++++- .../LR_Desktop/Views/Sys_UpdateRecord/Form.js | 4 ++ .../Views/Sys_UpdateRecord/Index.cshtml | 2 +- .../Views/Sys_UpdateRecord/Index.js | 7 ++- .../Views/Home/AdminDesktop/Index.js | 5 +- .../XmlConfig/system.config | 2 + .../Modules/UserApi.cs | 50 ++++++++++++++++--- .../XmlConfig/system.config | 2 + .../Sys_UpdateRecord/Sys_UpdateRecordBLL.cs | 19 +++++++ .../Sys_UpdateRecordEntity.cs | 6 +++ .../Sys_UpdateRecord/Sys_UpdateRecordIBLL.cs | 2 + .../Sys_UpdateRecordService.cs | 35 +++++++++---- .../Learun.Util.Operat/OperatorHelper.cs | 24 +++++++++ .../Learun.Util/Learun.Util/Web/UserInfo.cs | 2 +- .../LearunApp-2.2.0/pages/home.vue | 45 +++++++++++++++-- .../LearunApp-2.2.0/pages/login.vue | 6 ++- 16 files changed, 191 insertions(+), 32 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Form.cshtml index 783e13c0b..76c48cf9f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Form.cshtml @@ -3,11 +3,11 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
+
更新时间*
-
+
更新版本*
@@ -15,5 +15,13 @@
更新内容*
+
+
是否APP*
+
+
+
+
apk文件
+
+
@Html.AppendJsFile("/Areas/LR_Desktop/Views/Sys_UpdateRecord/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Form.js index 82a929e73..c4475633e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/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) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Index.cshtml index 8ade3d89e..0a4e40232 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Index.cshtml @@ -12,7 +12,7 @@
-
+
 录入  修改  删除 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Index.js index 288218960..2048ef87f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/Sys_UpdateRecord/Index.js @@ -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 ? "" : ""; + } + } ], mainId: 'Id', isPage: true, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop/Index.js index 63f10fd29..1b9893467 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop/Index.js @@ -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); //消息提醒 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config index 736bf2cbc..477de55b7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config @@ -155,6 +155,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs index a182c5527..d73589587 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs @@ -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,26 @@ 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(); + + + /// + /// 检查更新 + /// + /// + /// + private Response CheckUpdate(dynamic _) + { + var update=sysUpdateRecordIbll.GetNewest(); + if (update!=null&&!string.IsNullOrEmpty(update.AppUrl)) + { + var downurl = annexesFileIbll.GetEntityByFolderId(update.AppUrl); + //downurl.F_FilePath + return Success(new { version = update.VersionNum, content = update.Content, url = "" }); + } + return Success(new {version="1.0.0",content="",url=""}); + } /// /// 登录二次短信验证 @@ -59,8 +82,8 @@ namespace Learun.Application.WebApi private Response LoginCodeVerify(dynamic _) { MobileVerify mobileVerify = this.GetReqData(); - var code=redisCache.Read("studentuserlogin_" + mobileVerify.mobile); - if (!string.IsNullOrEmpty(code)&& code==mobileVerify.verifycode) + var code = redisCache.Read("studentuserlogin_" + mobileVerify.mobile); + if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode) { return Success("验证成功。"); } @@ -114,10 +137,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 +164,7 @@ namespace Learun.Application.WebApi var result = yixintongSms.SendSmsToSingle(userEntity.F_Mobile, SmsType.LoginBind, listStr); if (result.Result.code == "0") { - redisCache.Write("studentuserlogin_"+ userEntity.F_Mobile, raRndNum,new TimeSpan(0,5,0)); + redisCache.Write("studentuserlogin_" + userEntity.F_Mobile, raRndNum, new TimeSpan(0, 5, 0)); //日志 logEntity = new LogEntity(); logEntity.F_CategoryId = 3; @@ -170,7 +197,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 +213,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 +255,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 +301,14 @@ namespace Learun.Application.WebApi } #endregion } - + private Response onedrivelogin(dynamic _) + { + //多客户端登录判断 + string logintime = redisCache.Read("logintime" + userInfo.account, CacheId.loginInfo); + return Success(new { + logintime + }); + } /// /// 获取用户信息 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config index 6c03bf734..d1725b767 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config @@ -102,6 +102,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordBLL.cs index 76bb8cab6..c05d5cef8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordBLL.cs @@ -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 } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordEntity.cs index ff724d194..f234306d7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordEntity.cs @@ -49,6 +49,12 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// [Column("CREATETIME")] public DateTime? CreateTime { get; set; } + + [Column("ISAPP")] + public bool? IsApp { get; set; } + + [Column("APPURL")] + public string AppUrl { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordIBLL.cs index c383c9e00..30e111aaa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordIBLL.cs @@ -63,5 +63,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop Sys_UpdateRecordEntity GetOnlineUserNum(); List GetOnlineUserInfo(); #endregion + + Sys_UpdateRecordEntity GetNewest(); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordService.cs index 437cfd593..b74368d88 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/Sys_UpdateRecord/Sys_UpdateRecordService.cs @@ -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("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); + } + } + } } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/OperatorHelper.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/OperatorHelper.cs index 0ed02d72b..97535b59c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/OperatorHelper.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/OperatorHelper.cs @@ -154,6 +154,8 @@ namespace Learun.Util.Operat operatorInfo.iPAddress = Net.Ip; operatorInfo.browser = Net.Browser; operatorInfo.token = token; + //登录时间记录 + redisCache.Write("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 tokenMarkList = redisCache.Read>(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>(cacheKeyToken + operatorInfo.account, tokenMarkList, CacheId.loginInfo); } } @@ -280,9 +287,25 @@ namespace Learun.Util.Operat tokenMarkList.Remove(loginMark); redisCache.Write>(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"&&account!="") + { + //多客户端登录判断 + string logintime = redisCache.Read("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; @@ -352,6 +375,7 @@ namespace Learun.Util.Operat } else { + userInfo.logTime = operatorInfo.logTime; if (HttpContext.Current != null) { HttpContext.Current.Items.Add("LoginUserInfo", userInfo); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Web/UserInfo.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Web/UserInfo.cs index 68fea6dd0..f1dba44f4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Web/UserInfo.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Web/UserInfo.cs @@ -120,7 +120,7 @@ namespace Learun.Util /// /// 登录时间 /// - public DateTime logTime { get; set; } + public DateTime? logTime { get; set; } /// /// 登录IP地址 /// diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue index 28d786e32..57ee696ee 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue @@ -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) { @@ -156,7 +158,8 @@ if (param && param.learun && param.pagePath) { this.SET_GLOBAL("jumpParam", param); } - + //单客户端登录判断 + this.checkonedrivelogin(); // 登录状态无效,则跳转到登录页 const stateValid = await this.checkLoginState(); if (!stateValid) { @@ -208,8 +211,43 @@ } return; } + + //间隔10秒请求 + this.timer= setInterval(()=>{ + this.checkonedrivelogin() + },10000) + }, + //验证多客户端登录 + 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 +288,6 @@ user.miniProgram = true; } this.SET_GLOBAL("loginUser", user); - return true; }, diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue index d22e02f86..705be583f 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue @@ -104,6 +104,8 @@ export default { }, async onLoad() { + this.EMIT('home-openorclosetimer') + this.OFF('home-openorclosetimer') await this.init() }, @@ -219,7 +221,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 +260,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() From 6287beab3e1ef7a89b499183fa098ecc77ad8ca3 Mon Sep 17 00:00:00 2001 From: liangkun Date: Mon, 17 Jul 2023 15:53:49 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=8D=95=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E7=99=BB=E5=BD=95pc=E4=B8=8E=E6=89=8B=E6=9C=BA=E7=AB=AF?= =?UTF-8?q?=E9=9A=94=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../XmlConfig/system.config | 2 +- .../XmlConfig/system.config | 2 +- .../Learun.Util.Operat/OperatorHelper.cs | 27 ++++++++++--------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config index 477de55b7..a87a5c9f0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config @@ -156,7 +156,7 @@ - + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config index d1725b767..c8874f960 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config @@ -103,7 +103,7 @@ - + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/OperatorHelper.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/OperatorHelper.cs index 97535b59c..8b28c5fc4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/OperatorHelper.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/OperatorHelper.cs @@ -234,7 +234,7 @@ namespace Learun.Util.Operat tokenMarkList.Remove(loginMark); redisCache.Remove(cacheKeyOperator + loginMark, CacheId.loginInfo); //登录时间清除 - redisCache.Remove("logintime"+ operatorInfo.account, CacheId.loginInfo); + redisCache.Remove("logintime" + operatorInfo.account, CacheId.loginInfo); WebHelper.RemoveCookie("logintime" + operatorInfo.account); redisCache.Write>(cacheKeyToken + operatorInfo.account, tokenMarkList, CacheId.loginInfo); } @@ -293,25 +293,26 @@ namespace Learun.Util.Operat } else { - string verifyonelogin=Util.Config.GetValue("verifyonelogin"); - if (!string.IsNullOrEmpty(verifyonelogin)&& verifyonelogin=="true"&&account!="") + string verifyonelogin = Util.Config.GetValue("verifyonelogin"); + if (!string.IsNullOrEmpty(verifyonelogin) && verifyonelogin == "true" && operatorInfo.account != "") { - //多客户端登录判断 - string logintime = redisCache.Read("logintime" + operatorInfo.account, CacheId.loginInfo); - string cookielogintime = WebHelper.GetCookie("logintime" + operatorInfo.account); - if (string.IsNullOrEmpty(logintime)||string.IsNullOrEmpty(cookielogintime)|| logintime!= cookielogintime) + if (operatorInfo.appId.Contains("PC")) { - operatorResult.stateCode = 0; - return operatorResult; + //多客户端登录判断 + string logintime = redisCache.Read("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(cacheKeyInfo + operatorInfo.account, CacheId.loginInfo); if (userInfo == null || userInfo.loadTime == null || userInfo.loadTime <= DateTime.Now.AddMinutes(-5)) { @@ -352,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); @@ -489,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; From a304545fb283848f58586cb7c4dc89ad59cb9523 Mon Sep 17 00:00:00 2001 From: liangkun Date: Tue, 18 Jul 2023 16:28:27 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AFapp=E6=9B=B4=E6=96=B0=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Learun.Application.WebApi/Modules/UserApi.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs index d73589587..db8a73abf 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs @@ -68,7 +68,10 @@ namespace Learun.Application.WebApi if (update!=null&&!string.IsNullOrEmpty(update.AppUrl)) { var downurl = annexesFileIbll.GetEntityByFolderId(update.AppUrl); - //downurl.F_FilePath + 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=""}); From a5f8b1d0c19557512fc2148631d96f218be00659 Mon Sep 17 00:00:00 2001 From: liangkun Date: Wed, 19 Jul 2023 16:11:46 +0800 Subject: [PATCH 5/5] =?UTF-8?q?app=E5=BC=BA=E5=88=B6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/BaseApi.cs | 2 +- .../LearunApp-2.2.0/config.js | 6 ++-- .../LearunApp-2.2.0/pages/home.vue | 33 ++++++++++++++++- .../LearunApp-2.2.0/pages/login.vue | 35 +++++++++++++++++++ 4 files changed, 71 insertions(+), 5 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/BaseApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/BaseApi.cs index 1ae5c386e..dc4dc9257 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/BaseApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/BaseApi.cs @@ -180,7 +180,7 @@ namespace Learun.Application.WebApi ReqParameter req = this.Bind(); 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; } diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js index 9021aa1f3..601db6dd5 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js @@ -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", diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue index 57ee696ee..8e9d79730 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue @@ -153,7 +153,6 @@ // 页面初始化 async init(param) { this.HIDE_LOADING(); - // 有参数表示可能是打开分享消息;将数据存入全局变量以备后续跳转 if (param && param.learun && param.pagePath) { this.SET_GLOBAL("jumpParam", param); @@ -166,6 +165,10 @@ this.RELAUNCH_TO("/pages/login"); return; } + // #ifdef APP + //检查更新 + this.checkupdate(); + // #endif // 图表相关参数初始化 this.initCharts(); @@ -217,6 +220,34 @@ 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() { diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue index 705be583f..8ea6bfbb2 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue @@ -124,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() { @@ -149,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