From cc899e51221e31bca55e1b5174e681aea6445139 Mon Sep 17 00:00:00 2001 From: liangkun Date: Thu, 24 Sep 2020 17:07:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E7=AB=AF=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=BC=BA=E5=AF=86=E7=A0=81=E9=AA=8C=E8=AF=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../www/config/config.js | 16 +- .../www/pages/login/login.js | 15 +- .../my/modifypassword/modifypassword.html | 15 +- .../pages/my/modifypassword/modifypassword.js | 32 + ...pace.html.26696.2.2019-09-23.15-42-49.7910 | 414 --------- ...ace.html.49721.13.2020-01-09.14-19-29.6038 | 465 ---------- ...ace.html.49721.13.2020-01-15.16-31-23.1336 | 465 ---------- .../www/pages/workspace/workspace.html | 4 + .../www/pages/workspace/workspace.js | 1 + ...erform.js.26692.2.2020-08-04.14-24-39.5824 | 838 ------------------ .../www/scripts/weixinlogin.js | 16 +- .../Modules/UserApi.cs | 21 +- .../Modules/WeixinApi.cs | 20 +- .../XmlConfig/system.config | 2 + 14 files changed, 114 insertions(+), 2210 deletions(-) delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.26696.2.2019-09-23.15-42-49.7910 delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-09.14-19-29.6038 delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-15.16-31-23.1336 delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/_sgbak/learun-custmerform.js.26692.2.2020-08-04.14-24-39.5824 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/config/config.js b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/config/config.js index bbf9d244a..1a239a386 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/config/config.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/config/config.js @@ -1,15 +1,15 @@ -var config = { - webapi: 'http://localhost:8088/', - web: "http://localhost:8087/"//web地址,用于配置logo -}; +//var config = { +// webapi: 'http://localhost:8088/', +// web: "http://localhost:8087/"//web地址,用于配置logo +//}; //var config = { // webapi: 'http://112.230.201.53:31173/', // web:"http://112.230.201.53/:8081/"//web地址,用于配置logo //}; -//var config = { -// webapi: 'http://localhost:31173/', -// web: "http://localhost:20472/"//web地址,用于配置logo -//}; +var config = { + webapi: 'http://localhost:31173/', + web: "http://localhost:20472/"//web地址,用于配置logo +}; //var config = { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/login.js b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/login.js index 4f6377ffc..1e2b59d9d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/login.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/login.js @@ -5,7 +5,6 @@ var path = config.webapi; learun.http.get(path + "Learun/EducationalAdministration/EmpRegister/registerbutton", {}, (res) => { - console.log(res); if (res.info == "True") { var button = $page.find('#RegisterBtn'); button.show(); @@ -22,15 +21,20 @@ $page.find('#loginBtn').on('tap', function () { var account = $('#account').val(); var password = $('#password').val(); - + var up = true; if (account === "") { learun.layer.warning('用户名不能为空!', function () { }, '提示', '关闭'); } else if (password === "") { learun.layer.warning('密码不能为空!', function () { }, '提示', '关闭'); } else { + var reg = /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\.])[0-9a-zA-Z!@#$%^&*,\.]{8,20}$/; + if (!reg.test(password)) { + up = false; + } var data = { username: account, - password: $.md5(password) + password: $.md5(password), + up: up }; var postdata = { token: '', @@ -56,6 +60,11 @@ learun.storage.set('userinfo', res.data); $('#account').val(''); $('#password').val(''); + if (res.data.pwd === true) { + learun.storage.set('pwd', true); + } else { + learun.storage.set('pwd', false); + } learun.tab.go('workspace'); if (learun.storage.get("Ip") != null && learun.storage.get("ACIp") != "") { //Ip上网 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.html b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.html index 99203ffda..8d46e259d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.html +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.html @@ -13,8 +13,19 @@ -
-
+
+ +
+ 新密码必须8-20位同时包含1.[大小写字母]、2[数字]、3[特殊符号!@@#$%^&*] +
+
保存
+
+ \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.js b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.js index 0552f9444..9cd0eff9e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.js @@ -1,12 +1,24 @@ (function () { + var userinfo = null; var page = { isScroll: true, init: function ($page) { + userinfo = learun.storage.get('userinfo'); + //主被动修改密码判断 + if (learun.storage.get('pwd')===true) { + $page.find('#strongpwd').css("display", "block"); + $page.find('#strongpwdout').css("display", "block"); + } $page.find('#savepassword').on('tap', function () { if (!$('#modifypasswordform').lrformValid()) { return false; } var formdata = $('#modifypasswordform').lrformGet(); + var reg = /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\.])[0-9a-zA-Z!@#$%^&*,\.]{8,20}$/; + if (!reg.test(formdata.newpassword)) { + learun.layer.toast('密码不满足强度要求'); + return false; + } if (formdata.newpassword1 === formdata.newpassword) { var req = { @@ -20,6 +32,7 @@ if (data) {// 表单数据保存成功,发起流程 learun.layer.toast(info); learun.storage.set('logininfo', null); + learun.storage.set('pwd', false); learun.nav.go({ path: 'login', isBack: false, isHead: false }); } return false; @@ -29,6 +42,25 @@ learun.layer.toast('二次输入密码不同'); } }); + $page.find('#outloginbtn').on('tap', function () { + learun.layer.confirm('确定要退出账号?', function (_index) { + if (_index === '1') { + learun.isOutLogin = true; + if (learun.storage.get("Ip") != null && learun.storage.get("ACIp") != "") { + //Ip上网 + sendToAc(learun.storage.get("ACIp"), 'logout', learun.storage.get("Ip"), userinfo.baseinfo.account, ''); + } + if (learun.storage.get("Ip") != null && learun.storage.get("ACIp2") != "") { + //Ip上网 + sendToAc(learun.storage.get("ACIp2"), 'logout', learun.storage.get("Ip"), userinfo.baseinfo.account, ''); + } + learun.storage.set('logininfo', null); + learun.nav.go({ path: 'login', isBack: false, isHead: false }); + + } + + }, '', ['取消', '退出']); + }); } }; return page; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.26696.2.2019-09-23.15-42-49.7910 b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.26696.2.2019-09-23.15-42-49.7910 deleted file mode 100644 index 1b96ccbcc..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.26696.2.2019-09-23.15-42-49.7910 +++ /dev/null @@ -1,414 +0,0 @@ - -
-
- - -
-
-
-
- 更多 -
-
-
-
-
-
-
\ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-09.14-19-29.6038 b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-09.14-19-29.6038 deleted file mode 100644 index 295aab975..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-09.14-19-29.6038 +++ /dev/null @@ -1,465 +0,0 @@ - -
-
- - -
-
-
-
- 更多 -
-
-
-
-
-
-
\ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-15.16-31-23.1336 b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-15.16-31-23.1336 deleted file mode 100644 index 295aab975..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-15.16-31-23.1336 +++ /dev/null @@ -1,465 +0,0 @@ - -
-
- - -
-
-
-
- 更多 -
-
-
-
-
-
-
\ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.html b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.html index eaa8a1390..f7d954142 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.html +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.html @@ -217,6 +217,10 @@ var page = { init: function ($page) { + //主被动修改密码判断 + if (learun.storage.get('pwd') === true) { + learun.nav.go({ path: 'my/modifypassword', isBack: false, isHead: true, title:'修改密码' }); + } var _html = ''; // _html += '
'; // _html += ''; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.js b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.js index 530662f21..5431f8df3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.js @@ -6,6 +6,7 @@ var page = { init: function ($page) { + var _html = ''; _html += '
'; _html += ''; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/_sgbak/learun-custmerform.js.26692.2.2020-08-04.14-24-39.5824 b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/_sgbak/learun-custmerform.js.26692.2.2020-08-04.14-24-39.5824 deleted file mode 100644 index e92414898..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/_sgbak/learun-custmerform.js.26692.2.2020-08-04.14-24-39.5824 +++ /dev/null @@ -1,838 +0,0 @@ -/* - * 版 本 Learun-ADMS V7.0.0 数字化智慧校园(http://www.learun.cn) - * Copyright (c) 2013-2017 北京泉江科技有限公司 - * 创建人:数字化智慧校园-前端开发组 - * 日 期:2018.7.12 - * 描 述:数字化智慧校园移动端框架(ADMS) 自定义表单 - */ - -(function ($, learun, window) { - // 加载自定义表单模板 - learun.custmerform = { - loadScheme: function (schemeIds, callback) {// formIds表单主键集合,callback回调函数 - if (learun.type(schemeIds) === 'string') { - schemeIds = [schemeIds]; - } - - var req = []; - var scheme = {}; - $.each(schemeIds, function (_index, _item) { - var formId = 'lrform' + _item; - var formScheme = learun.storage.get(formId);// 从缓存中获取表单模板数据 - if (!formScheme) { - req.push({ id: _item, ver: "" }); - } - else { - scheme[_item] = JSON.parse(formScheme.content); - req.push({ id: _item, ver: formScheme.ver }); - } - }); - // 加载自定义表单模板 - learun.httpget(config.webapi + "learun/adms/form/scheme", req, (data) => { - if (data) { - $.each(data, function (_index, _item) { - scheme[_index] = JSON.parse(_item.F_Scheme); - var formScheme = { ver: _item.F_Id, content: _item.F_Scheme }; - learun.storage.set('lrform' + _index,formScheme); - }); - } - callback(scheme); - }); - } - }; - // 自定义表单初始化 - $.fn.custmerform = function (formScheme) { - var $this = $(this); - $this.scroll(); - var $container = $this.find('.f-scroll'); - - $.each(formScheme, function (_id, _scheme) { - custmerformRender($container, _scheme.data, _id); - }); - $this = null; - $container = null; - }; - // 获取自定义表单数据 - $.fn.custmerformGet = function () { - var res = {}; - var validateflag = true; - $(this).find('.lrcomponts').each(function () { - var $this = $(this); - var schemeInfoId = $this.attr('data-id'); - var _componts = $this[0].componts; - res[schemeInfoId] = res[schemeInfoId] || {}; - // 遍历自定义表单控件 - $.each(_componts, function (_index, _item) { - var _fn = componts[_item.type].get; - if (_fn) { - var compontData = _fn(_item, $this); - if (compontData.isHad) { - if (_item.verify) { - var checkfn = window.fui.validator['is' + _item.verify]; - var r = checkfn(compontData.value); - if (!r.code) { - validateflag = false; - window.fui.dialog({ msg: r.msg }); - return false; - } - } - res[schemeInfoId][_item.id] = compontData.value; - } - } - }); - $this = null; - if (!validateflag) { - return false; - } - }); - if (!validateflag) { - return null; - } - return res; - }; - // 设置自定义表单数据 - $.fn.custmerformSet = function (data) { - var $this = $(this); - function set($this, data) { - if ($this.find('.lrcomponts').length > 0) { - $this.find('.lrcomponts').each(function () { - var $this = $(this); - var schemeInfoId = $this.attr('data-id'); - var _componts = $this[0].componts; - var _data = {}; - $.each(data[schemeInfoId] || [], function (_index, _item) { - $.each(_item[0] || [], function (_id, _jitem) { - _data[_index.toLowerCase() + _id] = _jitem; - }); - }); - // 遍历自定义表单控件 - $.each(_componts, function (_index, _item) { - var _fn = componts[_item.type].set; - if (_fn) { - if (_item.table && _item.field) { - _fn(_item, _data[(_item.table + _item.field).toLowerCase()], $this); - } - else if (_item.table){// 表格 - _fn(_item, data[schemeInfoId][_item.table], $this); - } - } - }); - $this = null; - }); - } - else { - setTimeout(function () { - set($this, data); - }, 100); - } - } - set($this, data); - }; - - function getFontHtml(verify) { - var res = ""; - switch (verify) { - case "NotNull": - case "Num": - case "Email": - case "EnglishStr": - case "Phone": - case "Fax": - case "Mobile": - case "MobileOrPhone": - case "Uri": - res = '*'; - break; - } - return res; - } - function loadCheck(data, text, value, compontId) { - var $row = $('#' + compontId); - if ($row.length === 0) { - setTimeout(function () { - loadCheck(data, text, value, compontId); - }, 100); - } - else { - var $Last = $row; - $.each(data, function (_index, _item) { - $div = $('
'); - $Last.after($div); - $div.find('.checkbox').lrswitch(); - $Last = $div; - $div = null; - }); - if ($Last) { - $Last.after('
'); - $Last = null; - } - } - $row = null; - } - function organizeRegister1(_compont) { - if ($('#' + _compont.relation).length > 0) { - $('#' + _compont.relation).on('change', { myId: _compont.id }, function (e) { - e = e || window.event; - var myId = e.data.myId; - var value = $(this).lrselectGet(); - $('#' + myId).lrselectUpdate({ - companyId: value, - needPre: value === '' ? true : false - }); - }); - } - else { - setTimeout(function () { organizeRegister1(_compont); }, 100); - } - } - function organizeRegister2(_compont) { - if ($('#' + _compont.relation).length > 0) { - $('#' + _compont.relation).on('change', { myId: _compont.id }, function (e) { - e = e || window.event; - var myId = e.data.myId; - var value = $(this).lrselectGet(); - $('#' + myId).lrselectUpdate({ - departmentId: value, - needPre: value === '' ? true : false - }); - }); - } - else { - setTimeout(function () { organizeRegister2(_compont); }, 100); - } - } - - function loadGridComponts(compont) { - } - function loadGridButton(compont) {// 编辑表格增加按钮 - var $row = $('#' + compont.id); - if ($row.length === 0) { - setTimeout(function () { - loadGridButton(compont); - }, 100); - } - else { - var $btn = $('
增加' + (compont.title || '') + '
'); - $btn[0].compont = compont; - - $btn.on('tap', { compont: compont }, function (e) { - e = e || window.event; - }); - - $row.after($btn); - } - $row = null; - } - - // 渲染自定义表单 - function custmerformRender($container, scheme, schemeInfoId) { - var loaddataComponts = []; - $.each(scheme, function (_index, _item) { - var $list = $('
'); - $list[0].componts = _item.componts; - $.each(_item.componts, function (_jindex, _jitem) { - var $row = $('
'); - if (componts[_jitem.type].render($row, _jitem)) { - $list.append($row); - $row.prepend(getFontHtml(_jitem.verify)); - } - }); - $container.append($list); - }); - - $container = null; - } - - var componts = { - label: { - render: function ($row, compont) { - $row.addClass('lr-form-row-title'); - return true; - } - }, - html: { - render: function ($row, compont) { - return false; - } - }, - text: { - render: function ($row, compont) { - var $compont = $(''); - $row.append($compont); - $compont.val(compont.dfvalue || ''); - - $compont = null; - $row = null; - if (compont.isHide === '1') { - return false; - } - - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.val(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - $container.find('#' + compont.id).val(value || ''); - } - }, - textarea: { - render: function ($row, compont) { - $row.addClass('lr-form-row-multi'); - var $compont = $(''); - $compont.text(compont.dfvalue || ''); - $row.append($compont); - $compont = null; - $row = null; - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.val(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - $container.find('#' + compont.id).val(value || ''); - } - }, - texteditor: { - render: function ($row, compont) { - $row.addClass('lr-form-row-multi'); - var $compont = $(''); - $compont.text(compont.dfvalue || ''); - $row.append($compont); - $compont = null; - $row = null; - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.val(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - $container.find('#' + compont.id).val(value || ''); - } - }, - radio: { - render: function ($row, compont) {// 单选改用和下拉一致 - var $compont = $('
'); - $row.append($compont); - if (compont.dataSource === '0') { - $compont.lrpickerex({ - code: compont.itemCode, - type: 'dataItem' - }); - } else { - var vlist = compont.dataSourceId.split(','); - $compont.lrpickerex({ - code: vlist[0], - type: 'sourceData', - ivalue: vlist[2], - itext: vlist[1] - }); - } - - $compont = null; - $row = null; - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.lrpickerGet(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - $container.find('#' + compont.id).lrpickerSet(value); - } - }, - checkbox: { - render: function ($row, compont) { - var $compont = $('
'); - $row.append($compont); - if (compont.dataSource === '0') { - $compont.lrcheckboxex({ - code: compont.itemCode, - type: 'dataItem' - }); - } else { - var vlist = compont.dataSourceId.split(','); - $compont.lrcheckboxex({ - code: vlist[0], - type: 'sourceData', - ivalue: vlist[2], - itext: vlist[1] - }); - } - - $compont = null; - $row = null; - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.lrcheckboxGet(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - $container.find('#' + compont.id).lrcheckboxSet(value); - } - }, - select: { - render: function ($row, compont) {// - var $compont = $('
'); - $row.append($compont); - if (compont.dataSource === '0') { - $compont.lrpickerex({ - code: compont.itemCode, - type: 'dataItem' - }); - } else { - var vlist = compont.dataSourceId.split(','); - $compont.lrpickerex({ - code: vlist[0], - type: 'sourceData', - ivalue: vlist[2], - itext: vlist[1] - }); - } - - $compont = null; - $row = null; - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.lrpickerGet(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - $container.find('#' + compont.id).lrpickerSet(value); - } - }, - datetime: { - render: function ($row, compont) {// - var $compont = $('
'); - $row.append($compont); - if (compont.dateformat === '0') { - $compont.lrdate({ - type: 'date' - }); - } - else { - $compont.lrdate(); - } - $compont = null; - $row = null; - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.lrdateGet(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - if (compont.dateformat === '0') { - value = learun.date.format(value, 'yyyy-MM-dd'); - } - else { - value = learun.date.format(value, 'yyyy-MM-dd hh:mm'); - } - - $container.find('#' + compont.id).lrdateSet(value); - } - }, - datetimerange: { - render: function ($row, compont) {// - var $compont = $(''); - function register(_compont) { - if ($('#' + _compont.startTime).length > 0 && $('#' + _compont.endTime).length > 0) { - $('#' + _compont.startTime).on('change', { myId: _compont.id, end: _compont.endTime }, function (e) { - e = e || window.event; - var end = e.data.end; - var myId = e.data.myId; - var st = $(this).lrdateGet(); - var et = $('#' + end).lrdateGet(); - if (!!st && !!et) { - var diff = learun.date.parse(st).DateDiff('d', et) + 1; - $('#' + myId).val(diff); - } - }); - $('#' + _compont.endTime).on('change', { myId: _compont.id, begin: _compont.startTime }, function (e) { - e = e || window.event; - var begin = e.data.begin; - var myId = e.data.myId; - - var st = $('#' + begin).lrdateGet(); - var et = $(this).lrdateGet(); - if (!!st && !!et) { - var diff = learun.date.parse(st).DateDiff('d', et) + 1; - $('#' + myId).val(diff); - } - }); - } - else { - setTimeout(function () { - register(_compont); - }, 100); - } - } - if (!!compont.startTime && compont.endTime) { - register(compont); - } - $row.append($compont); - $compont = null; - $row = null; - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.val(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - $container.find('#' + compont.id).val(value); - } - }, - encode: { - render: function ($row, compont) { - var $compont = $(''); - compont.isInit = false; - learun.getRuleCode(compont.rulecode, function (data) { - if (!compont.isInit) { - compont.isInit = true; - $('#' + compont.id).val(data); - } - }); - $row.append($compont); - $compont = null; - $row = null; - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.val(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - compont.isInit = true; - $container.find('#' + compont.id).val(value); - } - }, - organize: { - render: function ($row, compont) { - var $compont = $('
'); - $row.append($compont); - switch (compont.dataType) { - case "company"://公司 - $compont.lrselect(); - break; - case "department"://部门 - $compont.lrselect({ - type: 'department', - needPre: compont.relation === '' ? false : true - }); - - organizeRegister1(compont); - break; - case "user"://用户 - $compont.lrselect({ - type: 'user', - needPre: compont.relation === '' ? false : true - }); - organizeRegister2(compont); - break; - } - $compont = null; - $row = null; - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.lrselectGet(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - $container.find('#' + compont.id).lrselectSet(value); - } - }, - currentInfo: { - render: function ($row, compont) { - var $compont = $(''); - var userinfo = learun.storage.get('userinfo'); - switch (compont.dataType) { - case 'company': - compont.value = userinfo.baseinfo.companyId; - if (compont.isHide !== '1') { - learun.clientdata.get('company', { - key: compont.value, - compont: compont, - callback: function (item, _op) { - if (!_op.compont.isEdit) { - $(_op.compont.id).val(item.name); - } - } - }); - } - break; - case 'department': - compont.value = userinfo.baseinfo.departmentId; - if (compont.isHide !== '1') { - learun.clientdata.get('department', { - key: compont.value, - compont: compont, - callback: function (item, _op) { - if (!_op.compont.isEdit) { - $(_op.compont.id).val(item.name); - } - } - }); - } - break; - case 'user': - $compont.val(userinfo.baseinfo.realName); - compont.value = userinfo.baseinfo.userId; - break; - case 'time': - compont.value = learun.date.format(new Date(), 'yyyy-MM-dd hh:mm:ss'); - $compont.val(compont.value); - break; - case 'guid': - compont.value = learun.guid(); - $compont.val(compont.value); - break; - } - if (compont.isHide === '1') { - $compont = null; - $row = null; - return false; - } - else { - $row.append($compont); - $compont = null; - $row = null; - } - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = compont.value; - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - if (value) { - var organization = learun.storage.get('organization'); - compont.isEdit = true; - switch (compont.dataType) { - case 'company': - compont.value = value; - if (compont.isHide !== '1') { - learun.clientdata.get('company', { - key: compont.value, - compont: compont, - callback: function (item, _op) { - $container.find('#' + _op.compont.id).val(item.name || ''); - } - }); - } - break; - case 'department': - compont.value = value; - if (compont.isHide !== '1') { - learun.clientdata.get('department', { - key: compont.value, - compont: compont, - callback: function (item, _op) { - $container.find('#' + _op.compont.id).val(item.name || ''); - } - }); - } - break; - case 'user': - compont.value = value; - if (compont.isHide !== '1') { - learun.clientdata.get('user', { - key: compont.value, - compont: compont, - callback: function (item, _op) { - $container.find('#' + _op.compont.id).val(item.name || ''); - } - }); - } - break; - case 'time': - compont.value = value; - if (compont.isHide !== '1') { - $container.find('#' + compont.id).val(value); - } - break; - case 'guid': - compont.value = value; - if (compont.isHide !== '1') { - $container.find('#' + compont.id).val(value); - } - break; - } - } - } - }, - guid: { - render: function ($row, compont) { - compont.value = learun.guid(); - $row.remove(); - return false; - }, - get: function (compont) { - var res = {}; - res.isHad = true; - res.value = compont.value; - return res; - }, - set: function (compont, value) { - compont.value = value; - } - }, - upload: { - render: function ($row, compont) { - $row.addClass('lr-form-row-multi'); - var $compont = $('
'); - $row.append($compont); - $compont.lrImagepicker(); - $compont = null; - $row = null; - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.imagepickerGet(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - $container.find('#' + compont.id).imagepickerSet(value); - } - }, - girdtable: { - render: function ($row, compont) { - var gridCompont = []; - $.each(compont.fieldsData, function (_index, _item) { - if (_item.field) { - switch (_item.type) { - case 'radio': - case 'select': - case 'checkbox': - if (_item.dataSource === '0') { - _item.code = _item.itemCode; - _item.datatype = 'dataItem'; - } - else { - _item.code = _item.dataSourceId; - _item.ivalue = _item.saveField; - _item.itext = _item.showField; - _item.datatype = 'sourceData'; - } - break; - case 'layer': - if (_item.dataSource === '0') { - _item.code = _item.itemCode; - _item.datatype = 'dataItem'; - } - else { - _item.code = _item.dataSourceId; - _item.datatype = 'sourceData'; - } - break; - } - - - gridCompont.push(_item); - } - }); - $row.attr('id', compont.id); - $row.lrgrid({ - title: compont.title, - componts: gridCompont, - isToLowerCase: true - }); - $row = null; - return true; - }, - get: function (compont, $container) { - var res = {}; - var $compont = $container.find('#' + compont.id); - res.isHad = $compont.length > 0 ? true : false; - if (res.isHad) { - res.value = $compont.lrgridGet(); - } - $compont = null; - return res; - }, - set: function (compont, value, $container) { - $container.find('#' + compont.id).lrgridSet(value); - } - } - }; - -})(window.jQuery, window.lrmui, window); - diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/weixinlogin.js b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/weixinlogin.js index 3a453d948..25040bdd0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/weixinlogin.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/weixinlogin.js @@ -29,6 +29,7 @@ $(".login-content").show(); $("#accountopenid").val(res.data.openid); $("#loginBtn").on("click", function () { + var up = true; var account = $('#account').val(); var password = $('#password').val(); if (account === "") { @@ -36,10 +37,15 @@ } else if (password === "") { learun.layer.warning('密码不能为空!', function () { }, '提示', '关闭'); } else { + var reg = /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\.])[0-9a-zA-Z!@#$%^&*,\.]{8,20}$/; + if (!reg.test(password)) { + up = false; + } var data = { username: account, password: $.md5(password), - openid: $("#accountopenid").val() + openid: $("#accountopenid").val(), + up: up }; var postdata = { token: '', @@ -55,7 +61,6 @@ return; } if (res.code === 200) { - console.log(res); var logininfo = { account: account, token: res.data.baseinfo.token, @@ -65,6 +70,12 @@ learun.storage.set('userinfo', res.data); $('#account').val(''); $('#password').val(''); + if (res.data.pwd === true) { + learun.storage.set('pwd', true); + learun.layer.warning("绑定失败!您的密码不满足强度要求,请您先修改密码后再执行系统其他操作"); + } else { + learun.storage.set('pwd', false); + } location.href = "http://" + window.location.host; } else { learun.layer.warning(res.info, function () { }, '提示', '关闭'); @@ -74,7 +85,6 @@ }); } } else { - console.log(res.info); learun.layer.warning(res.info); location.href = "http://" + window.location.host; } 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 e4367664b..3ede02163 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs @@ -5,6 +5,7 @@ using Learun.Util; using Learun.Util.Operat; using Nancy; using System.Collections.Generic; +using System.Configuration; using System.Linq; namespace Learun.Application.WebApi @@ -33,7 +34,7 @@ namespace Learun.Application.WebApi Get["/img"] = GetImg; Get["/imgfordc"] = GetImgForDC; Get["/saveMap"] = GetSaveClassMap; - + } private UserIBLL userIBLL = new UserBLL(); private PostIBLL postIBLL = new PostBLL(); @@ -41,7 +42,7 @@ namespace Learun.Application.WebApi private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); CdMajorIBLL majorIbll = new CdMajorBLL(); - + /// /// 登录接口 @@ -100,13 +101,18 @@ namespace Learun.Application.WebApi res.userInfo.majorno = majorinfo.ID ?? ""; } } - - + //是否强密码验证 + bool pwd = false; + if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true" && loginModel.up == false) + { + pwd = true; + } var jsonData = new { baseinfo = res.userInfo, post = postIBLL.GetListByPostIds(res.userInfo.postIds), - role = roleIBLL.GetListByRoleIds(res.userInfo.roleIds) + role = roleIBLL.GetListByRoleIds(res.userInfo.roleIds), + pwd= pwd }; return Success(jsonData); } @@ -365,6 +371,11 @@ namespace Learun.Application.WebApi /// 密码 /// public string password { get; set; } + /// + /// 是否强密码 + /// + public bool up { get; set; } + /// /// 设备号 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs index 831876e87..ee3d82139 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs @@ -204,10 +204,6 @@ namespace Learun.Application.WebApi.Modules logEntity.F_ExecuteResult = 1; logEntity.F_ExecuteResultJson = "登录成功"; logEntity.WriteLog(); - - //保存用户设备号 - userIbll.UpdateWeixinOpenId(userEntity.F_UserId, loginModel.openid); - OperatorResult res = OperatorHelper.Instance.IsOnLine(token, req.loginMark); res.userInfo.password = null; res.userInfo.secretkey = null; @@ -222,13 +218,23 @@ namespace Learun.Application.WebApi.Modules } } - - + //是否强密码验证 + bool pwd = false; + if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true" && loginModel.up == false) + { + pwd = true; + } + else + { + //保存用户设备号 + userIbll.UpdateWeixinOpenId(userEntity.F_UserId, loginModel.openid); + } var jsonData = new { baseinfo = res.userInfo, post = postIBLL.GetListByPostIds(res.userInfo.postIds), - role = roleIBLL.GetListByRoleIds(res.userInfo.roleIds) + role = roleIBLL.GetListByRoleIds(res.userInfo.roleIds), + pwd = pwd }; return Success(jsonData); } 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 82bb88321..96db78846 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config @@ -96,6 +96,8 @@ + + \ No newline at end of file