@@ -27,13 +27,13 @@ public class CmsUtils {
2727 public static final String USER_ATTRIBUTE_KEY = "user" ;
2828
2929 // 缓存服务器IP地址 - 只在第一次调用getServerIp时初始化
30- private static String serverIp = null ;
31- private static boolean initializing = false ;
30+ private String serverIp = null ;
31+ private boolean initializing = false ;
3232
3333 // 新增的全局变量
34- private static String websocketAddress = null ;
35- private static String otaAddress = null ;
36- private static String serverAddress = null ;
34+ private String websocketAddress = null ;
35+ private String otaAddress = null ;
36+ private String serverAddress = null ;
3737
3838 @ Value ("${server.port:8091}" )
3939 private int port ;
@@ -88,17 +88,17 @@ public static String getName() {
8888 }
8989
9090 // WebSocket地址
91- public static String getWebsocketAddress () {
91+ public String getWebsocketAddress () {
9292 return websocketAddress ;
9393 }
9494
9595 // OTA地址
96- public static String getOtaAddress () {
96+ public String getOtaAddress () {
9797 return otaAddress ;
9898 }
9999
100100 // Server地址
101- public static String getServerAddress () {
101+ public String getServerAddress () {
102102 return serverAddress ;
103103 }
104104
@@ -211,7 +211,7 @@ public static String getServerAddress() {
211211 /**
212212 * 判断MAC地址是否合法
213213 */
214- public static boolean isMacAddressValid (String mac ) {
214+ public boolean isMacAddressValid (String mac ) {
215215 // 正则校验格式
216216 if (!macPattern .matcher (mac ).matches ()) {
217217 return false ;
@@ -273,7 +273,7 @@ public static String getClientIp(HttpServletRequest request) {
273273 *
274274 * @return 合适的IP地址
275275 */
276- public static String getServerIp () {
276+ public String getServerIp () {
277277 // 如果IP已经初始化,直接返回
278278 if (serverIp != null ) {
279279 return serverIp ;
@@ -1066,7 +1066,7 @@ private static boolean isRunningInDocker() {
10661066 /**
10671067 * 获取环境类型的详细信息,用于调试
10681068 */
1069- public static Map <String , Object > getEnvironmentDetails () {
1069+ public Map <String , Object > getEnvironmentDetails () {
10701070 Map <String , Object > details = new HashMap <>();
10711071
10721072 // 获取IP信息
0 commit comments