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
     //是否需要绑定手机号0不绑定1绑定
33
     //是否需要绑定手机号0不绑定1绑定
34
     private Integer cloudbindphone;
34
     private Integer cloudbindphone;
35
 
35
 
36
-    //是否有学生网页端0没有1有
37
-    private Integer stuweb;
38
-
39
     //主题色
36
     //主题色
40
     private String theme;
37
     private String theme;
41
 
38
 

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

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

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

78
     <update id="updateById">
78
     <update id="updateById">
79
         update t_school set schoolname=#{school.schoolname},shortname=#{school.shortname},errorrate=#{school.errorrate}
79
         update t_school set schoolname=#{school.schoolname},shortname=#{school.shortname},errorrate=#{school.errorrate}
80
         ,schoolbindmac=#{school.schoolbindmac},docklc=#{school.docklc},usernum=#{school.usernum},livenum=#{school.livenum}
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
         where schoolid=#{school.schoolid}
82
         where schoolid=#{school.schoolid}
83
     </update>
83
     </update>
84
     <!--根据域名获取学校id-->
84
     <!--根据域名获取学校id-->

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

123
                 errornum = userVo.getErrornum() + 1;
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
                 userMapper.updateUserLock(userVo.getUserid(),1);
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
         } else {
145
         } else {
137
             Integer usertype = userVo.getUsertype();
146
             Integer usertype = userVo.getUsertype();
138
             if (usertype == 999) {
147
             if (usertype == 999) {
300
                 errornum = userVo.getErrornum() + 1;
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
                 userMapper.updateUserLock(userVo.getUserid(),1);
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
         } else {
330
         } else {
313
             Integer sbindmac = userVo.getSbindmac();//学校是否绑定设备0未绑定1绑定
331
             Integer sbindmac = userVo.getSbindmac();//学校是否绑定设备0未绑定1绑定
314
             String mac = user.getMac();
332
             String mac = user.getMac();

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

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

Loading…
Cancel
Save