-
@@ -67,7 +67,7 @@
type: 1
}
this.$http({
- url: '/api/message/private/send',
+ url: '/message/private/send',
method: 'post',
data: msgInfo
}).then((data) => {
@@ -126,7 +126,7 @@
type: 2
}
this.$http({
- url: '/api/message/private/send',
+ url: '/message/private/send',
method: 'post',
data: msgInfo
}).then(() => {
@@ -180,7 +180,7 @@
type: 0
}
this.$http({
- url: '/api/message/private/send',
+ url: '/message/private/send',
method: 'post',
data: msgInfo
}).then((data) => {
@@ -212,6 +212,12 @@
computed: {
mine() {
return this.$store.state.userStore.userInfo;
+ },
+ imageAction(){
+ return `${process.env.VUE_APP_BASE_API}/image/upload`;
+ },
+ fileAction(){
+ return `${process.env.VUE_APP_BASE_API}/file/upload`;
}
},
mounted() {
diff --git a/im-ui/src/components/common/HeadImage.vue b/im-ui/src/components/common/HeadImage.vue
index bd9d16a..71e0827 100644
--- a/im-ui/src/components/common/HeadImage.vue
+++ b/im-ui/src/components/common/HeadImage.vue
@@ -28,7 +28,7 @@
showUserInfo(e){
if(this.id && this.id>0){
this.$http({
- url: `/api/user/find/${this.id}`,
+ url: `/user/find/${this.id}`,
method: 'get'
}).then((user) => {
this.$store.commit("setUserInfoBoxPos",e);
diff --git a/im-ui/src/components/common/UserInfo.vue b/im-ui/src/components/common/UserInfo.vue
index f6c35a8..70bd364 100644
--- a/im-ui/src/components/common/UserInfo.vue
+++ b/im-ui/src/components/common/UserInfo.vue
@@ -63,7 +63,7 @@
},
handleAddFriend() {
this.$http({
- url: "/api/friend/add",
+ url: "/friend/add",
method: "post",
params: {
friendId: this.user.id
diff --git a/im-ui/src/components/friend/AddFriend.vue b/im-ui/src/components/friend/AddFriend.vue
index 65ce74a..752cdb3 100644
--- a/im-ui/src/components/friend/AddFriend.vue
+++ b/im-ui/src/components/friend/AddFriend.vue
@@ -45,7 +45,7 @@
},
handleSearch() {
this.$http({
- url: "/api/user/findByNickName",
+ url: "/user/findByNickName",
method: "get",
params: {
nickName: this.searchText
@@ -56,7 +56,7 @@
},
handleAddFriend(user){
this.$http({
- url: "/api/friend/add",
+ url: "/friend/add",
method: "post",
params: {
friendId: user.id
diff --git a/im-ui/src/components/group/AddGroupMember.vue b/im-ui/src/components/group/AddGroupMember.vue
index 705d60c..a0d1c6c 100644
--- a/im-ui/src/components/group/AddGroupMember.vue
+++ b/im-ui/src/components/group/AddGroupMember.vue
@@ -64,7 +64,7 @@
})
if (inviteVO.friendIds.length > 0) {
this.$http({
- url: "/api/group/invite",
+ url: "/group/invite",
method: 'post',
data: inviteVO
}).then(() => {
diff --git a/im-ui/src/components/setting/Setting.vue b/im-ui/src/components/setting/Setting.vue
index 748cf70..8441b71 100644
--- a/im-ui/src/components/setting/Setting.vue
+++ b/im-ui/src/components/setting/Setting.vue
@@ -3,7 +3,7 @@
{
@@ -94,11 +94,16 @@
type: Boolean
}
},
+ computed:{
+ imageAction(){
+ return `${process.env.VUE_APP_BASE_API}/image/upload`;
+ }
+ },
mounted() {
- this.userInfo = this.$store.state.userStore.userInfo;
- console.log(this.userInfo)
+ // 深拷贝
+ let mine = this.$store.state.userStore.userInfo;
+ this.userInfo = JSON.parse(JSON.stringify(mine));
}
-
}
diff --git a/im-ui/src/store/friendStore.js b/im-ui/src/store/friendStore.js
index 1937d0d..20ebeaf 100644
--- a/im-ui/src/store/friendStore.js
+++ b/im-ui/src/store/friendStore.js
@@ -10,7 +10,7 @@ export default {
mutations: {
initFriendStore(state) {
httpRequest({
- url: '/api/friend/list',
+ url: '/friend/list',
method: 'get'
}).then((friends) => {
this.commit("setFriends",friends);
@@ -48,7 +48,7 @@ export default {
}
state.friends.forEach((f)=>{userIds.push(f.id)});
httpRequest({
- url: '/api/user/online',
+ url: '/user/online',
method: 'get',
params: {userIds: userIds.join(',')}
}).then((onlineIds) => {
diff --git a/im-ui/src/store/groupStore.js b/im-ui/src/store/groupStore.js
index 91baacd..36e0bdc 100644
--- a/im-ui/src/store/groupStore.js
+++ b/im-ui/src/store/groupStore.js
@@ -9,7 +9,7 @@ export default {
mutations: {
initGroupStore(state) {
httpRequest({
- url: '/api/group/list',
+ url: '/group/list',
method: 'get'
}).then((groups) => {
this.commit("setGroups",groups);
diff --git a/im-ui/src/store/userStore.js b/im-ui/src/store/userStore.js
index 4ad45bd..e7497b3 100644
--- a/im-ui/src/store/userStore.js
+++ b/im-ui/src/store/userStore.js
@@ -11,7 +11,7 @@ export default {
console.log("用户切换")
this.commit("resetChatStore");
}
- state.userInfo = userInfo;
+ state.userInfo = Object.assign(state.userInfo, userInfo);
}
}
diff --git a/im-ui/src/view/Chat.vue b/im-ui/src/view/Chat.vue
index 0a90070..ab31ca7 100644
--- a/im-ui/src/view/Chat.vue
+++ b/im-ui/src/view/Chat.vue
@@ -66,7 +66,7 @@
type: 0
}
this.$http({
- url: '/api/message/group/send',
+ url: '/message/group/send',
method: 'post',
data: msgInfo
}).then((data) => {
@@ -86,7 +86,7 @@
// 获取对方最新信息
let userId = chat.targetId;
this.$http({
- url: `/api/user/find/${userId}`,
+ url: `/user/find/${userId}`,
method: 'get'
}).then((user) => {
// 如果发现好友的头像和昵称改了,进行更新
@@ -104,7 +104,7 @@
headImage: user.headImageThumb
};
this.$http({
- url: "/api/friend/update",
+ url: "/friend/update",
method: "put",
data: friendInfo
}).then(() => {
diff --git a/im-ui/src/view/Friend.vue b/im-ui/src/view/Friend.vue
index 72a6105..33e9217 100644
--- a/im-ui/src/view/Friend.vue
+++ b/im-ui/src/view/Friend.vue
@@ -84,7 +84,7 @@
type: 'warning'
}).then(() => {
this.$http({
- url: `/api/friend/delete/${friend.id}`,
+ url: `/friend/delete/${friend.id}`,
method: 'delete'
}).then((data) => {
this.$message.success("删除好友成功");
@@ -117,7 +117,7 @@
friend.headImage = user.headImageThumb;
friend.nickName = user.nickName;
this.$http({
- url: "/api/friend/update",
+ url: "/friend/update",
method: "put",
data: friend
}).then(() => {
@@ -127,7 +127,7 @@
},
loadUserInfo(friend,index){
this.$http({
- url: `/api/user/find/${friend.id}`,
+ url: `/user/find/${friend.id}`,
method: 'get'
}).then((user) => {
this.userInfo = user;
diff --git a/im-ui/src/view/Group.vue b/im-ui/src/view/Group.vue
index f453319..249fb4e 100644
--- a/im-ui/src/view/Group.vue
+++ b/im-ui/src/view/Group.vue
@@ -26,7 +26,7 @@
-
@@ -119,7 +119,7 @@
inputErrorMessage: '请输入群聊名称'
}).then((o) => {
this.$http({
- url: `/api/group/create?groupName=${o.value}`,
+ url: `/group/create?groupName=${o.value}`,
method: 'post'
}).then((group) => {
this.$store.commit("addGroup", group);
@@ -148,7 +148,7 @@
if (valid) {
let vo = this.activeGroup;
this.$http({
- url: "/api/group/modify",
+ url: "/group/modify",
method: "put",
data: vo
}).then((group) => {
@@ -165,7 +165,7 @@
type: 'warning'
}).then(() => {
this.$http({
- url: `/api/group/delete/${this.activeGroup.id}`,
+ url: `/group/delete/${this.activeGroup.id}`,
method: 'delete'
}).then(() => {
this.$store.commit("removeGroup", this.activeGroup.id);
@@ -182,7 +182,7 @@
type: 'warning'
}).then(() => {
this.$http({
- url: `/api/group/kick/${this.activeGroup.id}`,
+ url: `/group/kick/${this.activeGroup.id}`,
method: 'delete',
params: {
userId: member.userId
@@ -201,7 +201,7 @@
type: 'warning'
}).then(() => {
this.$http({
- url: `/api/group/quit/${this.activeGroup.id}`,
+ url: `/group/quit/${this.activeGroup.id}`,
method: 'delete'
}).then(() => {
this.$store.commit("removeGroup", this.activeGroup.id);
@@ -224,7 +224,7 @@
},
loadGroupMembers() {
this.$http({
- url: `/api/group/members/${this.activeGroup.id}`,
+ url: `/group/members/${this.activeGroup.id}`,
method: "get"
}).then((members) => {
this.groupMembers = members;
@@ -241,6 +241,9 @@
},
isOwner() {
return this.activeGroup.ownerId == this.$store.state.userStore.userInfo.id;
+ },
+ imageAction(){
+ return `${process.env.VUE_APP_BASE_API}/image/upload`;
}
},
mounted() {
diff --git a/im-ui/src/view/Home.vue b/im-ui/src/view/Home.vue
index 3b2b92f..f654c7d 100644
--- a/im-ui/src/view/Home.vue
+++ b/im-ui/src/view/Home.vue
@@ -68,7 +68,7 @@
init(userInfo) {
this.$store.commit("setUserInfo", userInfo);
this.$store.commit("initStore");
- this.$wsApi.createWebSocket("ws://localhost:8878/im", this.$store);
+ this.$wsApi.createWebSocket(process.env.VUE_APP_WS_URL, this.$store);
this.$wsApi.onopen(() => {
this.pullUnreadMessage();
});
@@ -92,12 +92,12 @@
pullUnreadMessage() {
// 拉取未读私聊消息
this.$http({
- url: "/api/message/private/pullUnreadMessage",
+ url: "/message/private/pullUnreadMessage",
method: 'post'
});
// 拉取未读群聊消息
this.$http({
- url: "/api/message/group/pullUnreadMessage",
+ url: "/message/group/pullUnreadMessage",
method: 'post'
});
},
@@ -110,7 +110,7 @@
}
// 好友列表不存在好友信息,则发请求获取好友信息
this.$http({
- url: `/api/friend/find/${msg.sendId}`,
+ url: `/friend/find/${msg.sendId}`,
method: 'get'
}).then((friend) => {
this.insertPrivateMessage(friend, msg);
@@ -138,7 +138,7 @@
}
// 群聊缓存存在,直接插入群聊消息
this.$http({
- url: `/api/group/find/${msg.groupId}`,
+ url: `/group/find/${msg.groupId}`,
method: 'get'
}).then((group) => {
this.insertGroupMessage(group, msg);
@@ -159,7 +159,7 @@
},
handleExit() {
this.$http({
- url: "/api/logout",
+ url: "/logout",
method: 'get'
}).then(() => {
this.$wsApi.closeWebSocket();
@@ -180,7 +180,7 @@
},
mounted() {
this.$http({
- url: "/api/user/self",
+ url: "/user/self",
methods: 'get'
}).then((userInfo) => {
this.init(userInfo);
diff --git a/im-ui/src/view/Login.vue b/im-ui/src/view/Login.vue
index 3ada321..5b69360 100644
--- a/im-ui/src/view/Login.vue
+++ b/im-ui/src/view/Login.vue
@@ -63,7 +63,7 @@
this.$refs[formName].validate((valid) => {
if (valid) {
this.$http({
- url: "/api/login",
+ url: "/login",
method: 'post',
params: this.loginForm
})
diff --git a/im-ui/src/view/Register.vue b/im-ui/src/view/Register.vue
index a51d805..00d942f 100644
--- a/im-ui/src/view/Register.vue
+++ b/im-ui/src/view/Register.vue
@@ -95,7 +95,7 @@
this.$refs[formName].validate((valid) => {
if (valid) {
this.$http({
- url: "/api/register",
+ url: "/register",
method: 'post',
data: this.registerForm
})
diff --git a/pom.xml b/pom.xml
index 653000f..59570e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,28 +15,10 @@
commom
-
-
- org.projectlombok
- lombok
- 1.18.16
-
-
- cn.hutool
- hutool-all
-
-
-
- com.alibaba
- fastjson
-
-
- org.apache.commons
- commons-lang3
-
-
-
+ 1.8
+ 1.8
+ 1.8
UTF-8
UTF-8
1.8