修复登录时上传设备平台

This commit is contained in:
2025-09-23 09:07:08 +08:00
parent 9b03e11919
commit 6a55ac47e3
4 changed files with 15 additions and 7 deletions

View File

@@ -50,8 +50,10 @@ public class RegisterController {
@PostMapping("/phone_register")
public Result registerByPhone(
@RequestParam String phone, @RequestParam String code,
@RequestParam(value = "verify_key") String verifyKey, @RequestParam(value = "Device-ID") String deviceId) {
logger.info("registerByPhone: phone={}, code={}, verifyKey={}, deviceId={}", phone, code, verifyKey, deviceId);
@RequestParam(value = "verify_key") String verifyKey,
@RequestParam(value = "Device-ID") String deviceId,
@RequestParam(value = "mobile_platform", defaultValue = "0") Integer mobilePlatform) {
logger.info("registerByPhone: phone={}, code={}, verifyKey={}, deviceId={}, mobilePlatform={}", phone, code, verifyKey, deviceId, mobilePlatform);
// if (TextUtils.isEmpty(verifyKey)) {
// return Result.error().message("verify key is empty", HttpStatus.BAD_REQUEST);
@@ -67,7 +69,7 @@ public class RegisterController {
return Result.error().message("code is not same");
}
try {
User user = userService.registerByPhone(phone, code, deviceId, new Date());
User user = userService.registerByPhone(phone, code, deviceId, mobilePlatform, new Date());
logger.info("loginByPhoneCode: user={}", user.toString());
TokenPair tokenPair = jwtUtil.generateTokenPair(user.getUserId(), deviceId);
//返回给app保存access_token用来加入header请求接口refresh_token用来更换access_token

View File

@@ -152,6 +152,7 @@ public class DevicesController {
apkIconFileInfo.setOriginFileName(originName);
apkIconFileInfo.setFileName(fileName);
apkIconFileInfo.setFilSize(file.getSize());
apkIconService.save(apkIconFileInfo);
return Result.ok();