| | |
| | | return R.fail("当前手机号已被绑定"); |
| | | } |
| | | } |
| | | if(type==4){ |
| | | AppUser data = remoteAppUserService.getUserByPhone(cellPhone).getData(); |
| | | if (data!=null && (data.getWxOpenId()!=null||data.getAppleId()!=null)){ |
| | | return R.fail("当前手机号已被绑定"); |
| | | } |
| | | } |
| | | if(type==1){ |
| | | AppUser data = remoteAppUserService.getUserByPhone(cellPhone).getData(); |
| | | if (data!=null){ |
| | | return R.fail("当前手机号已注册"); |
| | | } |
| | | } |
| | | if(type==3){ |
| | | AppUser data = remoteAppUserService.getUserByPhone(cellPhone).getData(); |
| | | if (data!=null){ |
| | | return R.fail("当前手机号未注册"); |
| | | } |
| | | } |
| | | sysLoginService.sendCaptchaCode(cellPhone, type); |
| | | return R.ok(); |
| | | } |
| | |
| | | @PostMapping("/app/login") |
| | | public R<AppLoginUser> appLogin(@Validated @RequestBody AppLoginBody body) { |
| | | AppLoginUser appLoginUser = sysLoginService.appLogin(body); |
| | | Long appUserId = appLoginUser.getAppUserId(); |
| | | AppUser data = remoteAppUserService.getAppUserById(appUserId + "").getData(); |
| | | if (data.getUserStatus() == 2){ |
| | | return R.fail("您的账号已被冻结"); |
| | | } |
| | | return R.ok(tokenService.createToken4AppLoginUser(appLoginUser)); |
| | | } |
| | | |
| | |
| | | @PostMapping("/app/captchaLogin") |
| | | public R<AppLoginUser> appCaptchaLogin(@Validated @RequestBody AppCaptchaBody body) { |
| | | AppLoginUser appLoginUser = sysLoginService.appCaptchaLogin(body); |
| | | Long appUserId = appLoginUser.getAppUserId(); |
| | | AppUser data = remoteAppUserService.getAppUserById(appUserId + "").getData(); |
| | | if (data.getUserStatus() == 2){ |
| | | return R.fail("您的账号已被冻结"); |
| | | } |
| | | return R.ok(tokenService.createToken4AppLoginUser(appLoginUser)); |
| | | } |
| | | |
| | |
| | | @PostMapping("/app/wxLogin") |
| | | public R<AppLoginUser> thirdLogin(@Validated @RequestBody AppWXLoginBody body) { |
| | | AppLoginUser appLoginUser = sysLoginService.wxLogin(body); |
| | | Long appUserId = appLoginUser.getAppUserId(); |
| | | AppUser data = remoteAppUserService.getAppUserById(appUserId + "").getData(); |
| | | if (data.getUserStatus() == 2){ |
| | | return R.fail("您的账号已被冻结"); |
| | | } |
| | | return R.ok(tokenService.createToken4AppLoginUser(appLoginUser)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "苹果登录", tags = {"APP端"}) |
| | | @PostMapping("/app/appleLogin") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "appleId", value = "苹果ID", required = true, dataType = "String", paramType = "query"), |
| | | @ApiImplicitParam(name = "appleId", value = "苹果ID", required = true, dataType = "String", paramType = "query") |
| | | // @ApiImplicitParam(name = "device", value = "设备码", required = false, dataType = "String", paramType = "query"), |
| | | } |
| | | ) |
| | | public R<AppLoginUser> appleLogin( |
| | | @RequestParam(value = "appleId", required = true) String appleId) { |
| | | AppLoginUser appLoginUser = sysLoginService.appleLogin(appleId); |
| | | @RequestParam(value = "appleId", required = true) String appleId, |
| | | @RequestParam(value = "device", required = false) String device |
| | | ) { |
| | | |
| | | AppLoginUser appLoginUser = sysLoginService.appleLogin(appleId, org.springframework.util.StringUtils.hasLength(device)?device:""); |
| | | Long appUserId = appLoginUser.getAppUserId(); |
| | | AppUser data = remoteAppUserService.getAppUserById(appUserId + "").getData(); |
| | | if (data.getUserStatus() == 2){ |
| | | return R.fail("您的账号已被冻结"); |
| | | } |
| | | return R.ok(tokenService.createToken4AppLoginUser(appLoginUser)); |
| | | } |
| | | |