Browse Source

Merge remote-tracking branch 'origin/v_2.0.0' into v_2.0.0

master
xsx 2 years ago
parent
commit
677eb466fc
  1. 3
      im-platform/src/main/java/com/bx/implatform/service/impl/GroupServiceImpl.java
  2. 2
      im-ui/.env.development
  3. BIN
      im-ui/src/assets/image/icp_logo.png
  4. 1
      im-ui/src/components/common/HeadImage.vue
  5. 26
      im-ui/src/components/common/Icp.vue
  6. 9
      im-ui/src/components/setting/Setting.vue
  7. 3
      im-ui/src/store/chatStore.js
  8. 6
      im-ui/src/view/Group.vue
  9. 226
      im-ui/src/view/Login.vue
  10. 6
      im-ui/src/view/Register.vue
  11. 2
      im-uniapp/components/chat-message-item/chat-message-item.vue
  12. 4
      im-uniapp/store/chatStore.js

3
im-platform/src/main/java/com/bx/implatform/service/impl/GroupServiceImpl.java

@ -67,6 +67,7 @@ public class GroupServiceImpl extends ServiceImpl<GroupMapper, Group> implements
GroupMember groupMember = new GroupMember();
groupMember.setGroupId(group.getId());
groupMember.setUserId(user.getId());
groupMember.setHeadImage(user.getHeadImageThumb());
groupMember.setAliasName(StringUtils.isEmpty(vo.getAliasName())?session.getNickName():vo.getAliasName());
groupMember.setRemark(StringUtils.isEmpty(vo.getRemark())?group.getName():vo.getRemark());
groupMemberService.save(groupMember);
@ -80,7 +81,7 @@ public class GroupServiceImpl extends ServiceImpl<GroupMapper, Group> implements
/**
* 修改群聊信息
*
*
* @param vo 群聊信息
* @return 群聊信息
**/

2
im-ui/.env.development

@ -2,7 +2,7 @@
ENV = 'development'
# app名称
VUE_APP_NAME = "盒子IM"
// 接口请求地址
# 接口请求地址
VUE_APP_BASE_API = '/api'
# ws地址
VUE_APP_WS_URL = 'ws://localhost:8878/im'

BIN
im-ui/src/assets/image/icp_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

1
im-ui/src/components/common/HeadImage.vue

