提交 65e10627 编写于 作者: 梦境迷离's avatar 梦境迷离

修复建群后不刷新看不到群,修复多个加群消息被覆盖

上级 fd3e8c2e
......@@ -64,6 +64,8 @@
* 增加scalafmt格式化
* 打包并发布
* 修复建群后不刷新看不到群
* 修复同一个人的多个加群的消息被覆盖
### v1.2 版本
......
......@@ -2,7 +2,7 @@
git pull origin master
gradle clean build
gradle build
gradle bootRepackage
......
......@@ -14,7 +14,7 @@ CREATE TABLE `t_add_message` (
`type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '类型,可能是添加好友或群组',
`time` datetime NOT NULL COMMENT '申请时间',
PRIMARY KEY (`id`),
UNIQUE KEY `add_friend_unique` (`from_uid`,`to_uid`,`type`) USING BTREE
UNIQUE KEY `add_friend_unique` (`from_uid`,`to_uid`,`group_id`,`type`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
......
......@@ -24,6 +24,7 @@ import org.reactivestreams.Publisher
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.DependsOn
import org.springframework.stereotype.Component
import scala.collection.JavaConverters._
......@@ -38,6 +39,7 @@ import scala.language.postfixOps
* @version 1.2
*/
@Component
@DependsOn(Array("redisService"))
class WebSocketProvider @Autowired() (redisService: RedisService) {
implicit val system: ActorSystem = ActorSystem()
implicit val mat: Materializer = ActorMaterializer()
......
......@@ -39,7 +39,7 @@ class WebSocketServer @Autowired() (redisService: RedisService, akkaService: Web
private val host = ConfigFactory.load("application.conf").getString("akka-http-server.host")
private val port = ConfigFactory.load("application.conf").getInt("akka-http-server.port")
val IMServerSettings = {
private val imServerSettings = {
//自定义保持活动数据有效负载
val defaultSettings = ServerSettings(system)
val pingCounter = new AtomicInteger()
......@@ -49,7 +49,7 @@ class WebSocketServer @Autowired() (redisService: RedisService, akkaService: Web
defaultSettings.withWebsocketSettings(IMWebsocketSettings)
}
val IMRoute = {
private val imRoute = {
path("websocket") {
get {
parameters("uid".as[Int]) { uid =>
......@@ -62,7 +62,11 @@ class WebSocketServer @Autowired() (redisService: RedisService, akkaService: Web
}
def startUp() {
println(
val bindingFuture = Http().bindAndHandle(imRoute, host, port, settings = imServerSettings)
bindingFuture.failed.foreach { ex =>
LOGGER.error(s"Failed to bind to $host:$port!")
}
LOGGER.info(
"""
| __ __ ___. _________ __ __ _________
|/ \ / \ ____\_ |__ / _____/ ____ ____ | | __ _____/ |_ / _____/ ______________ __ ___________
......@@ -72,10 +76,7 @@ class WebSocketServer @Autowired() (redisService: RedisService, akkaService: Web
| \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
|""".stripMargin
)
val bindingFuture = Http().bindAndHandle(IMRoute, host, port, settings = IMServerSettings)
bindingFuture.failed.foreach { ex =>
LOGGER.error(s"Failed to bind to $host:$port!")
}
LOGGER.info(s"websocket listener on [$host:$port]")
StdIn.readLine()
bindingFuture.flatMap(_.unbind()).onComplete(_ => system.terminate())
}
......
......@@ -115,8 +115,8 @@
var mima = $.base64.decode(mima+"=")
$("#password").val(mima);
$("#loginkeeping").attr("checked", true);
console.log(email)
console.log(mima)
// console.log(email)
// console.log(mima)
}
}
......
......@@ -58,7 +58,7 @@ layui.use(['jquery', 'layer', 'form', 'upload'], function () {
});
} else if (data.code == 0) {
layer.msg(data.msg, {time: 2000}, function () {
window.parent.location.reload();//刷新父页面
window.parent.parent.location.reload();//刷新主页面
});
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册