release: scanOrConfirm 新增鉴权

release-2024-08-08
huangyw 4 months ago
parent 61c9b1eb92
commit de00b21956

@ -17,6 +17,7 @@ import com.luoo.user.util.IOSTokenUtils;
import constants.Constants; import constants.Constants;
import constants.ErrorConstants; import constants.ErrorConstants;
import controller.BaseController; import controller.BaseController;
import dto.UserLoginDto;
import enums.RequestFrequencyTypeEnum; import enums.RequestFrequencyTypeEnum;
import enums.UserStatusEnum; import enums.UserStatusEnum;
import exception.BizException; import exception.BizException;
@ -449,16 +450,20 @@ public class LoginController extends BaseController {
return Result.success(downloadUrl + "?code=" + uuid); return Result.success(downloadUrl + "?code=" + uuid);
} }
@ApiOperation(value = "9.4.确认身份接口:确定身份以及判断是否二维码过期等", notes = "确认身份接口:确定身份以及判断是否二维码过期等") @ApiOperation(value = "9.4.确认身份接口:确定身份以及判断是否二维码过期等", notes = "确认身份接口:确定身份以及判断是否二维码过期等仅APP用户可用")
@PostMapping(value = "/scanOrConfirm") @PostMapping(value = "/scanOrConfirm")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "扫码获得的code", required = true), @GlobalInterceptor(checkAppUserLogin = true)
@ApiImplicitParam(name = "userId", value = "用户id", required = true), @ApiImplicitParams({
@ApiImplicitParam(name = "authorization", value = "Authorization", required = true),
@ApiImplicitParam(name = "token", value = "扫码获得的code", required = true),
@ApiImplicitParam(name = "type", value = "type 1-扫码 2-确认", required = true)}) @ApiImplicitParam(name = "type", value = "type 1-扫码 2-确认", required = true)})
public Result<Void> scanOrConfirm(@RequestParam("token") String token, public Result<Void> scanOrConfirm(
@RequestParam("userId") String userId, @RequestHeader(value = "Authorization", required = true) String authorization,
@RequestParam("token") String token,
@RequestParam("type") Integer type) { @RequestParam("type") Integer type) {
try { try {
userInfoService.scan(userId, token, type); UserLoginDto userLoginDto = getUserLoginDto(authorization);
userInfoService.scan(userLoginDto.getUserId(), token, type);
return Result.success(); return Result.success();
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);

Loading…
Cancel
Save