chore: 兼容前端默认国际化

This commit is contained in:
fit2-zhao 2024-08-12 16:34:52 +08:00 committed by Craftsman
parent c1e69eeb3e
commit 8f51fc5395
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping
@Tag(name="登录")
@Tag(name = "登录")
public class LoginController {
@Resource
@ -49,7 +49,7 @@ public class LoginController {
if (user != null) {
UserDTO userDTO = userLoginService.getUserDTO(user.getId());
if (StringUtils.isBlank(userDTO.getLanguage())) {
userDTO.setLanguage(defaultLocale);
userDTO.setLanguage(defaultLocale.replace("_", "-"));
}
userLoginService.autoSwitch(userDTO);

View File

@ -63,7 +63,7 @@ public class UserLocalConfigController {
@GetMapping(value = "/default-locale")
public String defaultLocale() {
return defaultLocale;
return defaultLocale.replace("_", "-");
}
}