Browse Source

完善密码错误提示,学校添加是否开启学生网页功能

tags/正式3.13.3
王宁 1 year ago
parent
commit
19152ed99c

+ 0
- 3
sapi/src/main/java/com/xhkjedu/sapi/model/cloud/TCloud.java View File

@@ -33,9 +33,6 @@ public class TCloud extends BaseBean {
33 33
     //是否需要绑定手机号0不绑定1绑定
34 34
     private Integer cloudbindphone;
35 35
 
36
-    //是否有学生网页端0没有1有
37
-    private Integer stuweb;
38
-
39 36
     //主题色
40 37
     private String theme;
41 38
 

+ 2
- 1
sapi/src/main/java/com/xhkjedu/sapi/model/system/TSchool.java View File

@@ -57,13 +57,14 @@ public class TSchool extends BaseBean {
57 57
 
58 58
     private Integer usernum;//账号数量
59 59
 
60
+    private Integer stuweb;//是否有学生网页端0没有1有
61
+
60 62
     //创建人
61 63
     private Integer createid;
62 64
 
63 65
     //创建时间
64 66
     private Integer createtime;
65 67
 
66
-
67 68
     @Transient
68 69
     //管理员登录账号
69 70
     private String loginname;

+ 1
- 1
sapi/src/main/resources/mapper/system/SchoolMapper.xml View File

@@ -78,7 +78,7 @@
78 78
     <update id="updateById">
79 79
         update t_school set schoolname=#{school.schoolname},shortname=#{school.shortname},errorrate=#{school.errorrate}
80 80
         ,schoolbindmac=#{school.schoolbindmac},docklc=#{school.docklc},usernum=#{school.usernum},livenum=#{school.livenum}
81
-        ,livetime=#{school.livetime},coordinate=#{school.coordinate},limitenolen=#{school.limitenolen}
81
+        ,livetime=#{school.livetime},coordinate=#{school.coordinate},limitenolen=#{school.limitenolen},stuweb=#{school.stuweb}
82 82
         where schoolid=#{school.schoolid}
83 83
     </update>
84 84
     <!--根据域名获取学校id-->

+ 28
- 10
suser/src/main/java/com/xhkjedu/suser/service/system/UserService.java View File

@@ -123,16 +123,25 @@ public class UserService extends JedisUtil {
123 123
                 errornum = userVo.getErrornum() + 1;
124 124
             }
125 125
 
126
-            if(errornum >= ConfigKey.loginerrornum){
127
-                //如果密码连续出错次数超过等于或超过限制,锁定帐号
126
+            //修改码连续出错次数
127
+            userMapper.updateErrornum(userVo.getUserid(),errornum);
128
+
129
+            Integer loginerrornum =  ConfigKey.loginerrornum;
130
+            int synum = loginerrornum - errornum;//剩余次数
131
+            if(synum <= 0){
132
+                //如果密码连续出错次数超过等于或超过限制,锁定账号
128 133
                 userMapper.updateUserLock(userVo.getUserid(),1);
129 134
             }
130 135
 
131
-            //修改码连续出错次数
132
-            userMapper.updateErrornum(userVo.getUserid(),errornum);
136
+            String msg = "密码错误";
137
+            if(synum>0 && synum <= 5){
138
+                msg = msg + ",还可以尝试"+ synum +"次,账号将被锁定。";
139
+            }else if(synum == 0){
140
+                msg = msg + ",账号已被锁定。";
141
+            }
133 142
 
134 143
             //帐号密码登录
135
-            return new ResultVo(1, "密码错误", userVo);
144
+            return new ResultVo(1, msg, userVo);
136 145
         } else {
137 146
             Integer usertype = userVo.getUsertype();
138 147
             if (usertype == 999) {
@@ -300,15 +309,24 @@ public class UserService extends JedisUtil {
300 309
                 errornum = userVo.getErrornum() + 1;
301 310
             }
302 311
 
303
-            if(errornum >= ConfigKey.loginerrornum){
304
-                //如果密码连续出错次数超过等于或超过限制,锁定帐号
312
+            //修改码连续出错次数
313
+            userMapper.updateErrornum(userVo.getUserid(),errornum);
314
+
315
+            Integer loginerrornum =  ConfigKey.loginerrornum;
316
+            int synum = loginerrornum - errornum;//剩余次数
317
+            if(synum <= 0){
318
+                //如果密码连续出错次数超过等于或超过限制,锁定账号
305 319
                 userMapper.updateUserLock(userVo.getUserid(),1);
306 320
             }
307 321
 
308
-            //修改码连续出错次数
309
-            userMapper.updateErrornum(userVo.getUserid(),errornum);
322
+            String msg = "密码错误";
323
+            if(synum>0 && synum <= 5){
324
+                msg = msg + ",还可以尝试"+ synum +"次,账号将被锁定。";
325
+            }else if(synum == 0){
326
+                msg = msg + ",账号已被锁定。";
327
+            }
310 328
 
311
-            return new ResultVo(1, "密码错误", userVo);
329
+            return new ResultVo(1, msg, userVo);
312 330
         } else {
313 331
             Integer sbindmac = userVo.getSbindmac();//学校是否绑定设备0未绑定1绑定
314 332
             String mac = user.getMac();

+ 3
- 3
suser/src/main/resources/mapper/system/UserMapper.xml View File

@@ -7,7 +7,7 @@
7 7
         select u.userid,u.username,u.loginname,u.loginpwd,u.userphone,u.userbirthday,u.cardid,u.headpic,u.usertype,u.usersex,
8 8
         u.userstate,u.opepassword,u.createid,u.createtime,u.deleteid,u.deletetime,u.schoolid,u.bindmac,u.mac,u.usertime,u.userlock
9 9
         ,u.errornum,s.year,s.schoolname,s.schoollevel,s.schoolstate,s.schoolbindmac sbindmac,s.errorrate,s.schooldomain
10
-        ,c.cloudcode,c.stuweb
10
+        ,c.cloudcode,s.stuweb
11 11
         from t_cloud c,t_user u left join t_school s on u.schoolid = s.schoolid
12 12
         where binary u.loginname=#{loginname} limit 1
13 13
     </select>
@@ -16,7 +16,7 @@
16 16
         select u.userid,u.username,u.loginname,u.loginpwd,u.userphone,u.userbirthday,u.cardid,u.headpic,u.usertype,u.usersex,
17 17
             u.userstate,u.opepassword,u.createid,u.createtime,u.deleteid,u.deletetime,u.schoolid,u.bindmac,u.mac,u.usertime,u.userlock,
18 18
             u.errornum,s.year,s.schoolname,s.schoollevel,s.schoolstate,s.schoolbindmac sbindmac,s.errorrate,s.schooldomain
19
-            ,c.cloudcode,c.stuweb
19
+            ,c.cloudcode,s.stuweb
20 20
         from t_cloud c,t_user u left join t_school s on u.schoolid = s.schoolid
21 21
         where u.bindphoned=1 and u.userphone=#{userphone} limit 1
22 22
     </select>
@@ -302,7 +302,7 @@
302 302
     </select>
303 303
     <!--根据手机号获取用户基本信息-->
304 304
     <select id="getUserByUserPhone" resultType="com.xhkjedu.vo.system.UserVo">
305
-        select u.usertype,u.userstate,u.usertime,u.userlock,u.bindphoned,s.schoolstate,c.stuweb
305
+        select u.usertype,u.userstate,u.usertime,u.userlock,u.bindphoned,s.schoolstate,s.stuweb
306 306
         from t_cloud c,t_user u left join t_school s on u.schoolid = s.schoolid
307 307
         where u.userphone=#{userphone} limit 1
308 308
     </select>

Loading…
Cancel
Save