电子秤设备&优化

This commit is contained in:
zc
2026-03-05 18:13:39 +08:00
parent 66449b0482
commit c59df81b38
12 changed files with 204 additions and 21 deletions

View File

@@ -0,0 +1,17 @@
package top.wms.admin.config.webSocket;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
import top.wms.admin.controller.weighManage.ah.ScaleWebSocketHandler;
@Configuration
@EnableWebSocket
public class webSocket implements WebSocketConfigurer {
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
// 注册WebSocket端点允许所有跨域请求
registry.addHandler(new ScaleWebSocketHandler(), "/ws/scale").setAllowedOrigins("*");
}
}