游戏角标-过滤规则-版本号

This commit is contained in:
2025-08-19 18:44:35 +08:00
parent c8442b06d4
commit fe5120740b
3 changed files with 20 additions and 17 deletions

View File

@@ -40,17 +40,14 @@ public class AppVersionUtil {
return diff;
}
public static Integer getAppVersion() {
public static String getAppVersion() {
String APP_VERSION = "appVersion";
try {
//获取当前版本号
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (requestAttributes != null) {
HttpServletRequest request = requestAttributes.getRequest();
String appVersion = request.getParameter(APP_VERSION);
if (StrUtil.isNotBlank(appVersion)) {
return getAppVersion(appVersion);
}
return request.getParameter(APP_VERSION);
}
} catch (Exception ignored) {
}
@@ -58,7 +55,7 @@ public class AppVersionUtil {
}
public static Integer getAppVersion(String appVersion) {
return NumberUtil.parseInt(appVersion.replaceAll("\\.", String.valueOf(0)));
return NumberUtil.parseInt(appVersion.replaceAll("\\.", ""));
}
/**