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,4 +210,7 @@ public interface UserMapper extends TkMapper<TUser> {
210 210
 
211 211
     //根据用户id获取密码
212 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,7 +733,7 @@ public class UserService extends JedisUtil {
733 733
     public ResultVo loginByCode(TUser user, HttpServletRequest request) {
734 734
         ResultVo resultVo = getCodeResultVo(user.getUserphone(), user.getMsgcode());
735 735
         if (resultVo != null) return resultVo;
736
-        UserVo userVo = userMapper.getUserByLoginname(user.getUserphone());
736
+        UserVo userVo = userMapper.getUserByPhone(user.getUserphone());
737 737
 
738 738
         if (userVo != null && userVo.getUserid() > 0) {
739 739
             user.setUserid(userVo.getUserid());

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

@@ -11,6 +11,15 @@
11 11
         from t_user u left join t_school s on u.schoolid = s.schoolid
12 12
         where u.loginname=#{loginname} limit 1
13 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 23
     <!--学生andorid登录,20211221添加GROUP_CONCAT,因为不绑定的情况下一个mac可以多个帐号登录-->
15 24
     <select id="getUserByLoginnameMac" resultType="com.xhkjedu.suser.vo.system.UserVo">
16 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