|
|
|
@ -44,7 +44,6 @@ import java.util.concurrent.TimeUnit;
|
|
|
|
|
* 控制器层
|
|
|
|
|
*
|
|
|
|
|
* @author Administrator
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@CrossOrigin
|
|
|
|
@ -139,6 +138,7 @@ public class LoginController extends BaseController {
|
|
|
|
|
redisTemplate.delete(redisMobileCheckCodeKey);
|
|
|
|
|
return Result.success(token);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "2.1 appleId登录/注册", notes = "成功后返回authorization")
|
|
|
|
|
@PostMapping("/appleIdLogin")
|
|
|
|
|
public Result<String> appleIdLogin(HttpServletRequest request, @VerifyParam AppleLoginReq appleLoginReq) {
|
|
|
|
@ -173,7 +173,6 @@ public class LoginController extends BaseController {
|
|
|
|
|
return Result.success(token);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "2.2 微信wxId登录/注册", notes = "成功后返回authorization")
|
|
|
|
@ -286,7 +285,6 @@ public class LoginController extends BaseController {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* authorization 续期
|
|
|
|
|
*/
|
|
|
|
@ -318,8 +316,10 @@ public class LoginController extends BaseController {
|
|
|
|
|
redisTemplate.opsForValue().set(redisKey, code, 10, TimeUnit.MINUTES);
|
|
|
|
|
vCode.write(response.getOutputStream());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 4.1获取图形验证码Base64
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "4.1获取图形验证码Base64", notes = "4.三次短信验证失败后,获取图形验证码Base64,有效期10分钟")
|
|
|
|
@ -349,8 +349,10 @@ public class LoginController extends BaseController {
|
|
|
|
|
public Result<List<CountryCodeDTO>> getSupportedCountryCode() {
|
|
|
|
|
return Result.success(DEFAULT_SUPPORTED_COUNTRY_CODES);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 退出登录
|
|
|
|
|
*
|
|
|
|
|
* @param authorization
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
@ -404,7 +406,7 @@ public class LoginController extends BaseController {
|
|
|
|
|
return Result.success(uuid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "9.2.校验uuid对应的请求认证状态", notes = "0是未完成,其余是已完成状态的token")
|
|
|
|
|
@ApiOperation(value = "9.2.校验uuid对应的请求认证状态", notes = "0-未完成 1-已扫码 other-token")
|
|
|
|
|
@GetMapping(value = "/check/qr")
|
|
|
|
|
public Result<String> getCountryCode(String uuid) {
|
|
|
|
|
return Result.success(redisTemplate.opsForValue().get(uuid).toString());
|
|
|
|
@ -440,11 +442,13 @@ public class LoginController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "9.4.确认身份接口:确定身份以及判断是否二维码过期等", notes = "确认身份接口:确定身份以及判断是否二维码过期等")
|
|
|
|
|
@PostMapping(value = "/bindUserIdAndToken")
|
|
|
|
|
public Result<String> bindUserIdAndToken(@RequestParam("token") String token ,
|
|
|
|
|
@RequestParam("userId") String userId){
|
|
|
|
|
@PostMapping(value = "/scanOrConfirm")
|
|
|
|
|
public Result<Void> scanOrConfirm(@RequestParam("token") String token,
|
|
|
|
|
@RequestParam("userId") String userId,
|
|
|
|
|
@RequestParam("type") Integer type) {
|
|
|
|
|
try {
|
|
|
|
|
return Result.success(userInfoService.bindUserIdAndToken(userId,token));
|
|
|
|
|
userInfoService.scan(userId, token, type);
|
|
|
|
|
return Result.success();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|