Sfoglia il codice sorgente

【新增】移动端-多账号绑定

西昌缴费二期
dyy 4 anni fa
parent
commit
6e48e976c3
3 ha cambiato i file con 57 aggiunte e 12 eliminazioni
  1. +10
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/LoginUserBind/LoginUserBind.js
  2. +11
    -7
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/LoginUserBind/form/form.js
  3. +36
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EducationalAdministration/LoginUserBindApi.cs

+ 10
- 5
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/LoginUserBind/LoginUserBind.js Vedi File

@@ -53,16 +53,17 @@
pagination: {
rows: param.rows,
page: param.page,
sidx: 'Id',
sidx: 'CreateTime desc',
sord: 'DESC'
},
queryJson: '{}'
queryJson: JSON.stringify({ CreateUserId: learun.storage.get('userinfo').baseinfo.userId })
};
if (param.multipleData) {
multipleData.CreateUserId = learun.storage.get('userinfo').baseinfo.userId;
_postParam.queryJson = JSON.stringify(multipleData);
}
if (param.begin && param.end) {
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end });
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end, CreateUserId: learun.storage.get('userinfo').baseinfo.userId });
}
learun.httpget(config.webapi + 'learun/EducationalAdministration/LoginUserBind/pagelist', _postParam, (data) => {
$page.find('.lr-badge').text('0');
@@ -78,7 +79,11 @@
rowRender: function (_index, _item, _$item, $page) {// 渲染列表行数据
_$item.addClass('lr-list-item lr-list-item-multi');
_$item.append($('<p class="lr-ellipsis"><span>绑定账号:</span></p>').dataFormatter({ value: _item.BindUserAccount }));
_$item.append($('<p class="lr-ellipsis"><span>绑定密码:</span></p>').dataFormatter({ value: _item.BindUserPassword }));
_$item.append($('<p class="lr-ellipsis"><span>绑定时间:</span></p>').dataFormatter({
value: _item.CreateTime,
type: 'datetime',
dateformat: 'yyyy-MM-dd hh:mm:ss'
}));
return '';
},
rowClick: function (item, $item, $page) {// 列表行点击触发方法
@@ -95,7 +100,7 @@
learun.layer.loading(false);
});
}
}, 'Learun智慧校园提示', ['取消', '确定']);
}, '智慧校园提示', ['取消', '确定']);
},
rowBtns: ['<a class="lr-btn-danger">删除</a>'] // 列表行左滑按钮
};


+ 11
- 7
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/LoginUserBind/form/form.js Vedi File

@@ -12,14 +12,14 @@
isScroll: true,
init: function ($page, param) {
keyValue = param.keyValue;
// 添加头部按钮列表
var _html = '\
< div class="lr-form-header-cancel" > 取消</div >\
<div class="lr-form-header-btnlist" >\
// 添加头部按钮列表
var _html = '\
<div class="lr-form-header-cancel" >取消</div>\
<div class="lr-form-header-btnlist" >\
<div class="lr-form-header-more" ><i class="iconfont icon-more" ></i></div>\
<div class="lr-form-header-edit" ><i class="iconfont icon-edit" ></i></div>\
</div>\
<div class="lr-form-header-submit" >提交</div>';
<div class="lr-form-header-submit" >提交</div>';
$header = $page.parents('.f-page').find('.f-page-header');
$header.append(_html);
// 取消
@@ -70,7 +70,7 @@
}
});
}
}, 'Learun智慧校园提示', ['取消', '确定']);
}, '智慧校园提示', ['取消', '确定']);
}
}
],
@@ -84,9 +84,13 @@
if (!$page.find('.lr-form-container').lrformValid()) {
return false;
}
var data = $page.find('.lr-form-container').lrformGet();
data.BindUserAccount = $page.find('#BindUserAccount').val().trim();
data.BindUserPassword = $page.find('#BindUserPassword').val().trim();
data.BindUserPasswordTemp = $.md5(data.BindUserPassword);
var _postData = {}
_postData.keyValue = keyValue;
_postData.strEntity = JSON.stringify($page.find('.lr-form-container').lrformGet());
_postData.strEntity = JSON.stringify(data);
learun.layer.loading(true, '正在提交数据');
learun.httppost(config.webapi + 'learun/EducationalAdministration/LoginUserBind/save', _postData, (data) => {
learun.layer.loading(false);


+ 36
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EducationalAdministration/LoginUserBindApi.cs Vedi File

@@ -2,6 +2,9 @@
using Learun.Util;
using System.Collections.Generic;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Learun.Application.Organization;
using System;

namespace Learun.Application.WebApi
{
/// <summary>
@@ -14,6 +17,7 @@ namespace Learun.Application.WebApi
public class LoginUserBindApi : BaseApi
{
private LoginUserBindIBLL loginUserBindIBLL = new LoginUserBindBLL();
private UserIBLL userIBLL = new UserBLL();

/// <summary>
/// 注册接口
@@ -97,6 +101,38 @@ namespace Learun.Application.WebApi
{
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
LoginUserBindEntity entity = parameter.strEntity.ToObject<LoginUserBindEntity>();

if (entity.BindUserAccount == userInfo.account)
{
return Fail("绑定账号不能为登录用户账号!");
}
//判断账号是否已绑定
if (string.IsNullOrEmpty(parameter.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 != parameter.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(this.userInfo, parameter.keyValue, entity);
return Success("保存成功!");
}


Caricamento…
Annulla
Salva