Browse Source

手机号登陆

tags/正式3.2.0
雍文秀 2 years ago
parent
commit
3535d3eb98

+ 3
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/system/UserMapper.java View File

210
 
210
 
211
     //根据用户id获取密码
211
     //根据用户id获取密码
212
     String getPwdByUserId(Integer userid);
212
     String getPwdByUserId(Integer userid);
213
+
214
+    //手机号登陆
215
+    UserVo getUserByPhone(String userphone);
213
 }
216
 }

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

733
     public ResultVo loginByCode(TUser user, HttpServletRequest request) {
733
     public ResultVo loginByCode(TUser user, HttpServletRequest request) {
734
         ResultVo resultVo = getCodeResultVo(user.getUserphone(), user.getMsgcode());
734
         ResultVo resultVo = getCodeResultVo(user.getUserphone(), user.getMsgcode());
735
         if (resultVo != null) return resultVo;
735
         if (resultVo != null) return resultVo;
736
-        UserVo userVo = userMapper.getUserByLoginname(user.getUserphone());
736
+        UserVo userVo = userMapper.getUserByPhone(user.getUserphone());
737
 
737
 
738
         if (userVo != null && userVo.getUserid() > 0) {
738
         if (userVo != null && userVo.getUserid() > 0) {
739
             user.setUserid(userVo.getUserid());
739
             user.setUserid(userVo.getUserid());

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

11
         from t_user u left join t_school s on u.schoolid = s.schoolid
11
         from t_user u left join t_school s on u.schoolid = s.schoolid
12
         where u.loginname=#{loginname} limit 1
12
         where u.loginname=#{loginname} limit 1
13
     </select>
13
     </select>
14
+    <!-- 手机号登录 -->
15
+    <select id="getUserByPhone" resultType="com.xhkjedu.suser.vo.system.UserVo">
16
+        select u.userid,u.username,u.loginname,u.loginpwd,u.userphone,u.userbirthday,u.cardid,u.headpic,u.usertype,
17
+        u.userstate,u.opepassword,u.createid,u.createtime,u.deleteid,u.deletetime,u.schoolid,u.bindmac,u.mac,u.usertime
18
+        ,s.year,s.schoolname,s.schoollevel,s.schoolstate,s.bindmac sbindmac,s.errorrate,s.schooldomain
19
+        ,(select cloudcode from t_cloud limit 1)cloudcode
20
+        from t_user u left join t_school s on u.schoolid = s.schoolid
21
+        where u.userphone=#{userphone} limit 1
22
+    </select>
14
     <!--学生andorid登录,20211221添加GROUP_CONCAT,因为不绑定的情况下一个mac可以多个帐号登录-->
23
     <!--学生andorid登录,20211221添加GROUP_CONCAT,因为不绑定的情况下一个mac可以多个帐号登录-->
15
     <select id="getUserByLoginnameMac" resultType="com.xhkjedu.suser.vo.system.UserVo">
24
     <select id="getUserByLoginnameMac" resultType="com.xhkjedu.suser.vo.system.UserVo">
16
         select u.userid,u.username,u.loginname,u.loginpwd,u.userbirthday,u.cardid,u.headpic,u.usertype,u.usersex,u.userphone,
25
         select u.userid,u.username,u.loginname,u.loginpwd,u.userbirthday,u.cardid,u.headpic,u.usertype,u.usersex,u.userphone,

Loading…
Cancel
Save