From 96b686bb5ae225eaeca65392276ff24439beb28d Mon Sep 17 00:00:00 2001
From: zhichao lei <442149704@qq.com>
Date: Thu, 19 Nov 2020 15:11:09 +0800
Subject: [PATCH 1/2] =?UTF-8?q?adminTheme5=20=E9=80=80=E5=87=BA=E9=94=99?=
=?UTF-8?q?=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Learun.Application.Web/Views/Home/AdminTheme5.cshtml | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminTheme5.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminTheme5.cshtml
index 3328f0704..b532dd551 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminTheme5.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminTheme5.cshtml
@@ -52,8 +52,10 @@
@Html.AppendJsFile("/Views/Home/AdminTheme5/index.js")
+@Html.AppendJsFile("/Views/Login/ACLogon.js")
\ No newline at end of file
From 8bb49d02af162b4cb62d975580b7c403e9b02e4e Mon Sep 17 00:00:00 2001
From: dyy <18335927079@163.com>
Date: Thu, 19 Nov 2020 18:19:43 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91?=
=?UTF-8?q?=E2=80=9D=E4=B8=AA=E4=BA=BA=E5=8A=9E=E5=85=AC=E2=80=9C=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E2=80=9D=E5=A4=9A=E8=B4=A6=E5=8F=B7=E7=BB=91=E5=AE=9A?=
=?UTF-8?q?=E2=80=9C=EF=BC=9B=E9=A6=96=E9=A1=B5=E5=8F=B3=E4=B8=8A=E8=A7=92?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E2=80=9D=E5=88=87=E6=8D=A2=E8=B4=A6=E5=8F=B7?=
=?UTF-8?q?=E2=80=9C=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/LoginUserBindController.cs | 48 ++++++++++++++-
.../LoginUserBind/BindAccountIndex.cshtml | 34 +++++++++++
.../Views/LoginUserBind/BindAccountIndex.js | 59 +++++++++++++++++++
.../Views/LoginUserBind/Form.js | 8 ++-
.../Views/LoginUserBind/Index.js | 10 ++--
.../Learun.Application.Web.csproj | 2 +
.../Views/LR_Content/script/lr-admin.js | 14 ++++-
.../Views/Login/Default/Index.js | 11 +++-
.../Views/Login/PageFive/Index.js | 9 +++
.../Views/Login/PageFour/Index.js | 9 +++
.../Views/Login/PageOne/Index.js | 9 +++
.../Views/Login/PageSix/Index.js | 9 +++
.../Views/Login/PageThree/Index.js | 9 +++
.../Views/Login/PageTwo/Index.js | 9 +++
.../LoginUserBind/LoginUserBindBLL.cs | 25 ++++++++
.../LoginUserBind/LoginUserBindEntity.cs | 3 +
.../LoginUserBind/LoginUserBindIBLL.cs | 8 +++
.../LoginUserBind/LoginUserBindService.cs | 47 +++++++++++----
18 files changed, 303 insertions(+), 20 deletions(-)
create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/BindAccountIndex.cshtml
create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/BindAccountIndex.js
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LoginUserBindController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LoginUserBindController.cs
index 38e3ef630..e80503e1e 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LoginUserBindController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LoginUserBindController.cs
@@ -3,6 +3,8 @@ using System.Data;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System.Web.Mvc;
using System.Collections.Generic;
+using System;
+using Learun.Application.Organization;
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
@@ -16,6 +18,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
public class LoginUserBindController : MvcControllerBase
{
private LoginUserBindIBLL loginUserBindIBLL = new LoginUserBindBLL();
+ private UserIBLL userIBLL = new UserBLL();
#region 视图功能
@@ -28,6 +31,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}
+
///
/// 表单页
///
@@ -37,6 +41,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}
+
+ ///
+ /// 主页面【切换账号】
+ ///
+ ///
+ [HttpGet]
+ public ActionResult BindAccountIndex()
+ {
+ return View();
+ }
#endregion
#region 获取数据
@@ -114,7 +128,39 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
[AjaxOnly]
public ActionResult SaveForm(string keyValue, string strEntity)
{
- UserInfo userInfo = LoginUserInfo.Get(); LoginUserBindEntity entity = strEntity.ToObject();
+ UserInfo userInfo = LoginUserInfo.Get();
+ LoginUserBindEntity entity = strEntity.ToObject();
+ if (entity.BindUserAccount == userInfo.account)
+ {
+ return Fail("绑定账号不能为登录用户账号!");
+ }
+ //判断账号是否已绑定
+ if (string.IsNullOrEmpty(keyValue))
+ {
+ var aa = loginUserBindIBLL.GetEntityByBindUserAccount(entity.BindUserAccount, userInfo.userId);
+ if (aa != null)
+ {
+ return Fail("绑定账号已存在!");
+ }
+ }
+ else
+ {
+ var aa = loginUserBindIBLL.GetEntityByBindUserAccount(entity.BindUserAccount, userInfo.userId);
+ if (aa != null && aa.Id != keyValue)
+ {
+ return Fail("绑定账号已存在!");
+ }
+ }
+ //判断账号、密码是否可以登录
+ var model = userIBLL.CheckLogin(entity.BindUserAccount, entity.BindUserPasswordTemp);
+ if (!model.LoginOk)
+ {
+ return Fail(model.LoginMsg);
+ }
+ entity.BindUserId = model.F_UserId;
+ entity.CreateUserId = userInfo.userId;
+ entity.CreateUserName = userInfo.realName;
+ entity.CreateTime = DateTime.Now;
loginUserBindIBLL.SaveEntity(userInfo,keyValue,entity);
return Success("保存成功!");
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/BindAccountIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/BindAccountIndex.cshtml
new file mode 100644
index 000000000..04ad1e76e
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/BindAccountIndex.cshtml
@@ -0,0 +1,34 @@
+@{
+ ViewBag.Title = "切换账号";
+ Layout = "~/Views/Shared/_Index.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/LoginUserBind/BindAccountIndex.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/BindAccountIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/BindAccountIndex.js
new file mode 100644
index 000000000..6b60c86d6
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/BindAccountIndex.js
@@ -0,0 +1,59 @@
+/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
+ * Copyright (c) 2013-2018 北京泉江科技有限公司
+ * 创建人:超级管理员
+ * 日 期:2020-11-19 14:39
+ * 描 述:多账号绑定
+ */
+var refreshGirdData;
+var bootstrap = function ($, learun) {
+ "use strict";
+ var page = {
+ init: function () {
+ page.initGird();
+ page.bind();
+ },
+ bind: function () {
+ $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
+ page.search(queryJson);
+ }, 220, 400);
+ // 刷新
+ $('#lr_refresh').on('click', function () {
+ location.reload();
+ });
+ // 登录
+ $('#lr_login').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ var account = $('#gridtable').jfGridValue('BindUserAccount');
+ var pwd = $('#gridtable').jfGridValue('BindUserPassword');
+ //安全退出;自动登录;
+ learun.httpAsyncPost('/Login/OutLogin', {}, function (data) {
+ window.location.href = "/Login/Index?isBindAccountLogin=1&bindUserName=" + account + "&bindUserPassword=" + pwd;
+ });
+ }
+ });
+ },
+ // 初始化列表
+ initGird: function () {
+ $('#gridtable').jfGrid({
+ url: top.$.rootUrl + '/EducationalAdministration/LoginUserBind/GetPageList',
+ headData: [
+ { label: "绑定账号", name: "BindUserAccount", width: 150, align: "left" },
+ ],
+ mainId: 'Id',
+ isPage: true,
+ sidx: 'CreateTime desc'
+ });
+ page.search();
+ },
+ search: function (param) {
+ param = param || {};
+ param.CreateUserId = learun.clientdata.get(['userinfo']).userId;
+ $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
+ }
+ };
+ refreshGirdData = function () {
+ page.search();
+ };
+ page.init();
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/Form.js
index 66f1b2dea..0d093150b 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/Form.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/Form.js
@@ -21,7 +21,7 @@ var bootstrap = function ($, learun) {
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/LoginUserBind/GetFormData?keyValue=' + keyValue, function (data) {
for (var id in data) {
if (!!data[id].length && data[id].length > 0) {
- $('#' + id ).jfGridSet('refreshdata', data[id]);
+ $('#' + id).jfGridSet('refreshdata', data[id]);
}
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
@@ -36,8 +36,12 @@ var bootstrap = function ($, learun) {
if (!$('body').lrValidform()) {
return false;
}
+ var data = $('body').lrGetFormData();
+ data.BindUserAccount = $('#BindUserAccount').val().trim();
+ data.BindUserPassword = $('#BindUserPassword').val().trim();
+ data.BindUserPasswordTemp = $.md5(data.BindUserPassword);
var postData = {
- strEntity: JSON.stringify($('body').lrGetFormData())
+ strEntity: JSON.stringify(data)
};
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/LoginUserBind/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/Index.js
index 1c3fc4b50..614c91a82 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LoginUserBind/Index.js
@@ -68,16 +68,18 @@ var bootstrap = function ($, learun) {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/EducationalAdministration/LoginUserBind/GetPageList',
headData: [
- { label: "绑定账号", name: "BindUserAccount", width: 100, align: "left"},
- { label: "绑定密码", name: "BindUserPassword", width: 100, align: "left"},
+ { label: "绑定账号", name: "BindUserAccount", width: 150, align: "left"},
+ { label: "绑定时间", name: "CreateTime", width: 130, align: "left"},
],
mainId:'Id',
- isPage: true
- });
+ isPage: true,
+ sidx:'CreateTime desc'
+ });
page.search();
},
search: function (param) {
param = param || {};
+ param.CreateUserId = learun.clientdata.get(['userinfo']).userId;
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
}
};
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
index fe094aea5..e717918ca 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
@@ -927,6 +927,7 @@
+
@@ -6864,6 +6865,7 @@
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-admin.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-admin.js
index 647ddd355..2169b35a1 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-admin.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-admin.js
@@ -74,6 +74,7 @@ var loaddfimg;
_html += '解绑微信';
_html += '我的日程';
_html += '在线人员';
+ _html += '切换账号';
if (loginInfo.isSystem) {
_html += '清空缓存';
}
@@ -85,6 +86,7 @@ var loaddfimg;
$('#lr_userinfo_btn').on('click', page.openUserCenter);
$('#lr_clearredis_btn').on('click', page.clearredis);
$('#lr_onlineuser_btn').on('click', page.openOnlineUser);
+ $('#lr_loginuserbind_btn').on('click', page.openLoginUserBind);
$('#lr_cancelweixinbind_btn').on('click', page.cancelWeiXinBind);
},
loginout: function () { // 安全退出
@@ -146,7 +148,17 @@ var loaddfimg;
btn: null
});
},
-
+ openLoginUserBind: function () {
+ // 打开切换账号
+ learun.layerForm({
+ id: "LoginUserBindList",
+ title: '切换账号',
+ url: top.$.rootUrl + '/EducationalAdministration/LoginUserBind/BindAccountIndex',
+ width: 1000,
+ height: 600,
+ btn: null
+ });
+ },
// 全屏按钮
fullScreenInit: function () {
var _html = '';
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js
index 0f59da718..c4433e808 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js
@@ -9,8 +9,17 @@
"use strict";
var source = request('source');
var keyValue = request('keyValue');
+ var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录
+ var bindUserName = request('bindUserName');//绑定账号
+ var bindUserPassword = request('bindUserPassword');//绑定账号密码
var lrPage = {
init: function () {
+ //切换账号登录时:登录页赋值,触发登录事件;
+ if (isBindAccountLogin == 1) {
+ $("#lr_username").val(bindUserName);
+ $("#lr_password").val(bindUserPassword);
+ lrPage.login();
+ }
$('#psw_change').css({
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center'
@@ -158,7 +167,7 @@
}
else
window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index";
- //window.location.href = "/Home/Index";
+ //window.location.href = "/Home/Index";
}
}
else if (res.code == 400) {
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFive/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFive/Index.js
index 3f4ff8884..cd9925c5d 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFive/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFive/Index.js
@@ -9,8 +9,17 @@
"use strict";
var source = request('source');
var keyValue = request('keyValue');
+ var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录
+ var bindUserName = request('bindUserName');//绑定账号
+ var bindUserPassword = request('bindUserPassword');//绑定账号密码
var lrPage = {
init: function () {
+ //切换账号登录时:登录页赋值,触发登录事件;
+ if (isBindAccountLogin == 1) {
+ $("#lr_username").val(bindUserName);
+ $("#lr_password").val(bindUserPassword);
+ lrPage.login();
+ }
$('#psw_change').css({
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center'
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFour/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFour/Index.js
index 14ee5351a..d1ec0d1b1 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFour/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFour/Index.js
@@ -9,8 +9,17 @@
"use strict";
var source = request('source');
var keyValue = request('keyValue');
+ var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录
+ var bindUserName = request('bindUserName');//绑定账号
+ var bindUserPassword = request('bindUserPassword');//绑定账号密码
var lrPage = {
init: function () {
+ //切换账号登录时:登录页赋值,触发登录事件;
+ if (isBindAccountLogin == 1) {
+ $("#lr_username").val(bindUserName);
+ $("#lr_password").val(bindUserPassword);
+ lrPage.login();
+ }
$('#psw_change').css({
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center'
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOne/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOne/Index.js
index a1c91326a..49b1e7b20 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOne/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOne/Index.js
@@ -9,8 +9,17 @@
"use strict";
var source = request('source');
var keyValue = request('keyValue');
+ var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录
+ var bindUserName = request('bindUserName');//绑定账号
+ var bindUserPassword = request('bindUserPassword');//绑定账号密码
var lrPage = {
init: function () {
+ //切换账号登录时:登录页赋值,触发登录事件;
+ if (isBindAccountLogin == 1) {
+ $("#lr_username").val(bindUserName);
+ $("#lr_password").val(bindUserPassword);
+ lrPage.login();
+ }
$('#psw_change').css({
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center'
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSix/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSix/Index.js
index ff55e7af3..b69a348e8 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSix/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSix/Index.js
@@ -9,8 +9,17 @@
"use strict";
var source = request('source');
var keyValue = request('keyValue');
+ var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录
+ var bindUserName = request('bindUserName');//绑定账号
+ var bindUserPassword = request('bindUserPassword');//绑定账号密码
var lrPage = {
init: function () {
+ //切换账号登录时:登录页赋值,触发登录事件;
+ if (isBindAccountLogin == 1) {
+ $("#lr_username").val(bindUserName);
+ $("#lr_password").val(bindUserPassword);
+ lrPage.login();
+ }
$('#psw_change').css({
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center'
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThree/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThree/Index.js
index eb5cacfd0..ccf454ada 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThree/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThree/Index.js
@@ -9,8 +9,17 @@
"use strict";
var source = request('source');
var keyValue = request('keyValue');
+ var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录
+ var bindUserName = request('bindUserName');//绑定账号
+ var bindUserPassword = request('bindUserPassword');//绑定账号密码
var lrPage = {
init: function () {
+ //切换账号登录时:登录页赋值,触发登录事件;
+ if (isBindAccountLogin == 1) {
+ $("#lr_username").val(bindUserName);
+ $("#lr_password").val(bindUserPassword);
+ lrPage.login();
+ }
$('#psw_change').css({
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center'
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwo/Index.js
index 2b240115d..34173b27f 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwo/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwo/Index.js
@@ -9,8 +9,17 @@
"use strict";
var source = request('source');
var keyValue = request('keyValue');
+ var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录
+ var bindUserName = request('bindUserName');//绑定账号
+ var bindUserPassword = request('bindUserPassword');//绑定账号密码
var lrPage = {
init: function () {
+ //切换账号登录时:登录页赋值,触发登录事件;
+ if (isBindAccountLogin == 1) {
+ $("#lr_username").val(bindUserName);
+ $("#lr_password").val(bindUserPassword);
+ lrPage.login();
+ }
$('#psw_change').css({
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center'
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindBLL.cs
index 6464bd428..37faf6546 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindBLL.cs
@@ -91,6 +91,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
+ ///
+ /// 获取实体
+ ///
+ /// 绑定账号
+ /// 登录用户
+ ///
+ public LoginUserBindEntity GetEntityByBindUserAccount(string bindUserAccount, string userId)
+ {
+ try
+ {
+ return loginUserBindService.GetEntityByBindUserAccount(bindUserAccount, userId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
#endregion
#region 提交数据
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindEntity.cs
index 7ad84e956..8a44c3b9b 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindEntity.cs
@@ -69,6 +69,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
#endregion
#region 扩展字段
+ [NotMapped]
+ public string BindUserPasswordTemp { get; set; }
+
#endregion
}
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindIBLL.cs
index c01ae7197..620426857 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindIBLL.cs
@@ -34,6 +34,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
///
LoginUserBindEntity GetLoginUserBindEntity(string keyValue);
+
+ ///
+ /// 获取实体
+ ///
+ /// 绑定账号
+ /// 登录用户
+ ///
+ LoginUserBindEntity GetEntityByBindUserAccount(string bindUserAccount, string userId);
#endregion
#region 提交数据
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindService.cs
index b6dbb8793..eb3f74b42 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LoginUserBind/LoginUserBindService.cs
@@ -30,12 +30,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
try
{
var strSql = new StringBuilder();
- strSql.Append("SELECT ");
- strSql.Append(@"
- t.Id,
- t.BindUserAccount,
- t.BindUserPassword
- ");
+ strSql.Append("SELECT t.* ");
strSql.Append(" FROM LoginUserBind t ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
@@ -46,7 +41,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
dp.Add("BindUserAccount", "%" + queryParam["BindUserAccount"].ToString() + "%", DbType.String);
strSql.Append(" AND t.BindUserAccount Like @BindUserAccount ");
}
- return this.BaseRepository().FindList(strSql.ToString(),dp, pagination);
+ if (!queryParam["CreateUserId"].IsEmpty())
+ {
+ dp.Add("CreateUserId", queryParam["CreateUserId"].ToString(), DbType.String);
+ strSql.Append(" AND t.CreateUserId = @CreateUserId ");
+ }
+ return this.BaseRepository().FindList(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
@@ -87,7 +87,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
dp.Add("BindUserAccount", "%" + queryParam["BindUserAccount"].ToString() + "%", DbType.String);
strSql.Append(" AND t.BindUserAccount Like @BindUserAccount ");
}
- return this.BaseRepository().FindList(strSql.ToString(),dp);
+ return this.BaseRepository().FindList(strSql.ToString(), dp);
}
catch (Exception ex)
{
@@ -126,6 +126,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
+ ///
+ /// 获取实体
+ ///
+ /// 绑定账号
+ /// 登录用户
+ ///
+ public LoginUserBindEntity GetEntityByBindUserAccount(string bindUserAccount, string userId)
+ {
+ try
+ {
+ return this.BaseRepository().FindEntity(x => x.BindUserAccount == bindUserAccount && x.CreateUserId == userId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
#endregion
#region 提交数据
@@ -139,7 +164,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
- this.BaseRepository().Delete(t=>t.Id == keyValue);
+ this.BaseRepository().Delete(t => t.Id == keyValue);
}
catch (Exception ex)
{
@@ -159,13 +184,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// 主键
///
///
- public void SaveEntity( UserInfo userInfo, string keyValue, LoginUserBindEntity entity)
+ public void SaveEntity(UserInfo userInfo, string keyValue, LoginUserBindEntity entity)
{
try
{
if (!string.IsNullOrEmpty(keyValue))
{
- entity.Modify(keyValue,userInfo);
+ entity.Modify(keyValue, userInfo);
this.BaseRepository().Update(entity);
}
else