@ -41,7 +41,6 @@
},
methods:{
showUserInfo(e){
console.log(this.id)
if(this.id && this.id>0){
this.$http({
url: `/user/find/${this.id}`,

26
im-ui/src/components/common/Icp.vue

@ -0,0 +1,26 @@
<template>
<div class="icp">
<img class="icp-icon" src="../../assets/image/icp_logo.png">
<a target="_blank" href="https://beian.miit.gov.cn/">粤ICP备2022140558号-1</a>
</div>
</template>
<script>
</script>
<style lang="scss">
.icp {
position: fixed;
text-align: center;
bottom: 20px;
margin: 0 auto;
width: 100%;
color: #5c6b77;
.icp-icon {
width: 20px;
height: 20px;
vertical-align: bottom;
}
}
</style>

9
im-ui/src/components/setting/Setting.vue

@ -7,7 +7,6 @@
:showLoading="true"
:maxSize="maxSize"
@success="onUploadSuccess"
:fileTypes="['image/jpeg', 'image/png', 'image/jpg','image/webp']">
<img v-if="userInfo.headImage" :src="userInfo.headImage" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
@ -38,13 +37,11 @@
</template>
<script>
import HeadImage from "../common/HeadImage.vue";
import FileUpload from "../common/FileUpload.vue";
export default {
name: "setting",
components: {
HeadImage,
FileUpload
},
data() {
@ -84,9 +81,9 @@
})
});
},
onUploadSuccess(res, file) {
this.userInfo.headImage = res.data.originUrl;
this.userInfo.headImageThumb = res.data.thumbUrl;
onUploadSuccess(data, file) {
this.userInfo.headImage = data.originUrl;
this.userInfo.headImageThumb = data.thumbUrl;
}
},
props: {

3
im-ui/src/store/chatStore.js

@ -151,7 +151,8 @@ export default {
chat.unreadCount++;
}
// 是否有人@我
if(!msgInfo.selfSend && chat.type=="GROUP" && msgInfo.atUserIds){
if(!msgInfo.selfSend && chat.type=="GROUP" && msgInfo.atUserIds
&& msgInfo.status != MESSAGE_STATUS.READED){
let userId = userStore.state.userInfo.id;
if(msgInfo.atUserIds.indexOf(userId)>=0){
chat.atMe = true;

6
im-ui/src/view/Group.vue

@ -158,9 +158,9 @@
onCloseAddGroupMember() {
this.showAddGroupMember = false;
},
onUploadSuccess(res) {
this.activeGroup.headImage = res.data.originUrl;
this.activeGroup.headImageThumb = res.data.thumbUrl;
onUploadSuccess(data) {
this.activeGroup.headImage =data.originUrl;
this.activeGroup.headImageThumb = data.thumbUrl;
},
onSaveGroup() {
this.$refs['groupForm'].validate((valid) => {

226
im-ui/src/view/Login.vue

@ -1,73 +1,82 @@
<template>
<div class="login-view">
<div class="login-intro">
<div>
<h3>盒子IM 2.0版本正式发布</h3>
<ul>
<li>发布uniapp移动版本支持移动端和web端同时在线多端消息同步</li>
<li>目前移动端仅兼容h5和微信小程序后续会继续兼容更多终端类型</li>
<li>页面风格升级表情包更新自动生成文字头像等</li>
</ul>
</div>
<div>
<h3>最近更新(2023-11-05)</h3>
<ul>
<li>聊天输入框支持粘贴截图</li>
<li>聊天消息支持显示已读未读状态</li>
<li>修改拉取离线消息机制:用户登录后,自动从服务器同步最近1个月的消息</li>
</ul>
</div>
<div>
<h3>最近更新(2023-11-12)</h3>
<ul>
<li>群聊加入@功能</li>
<li>聊天输入框支持显示emoji表情</li>
</ul>
</div>
<div>
<h3>项目依旧完全开源可内网部署如果项目对您有帮助,请帮忙点个star:</h3>
</div>
<div class="login-icons">
<a class="login-icon">
<img src="https://img.shields.io/badge/license-MIT-red" />
</a>
<a class="login-icon" href="https://gitee.com/bluexsx/box-im" target="_blank">
<img src="https://gitee.com/bluexsx/box-im/badge/star.svg" />
</a>
<a class="login-icon" href="https://gitee.com/bluexsx/box-im" target="_blank">
<img src="https://img.shields.io/github/stars/bluexsx/box-im.svg?style=flat&logo=GitHub" />
</a>
<div class="login-content">
<div class="login-intro">
<div>
<h3>盒子IM 2.0版本正式发布</h3>
<ul>
<li>发布uniapp移动版本支持移动端和web端同时在线多端消息同步</li>
<li>目前移动端仅兼容h5和微信小程序后续会继续兼容更多终端类型</li>
<li>页面风格升级表情包更新自动生成文字头像等</li>
</ul>
</div>
<div>
<h3>最近更新(2023-11-05)</h3>
<ul>
<li>聊天输入框支持粘贴截图</li>
<li>聊天消息支持显示已读未读状态</li>
<li>修改拉取离线消息机制:用户登录后,自动从服务器同步最近1个月的消息</li>
</ul>
</div>
<div>
<h3>最近更新(2023-11-12)</h3>
<ul>
<li>群聊加入@功能</li>
<li>聊天输入框支持显示emoji表情</li>
</ul>
</div>
<div>
<h3>项目依旧完全开源可内网部署如果项目对您有帮助,请帮忙点个star:</h3>
</div>
<div class="login-icons">
<a class="login-icon">
<img src="https://img.shields.io/badge/license-MIT-red" />
</a>
<a class="login-icon" href="https://gitee.com/bluexsx/box-im" target="_blank">
<img src="https://gitee.com/bluexsx/box-im/badge/star.svg" />
</a>
<a class="login-icon" href="https://gitee.com/bluexsx/box-im" target="_blank">
<img src="https://img.shields.io/github/stars/bluexsx/box-im.svg?style=flat&logo=GitHub" />
</a>
</div>
</div>
</div>
<el-form class="login-form" :model="loginForm" status-icon :rules="rules" ref="loginForm" label-width="60px"
@keyup.enter.native="submitForm('loginForm')">
<div class="login-brand">登陆盒子IM</div>
<el-form-item label="终端" prop="userName" v-show="false">
<el-input type="terminal" v-model="loginForm.terminal" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="用户名" prop="userName">
<el-input type="userName" v-model="loginForm.userName" autocomplete="off" placeholder="用户名"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input type="password" v-model="loginForm.password" autocomplete="off" placeholder="密码"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('loginForm')">登陆</el-button>
<el-button @click="resetForm('loginForm')">清空</el-button>
</el-form-item>
<div class="register">
<router-link to="/register">没有账号,前往注册</router-link>
</div>
</el-form>
<el-form class="login-form" :model="loginForm" status-icon :rules="rules" ref="loginForm" label-width="60px"
@keyup.enter.native="submitForm('loginForm')">
<div class="login-brand">登陆盒子IM</div>
<el-form-item label="终端" prop="userName" v-show="false">
<el-input type="terminal" v-model="loginForm.terminal" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="用户名" prop="userName">
<el-input type="userName" v-model="loginForm.userName" autocomplete="off"
placeholder="用户名"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input type="password" v-model="loginForm.password" autocomplete="off"
placeholder="密码"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('loginForm')">登陆</el-button>
<el-button @click="resetForm('loginForm')">清空</el-button>
</el-form-item>
<div class="register">
<router-link to="/register">没有账号,前往注册</router-link>
</div>
</el-form>
</div>
<icp></icp>
</div>
</template>
<script>
import Icp from '../components/common/Icp.vue'
export default {
name: "login",
components: {
Icp
},
data() {
var checkUsername = (rule, value, callback) => {
if (!value) {
@ -162,64 +171,69 @@
<style scoped lang="scss">
.login-view {
position: relative;
display: flex;
justify-content: space-around;
align-items: center;
width: 100%;
height: 100%;
background: rgb(232, 242, 255);
background-size: cover;
box-sizing: border-box;
padding: 10%;
.login-intro {
flex: 1;
padding: 40px;
max-width: 600px;
.login-title {
text-align: center;
font-weight: 600;
font-size: 30px;
}
.login-icons {
display: flex;
align-items: center;
.login-icon {
padding-left: 5px;
.login-content {
position: relative;
display: flex;
justify-content: space-around;
align-items: center;
padding: 10%;
.login-intro {
flex: 1;
padding: 40px;
max-width: 600px;
.login-title {
text-align: center;
font-weight: 600;
font-size: 30px;
}
}
}
.login-form {
height: 340px;
width: 400px;
padding: 30px;
background: white;
opacity: 0.9;
box-shadow: 0px 0px 1px #ccc;
border-radius: 3%;
overflow: hidden;
border: 1px solid #ccc;
.login-brand {
line-height: 50px;
margin: 30px 0 40px 0;
font-size: 22px;
font-weight: 600;
letter-spacing: 2px;
text-transform: uppercase;
text-align: center;
.login-icons {
display: flex;
align-items: center;
.login-icon {
padding-left: 5px;
}
}
}
.register {
display: flex;
flex-direction: row-reverse;
line-height: 40px;
text-align: left;
padding-left: 20px;
.login-form {
height: 340px;
width: 400px;
padding: 30px;
background: white;
opacity: 0.9;
box-shadow: 0px 0px 1px #ccc;
border-radius: 3%;
overflow: hidden;
border: 1px solid #ccc;
.login-brand {
line-height: 50px;
margin: 30px 0 40px 0;
font-size: 22px;
font-weight: 600;
letter-spacing: 2px;
text-transform: uppercase;
text-align: center;
}
.register {
display: flex;
flex-direction: row-reverse;
line-height: 40px;
text-align: left;
padding-left: 20px;
}
}
}
}

6
im-ui/src/view/Register.vue

@ -1,7 +1,6 @@
<template>
<el-container class="register-view">
<div>
<el-form :model="registerForm" status-icon :rules="rules" ref="registerForm" label-width="80px" class="web-ruleForm">
<div class="register-brand">欢迎成为盒子IM的用户</div>
<el-form-item label="用户名" prop="userName">
@ -25,12 +24,17 @@
</div>
</el-form>
</div>
<icp></icp>
</el-container>
</template>
<script>
import Icp from '../components/common/Icp.vue'
export default {
name: "login",
components: {
Icp
},
data() {
var checkUserName = (rule, value, callback) => {
if (!value) {

2
im-uniapp/components/chat-message-item/chat-message-item.vue

@ -7,7 +7,7 @@
<view class="chat-msg-normal" v-if="msgInfo.type>=0 && msgInfo.type<10"
:class="{'chat-msg-mine':msgInfo.selfSend}">
<head-image class="avatar" @longpress="$emit('longPressHead')" :id="msgInfo.sendId" :url="headImage" :name="showName" :size="80"></head-image>
<head-image class="avatar" @longpress.prevent="$emit('longPressHead')" :id="msgInfo.sendId" :url="headImage" :name="showName" :size="80"></head-image>
<view class="chat-msg-content" @longpress="onShowMenu($event)">
<view v-if="msgInfo.groupId && !msgInfo.selfSend" class="chat-msg-top">
<text>{{showName}}</text>

4
im-uniapp/store/chatStore.js

@ -143,13 +143,13 @@ export default {
chat.lastSendTime = msgInfo.sendTime;
chat.sendNickName = msgInfo.sendNickName;
}
// 未读加1
if (!msgInfo.selfSend && msgInfo.status != MESSAGE_STATUS.READED) {
chat.unreadCount++;
}
// 是否有人@我
if(!msgInfo.selfSend && chat.type=="GROUP" && msgInfo.atUserIds){
if(!msgInfo.selfSend && chat.type=="GROUP" && msgInfo.atUserIds
&& msgInfo.status != MESSAGE_STATUS.READED){
let userId = userStore.state.userInfo.id;
if(msgInfo.atUserIds.indexOf(userId)>=0){
chat.atMe = true;

Loading…
Cancel
Save