提交 ab37d7c5 作者: han

手机号登录

上级 cc458067
...@@ -7,6 +7,7 @@ import com.mmc.iuav.user.model.qo.LoginUserQO; ...@@ -7,6 +7,7 @@ import com.mmc.iuav.user.model.qo.LoginUserQO;
import com.mmc.iuav.user.model.vo.AppUserSucVO; import com.mmc.iuav.user.model.vo.AppUserSucVO;
import com.mmc.iuav.user.model.vo.WxLoginVO; import com.mmc.iuav.user.model.vo.WxLoginVO;
import com.mmc.iuav.user.service.AuthService; import com.mmc.iuav.user.service.AuthService;
import com.mmc.iuav.user.service.UserAccountService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -23,6 +24,8 @@ public class AuthController { ...@@ -23,6 +24,8 @@ public class AuthController {
@Autowired @Autowired
private AuthService authService; private AuthService authService;
@Autowired
private UserAccountService userAccountService;
@ApiOperation(value = "小程序登录/注册") @ApiOperation(value = "小程序登录/注册")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = AppUserSucVO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = AppUserSucVO.class)})
...@@ -45,4 +48,12 @@ public class AuthController { ...@@ -45,4 +48,12 @@ public class AuthController {
public ResultBody testAppletLogin(@RequestParam String unionId) { public ResultBody testAppletLogin(@RequestParam String unionId) {
return authService.testAppletLogin(unionId); return authService.testAppletLogin(unionId);
} }
@ApiOperation(value = "测试-手机号登录")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = AppUserSucVO.class)})
@PostMapping("testPhoneLogin")
public ResultBody testPhoneLogin(@RequestParam String phone) {
String unionId = userAccountService.selectUnionIdByPhone(phone);
return authService.testAppletLogin(unionId);
}
} }
...@@ -234,4 +234,9 @@ public interface UserServiceDao { ...@@ -234,4 +234,9 @@ public interface UserServiceDao {
* @return {@link String} * @return {@link String}
*/ */
String getUserPhoneByUserId(Integer userId); String getUserPhoneByUserId(Integer userId);
/**
* 根据手机号查询unionId
*/
String selectUnionIdByPhone(String phone);
} }
...@@ -182,4 +182,9 @@ public interface UserAccountService { ...@@ -182,4 +182,9 @@ public interface UserAccountService {
UserAccountMessageVo userMessages(Integer userAccountId); UserAccountMessageVo userMessages(Integer userAccountId);
UserBaseInfoDTO feignGetUserBaseInfo(Integer userAccountId); UserBaseInfoDTO feignGetUserBaseInfo(Integer userAccountId);
/**
* 根据手机号查询unionId
*/
String selectUnionIdByPhone(String phone);
} }
...@@ -567,5 +567,10 @@ public class UserAccountServiceImpl implements UserAccountService { ...@@ -567,5 +567,10 @@ public class UserAccountServiceImpl implements UserAccountService {
return userServiceDao.getUserBaseInfo(userAccountId); return userServiceDao.getUserBaseInfo(userAccountId);
} }
@Override
public String selectUnionIdByPhone(String phone) {
return userServiceDao.selectUnionIdByPhone(phone);
}
} }
...@@ -666,5 +666,11 @@ ...@@ -666,5 +666,11 @@
<select id="getUserPhoneByUserId" resultType="java.lang.String"> <select id="getUserPhoneByUserId" resultType="java.lang.String">
select phone_num from user_account where id = #{userId} select phone_num from user_account where id = #{userId}
</select> </select>
<select id="selectUnionIdByPhone" resultType="java.lang.String">
select union_id
from user_account
where phone_num = #{phone}
limit 1
</select>
</mapper> </mapper>
...@@ -8,6 +8,7 @@ data-filter: ...@@ -8,6 +8,7 @@ data-filter:
- /userapp/webjars/** - /userapp/webjars/**
- /userapp/auth/backEndLogin - /userapp/auth/backEndLogin
- /userapp/auth/testAppletLogin - /userapp/auth/testAppletLogin
- /userapp/auth/testPhoneLogin
- /userapp/auth/appletLogin - /userapp/auth/appletLogin
- /userapp/auth/backEndLogin - /userapp/auth/backEndLogin
- /userapp/cooperation/listTag - /userapp/cooperation/listTag
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论