ソースを参照

身份证登录修改与强制密码验证

西昌缴费二期
liangkun 3年前
コミット
1eca150309
9個のファイルの変更129行の追加13行の削除
  1. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/IdCardLogin/IdCardLogin.html
  2. +4
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/IdCardLogin/IdCardLogin.js
  3. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/login.html
  4. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypasswordandnotice/modifypasswordandnotice.css
  5. +34
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypasswordandnotice/modifypasswordandnotice.html
  6. +67
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypasswordandnotice/modifypasswordandnotice.js
  7. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.html
  8. +7
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs
  9. +11
    -4
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs

+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/IdCardLogin/IdCardLogin.html ファイルの表示

@@ -7,7 +7,7 @@
</div>
<div class="line">
<i class="iconfont icon-lock"></i>
<input id="pwd" type="password" placeholder="密码">
<input id="pwd" type="password" placeholder="新生身份证号码后8位">
</div>
<button id="loginBtn" type="button" class="lr-btn-primary lr-btn-block">
登录


+ 4
- 4
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/IdCardLogin/IdCardLogin.js ファイルの表示

@@ -40,9 +40,9 @@
var password = $('#pwd').val();
var up = true;
if (account === "") {
learun.layer.warning('用户名不能为空!', function () { }, '提示', '关闭');
learun.layer.warning('身份证号不能为空!', function () { }, '提示', '关闭');
}else if(account.length<=6){
learun.layer.warning('用户名输入有误!', function () { }, '提示', '关闭');
learun.layer.warning('身份证号输入有误!', function () { }, '提示', '关闭');
} else if (password === "") {
learun.layer.warning('密码不能为空!', function () { }, '提示', '关闭');
} else {
@@ -77,9 +77,9 @@
$('#account').val('');
$('#password').val('');
if (res.data.pwd === true) {
learun.storage.set('pwd', true);
learun.storage.set('pwdandnotice', true);
} else {
learun.storage.set('pwd', false);
learun.storage.set('pwdandnotice', false);
}
learun.tab.go('workspace');
if (learun.storage.get("Ip") != null && learun.storage.get("ACIp") != "") {


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/login.html ファイルの表示

@@ -16,7 +16,7 @@
微信登录
</button>
<button id="bindidcardBtn" type="button" class="lr-btn-primary lr-btn-block">
身份证登录
新生首次登录入口
</button>
<button id="RegisterBtn" type="button" style="display:none;" class="lr-btn-primary lr-btn-block">
注册


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypasswordandnotice/modifypasswordandnotice.css ファイルの表示

@@ -0,0 +1 @@


+ 34
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypasswordandnotice/modifypasswordandnotice.html ファイルの表示

@@ -0,0 +1,34 @@
<<div style="margin-top:10px;" class="lr-form-container" id="modifypasswordform">
<div class="lr-form-row">
<label>原密码</label>
<input id="oldpassword" type="password" isvalid="yes" checkexpession="NotNull" errormsg="原密码">
</div>
<div class="lr-form-row">
<label>新密码</label>
<input id="newpassword" type="password" isvalid="yes" checkexpession="NotNull" errormsg="新密码">
</div>
<div class="lr-form-row">
<label>确认新密码</label>
<input id="newpassword1" type="password" isvalid="yes" checkexpession="NotNull" errormsg="确认新密码">
</div>
</div>

<div class="lr-list" style="margin-top: 15px;">
<div id="strongpwd" style="display: none;">
您的密码不满足强度要求,请您先修改密码后再执行系统其他操作!
</div>
<div>
新密码必须8-20位同时包含1.[大小写字母]、2[数字]、3[特殊符号!@@#$%^&*]
</div>
<div>
学生学号请登录后点击【我的】->点击头像->查看【帐号】
</div>
<div class="lr-list-item" style="color: red; text-align: center;" id="savepassword">
保存
</div>
</div>
<div class="lr-list" style="margin-top:15px;display: none;" id="strongpwdout" >
<div class="lr-list-item" style="color:red;text-align:center;" id="outloginbtn">
退出
</div>
</div>

+ 67
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypasswordandnotice/modifypasswordandnotice.js ファイルの表示

@@ -0,0 +1,67 @@
(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 = {
newpassword: $.md5(formdata.newpassword),
oldpassword: $.md5(formdata.oldpassword)
};
learun.layer.loading(true);
// 访问后台修改密码
learun.httppost(config.webapi + "learun/adms/user/modifypw", req, (data,info) => {
learun.layer.loading(false);
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;
});
}
else {
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;
})();

+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.html ファイルの表示

@@ -221,6 +221,9 @@
if (learun.storage.get('pwd') === true) {
learun.nav.go({ path: 'my/modifypassword', isBack: false, isHead: true, title:'修改密码' });
}
if (learun.storage.get('pwdandnotice') === true) {
learun.nav.go({ path: 'my/modifypasswordandnotice', isBack: false, isHead: true, title: '修改密码' });
}
var _html = '';
// _html += '<div class="scanner">';
// _html += '<i class="iconfont icon-scan"></i>';


+ 7
- 3
Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs ファイルの表示

@@ -1162,15 +1162,19 @@ namespace Learun.Application.Organization
};
return userEntity;
}
else
{
}

userEntity.LoginOk = false;
if (userEntity.F_EnabledMark == 1)
{
if (userEntity.F_IdentityCardNo.Length <= 6)
if (userEntity.F_IdentityCardNo.Length <= 8)
{
userEntity.LoginMsg = "账户名输入有误!";
userEntity.LoginMsg = "身份证输入有误!";
}
else if (password == userEntity.F_IdentityCardNo.Substring(userEntity.F_IdentityCardNo.Length - 6, 6))
else if (password == userEntity.F_IdentityCardNo.Substring(userEntity.F_IdentityCardNo.Length - 8, 8))
{
userEntity.LoginOk = true;
}


+ 11
- 4
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs ファイルの表示

@@ -153,6 +153,13 @@ namespace Learun.Application.WebApi
}
else
{
//新增新生判断
var stuinfobasic = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(userEntity.F_EnCode);
if (stuinfobasic!=null&&stuinfobasic.Grade!="21")
{
userEntity.LoginMsg = "只有新生支持身份证方式登录";
return Fail(userEntity.LoginMsg);
}
//记录ip
userIBLL.UpdateIp(GetIP(), userEntity.F_UserId);
string token = OperatorHelper.Instance.AddLoginUser(userEntity.F_Account, "Learun_ADMS_6.1_App", this.loginMark, false);//写入缓存信息
@@ -179,10 +186,10 @@ namespace Learun.Application.WebApi
}
//是否强密码验证
bool pwd = false;
//if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true" && loginModel.up == false)
//{
// pwd = true;
//}
if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true" && loginModel.up == false)
{
pwd = true;
}
var jsonData = new
{
baseinfo = res.userInfo,


読み込み中…
キャンセル
保存