Browse Source

Merge remote-tracking branch 'origin/master'

shiqian 3 years ago
parent
commit
6211c242dc

+ 6 - 3
boman-auth/src/main/java/com/boman/auth/controller/TokenController.java

@@ -1,6 +1,7 @@
 package com.boman.auth.controller;
 
 import com.boman.auth.service.SysLoginService;
+
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 
@@ -17,6 +18,7 @@ import com.boman.system.api.model.LoginUser;
 import com.boman.wechat.api.RemoteWechatService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
 import java.util.Map;
 
 
@@ -90,12 +92,13 @@ public class TokenController {
 
     /**
      * 扫码成功进入确认登录页面记录状态
+     *
      * @param uuid
      * @return
      */
     @GetMapping(value = "scanCode/{uuid}")
     public R<?> scanCode(@PathVariable String uuid) {
-        return  tokenService.scanCode(uuid);
+        return tokenService.scanCode(uuid);
     }
 
     /**
@@ -105,8 +108,8 @@ public class TokenController {
      * @return
      */
     @PostMapping("phoneScanLogin")
-    public void phoneScanLogin(@RequestBody LoginBody form) {
-        sysLoginService.phoneScanLogin(form);
+    public R<?> phoneScanLogin(@RequestBody LoginBody form) {
+        return sysLoginService.phoneScanLogin(form);
     }
 
     @DeleteMapping("logout")

+ 2 - 1
boman-auth/src/main/java/com/boman/auth/service/SysLoginService.java

@@ -96,7 +96,7 @@ public class SysLoginService {
      * @param form
      * @return
      */
-    public void phoneScanLogin(LoginBody form) {
+    public R<?> phoneScanLogin(LoginBody form) {
         if(redisService.getCacheObject(form.getUuid()) == null){
             throw new BaseException("登录超时,请重新登录");
         }
@@ -121,6 +121,7 @@ public class SysLoginService {
         }
         remoteLogService.saveLogininfor(userName, Constants.LOGIN_SUCCESS, "登录成功");
         redisService.setCacheObject(form.getUuid(),form.getPhone());
+        return R.ok();
     }
 
     public AjaxResult updateUnionId(SysUser sysUser) {

+ 6 - 6
boman-modules/boman-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -85,24 +85,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	
 	<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
 	    <include refid="selectUserVo"/>
-		where u.user_name = #{userName}
+		where u.user_name = #{userName}  and u.del_flag = '0'
 	</select>
 	
 	<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
 		<include refid="selectUserVo"/>
-		where u.id = #{id}
+		where u.id = #{id}  and u.del_flag = '0'
 	</select>
 	
 	<select id="checkUserNameUnique" parameterType="String" resultType="int">
-		select count(1) from sys_user where user_name = #{userName} limit 1
+		select count(1) from sys_user where user_name = #{userName} and del_flag = '0' limit 1
 	</select>
 	
 	<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
-		select id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1
+		select id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
 	</select>
 	
 	<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
-		select id, email from sys_user where email = #{email} limit 1
+		select id, email from sys_user where email = #{email} and del_flag = '0' limit 1
 	</select>
 	
 	<insert id="insertUser" parameterType="com.boman.domain.SysUser" useGeneratedKeys="true" keyProperty="id">
@@ -201,7 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 	<select id="getByPhone" resultMap="SysUserResult">
 		<include refid="selectUserVo"/>
-		 where phonenumber = #{phone} limit 1;
+		 where u.phonenumber = #{phone}  and u.del_flag = '0' and u.status = '0' limit 1;
 	</select>
 	
 </mapper>