diff --git a/im-platform/src/main/java/com/bx/implatform/controller/UserController.java b/im-platform/src/main/java/com/bx/implatform/controller/UserController.java index 4d6e06d..685fbfd 100644 --- a/im-platform/src/main/java/com/bx/implatform/controller/UserController.java +++ b/im-platform/src/main/java/com/bx/implatform/controller/UserController.java @@ -36,7 +36,7 @@ public class UserController { @GetMapping("/self") @ApiOperation(value = "获取当前用户信息",notes="获取当前用户信息") - public Result findSelfInfo(){ + public Result findSelfInfo(){ UserSession session = SessionContext.getSession(); User user = userService.getById(session.getUserId()); UserVO userVO = BeanUtils.copyProperties(user,UserVO.class); diff --git a/im-uniapp/App.vue b/im-uniapp/App.vue index 8c2b732..23ee413 100644 --- a/im-uniapp/App.vue +++ b/im-uniapp/App.vue @@ -12,6 +12,5 @@ } - + \ No newline at end of file diff --git a/im-uniapp/common/request.js b/im-uniapp/common/request.js index 9daa3e6..e8e5e77 100644 --- a/im-uniapp/common/request.js +++ b/im-uniapp/common/request.js @@ -1,4 +1,4 @@ -const BASE_URL = "http://127.0.0.1:8888" +const BASE_URL = "http://192.168.43.6:8888" const request = (options) => { const header = options.header||{}; @@ -31,7 +31,7 @@ const request = (options) => { const data = await request({ method: 'PUT', url: '/refreshToken', - headers: { + header: { refreshToken: refreshToken } }) diff --git a/im-uniapp/components/friend-item/friend-item.vue b/im-uniapp/components/friend-item/friend-item.vue new file mode 100644 index 0000000..847abe1 --- /dev/null +++ b/im-uniapp/components/friend-item/friend-item.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/im-uniapp/main.js b/im-uniapp/main.js index 92c0e3c..bbf83ab 100644 --- a/im-uniapp/main.js +++ b/im-uniapp/main.js @@ -1,23 +1,8 @@ import App from './App' import request from './common/request'; import store from './store'; -// #ifndef VUE3 -import Vue from 'vue' -import './uni.promisify.adaptor' - -Vue.prototype.$http = request -console.log(Vue.prototype.$http) -Vue.config.productionTip = false -App.mpType = 'app' -const app = new Vue({ - ...App, - store -}) -app.$mount() -// #endif - -// #ifdef VUE3 import { createSSRApp } from 'vue' + export function createApp() { const app = createSSRApp(App) app.use(store); @@ -26,4 +11,3 @@ export function createApp() { app } } -// #endif \ No newline at end of file diff --git a/im-uniapp/pages.json b/im-uniapp/pages.json index c98ec78..184aa5f 100644 --- a/im-uniapp/pages.json +++ b/im-uniapp/pages.json @@ -1,17 +1,128 @@ { - "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages - { - "path": "pages/login/login", - "style": { - "navigationBarTitleText": "盒子IM" + "pages": [{ + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "盒子IM" + } + }, { + "path": "pages/chat/chat", + "style": { + "navigationBarTitleText": "聊天消息", + + "app-plus": { + "titleNView": { + "buttons": [{ + "text": "", + "fontSrc": "/static/iconfont/iconfont.ttf", + "fontSize": "40rpx" + }, + { + "text": "", + "fontSrc": "/static/iconFont/iconfont.ttf", + "fontSize": "40rpx" + } + ] + } + } + } + }, { + "path": "pages/friend/friend", + "style": { + "navigationBarTitleText": "好友列表", + "enablePullDownRefresh": false, + "app-plus": { + "titleNView": { + "buttons": [{ + "text": "", + "fontSrc": "/static/iconfont/iconfont.ttf", + "fontSize": "40rpx", + "width": "50rpx" + }, + { + "text": "", + "fontSrc": "/static/iconFont/iconfont.ttf", + "fontSize": "30rpx", + "width": "50rpx" + } + ] + } } } - ], + + }, { + "path": "pages/group/group", + "style": { + "navigationBarTitleText": "群聊列表", + "enablePullDownRefresh": false + } + + }, { + "path": "pages/mine/mine", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, { + "path": "pages/friend/friend-search", + "style": { + "app-plus": { + "navigationBarTitleText": "好友查找", + "titleNView": { + "buttons": [{ + "text": "取消", + "fontSize": "20rpx", + "width": "80rpx" + } + + ], + "searchInput": { + "autoFocus": true, + "placeholder": "输入好友昵称", + "borderRadius": "10rpx" + }, + "autoBackButton": false + } + + } + } + },{ + "path": "pages/common/user-info" + }], "globalStyle": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "uni-app", - "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8" + "navigationBarBackgroundColor": "#F0F0F0", + "backgroundColor": "#fdfdfd" + }, + "tabBar": { + "color": "#999999", + "selectedColor": "#09C160", + "borderStyle": "black", + "backgroundColor": "#ffffff", + "list": [{ + "pagePath": "pages/chat/chat", + "iconPath": "static/tarbar/chat.png", + "selectedIconPath": "static/tarbar/chat_active.png", + "text": "消息" + }, + { + "pagePath": "pages/friend/friend", + "iconPath": "static/tarbar/friend.png", + "selectedIconPath": "static/tarbar/friend_active.png", + "text": "好友" + }, + { + "pagePath": "pages/group/group", + "iconPath": "static/tarbar/group.png", + "selectedIconPath": "static/tarbar/group_active.png", + "text": "群聊" + }, + { + "pagePath": "pages/mine/mine", + "iconPath": "static/tarbar/mine.png", + "selectedIconPath": "static/tarbar/mine_active.png", + "text": "我的" + } + ] }, "uniIdRouter": {} -} +} \ No newline at end of file diff --git a/im-uniapp/pages/chat/chat.vue b/im-uniapp/pages/chat/chat.vue new file mode 100644 index 0000000..afa140c --- /dev/null +++ b/im-uniapp/pages/chat/chat.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/im-uniapp/pages/common/user-info.vue b/im-uniapp/pages/common/user-info.vue new file mode 100644 index 0000000..c866b3b --- /dev/null +++ b/im-uniapp/pages/common/user-info.vue @@ -0,0 +1,108 @@ + + + + + \ No newline at end of file diff --git a/im-uniapp/pages/friend/friend-search.vue b/im-uniapp/pages/friend/friend-search.vue new file mode 100644 index 0000000..5a5a929 --- /dev/null +++ b/im-uniapp/pages/friend/friend-search.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/im-uniapp/pages/friend/friend.vue b/im-uniapp/pages/friend/friend.vue new file mode 100644 index 0000000..415f0ac --- /dev/null +++ b/im-uniapp/pages/friend/friend.vue @@ -0,0 +1,68 @@ + + + + + \ No newline at end of file diff --git a/im-uniapp/pages/group/group.vue b/im-uniapp/pages/group/group.vue new file mode 100644 index 0000000..8183fd0 --- /dev/null +++ b/im-uniapp/pages/group/group.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/im-uniapp/pages/index/index.vue b/im-uniapp/pages/index/index.vue deleted file mode 100644 index 6cc614d..0000000 --- a/im-uniapp/pages/index/index.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - \ No newline at end of file diff --git a/im-uniapp/pages/login/login.vue b/im-uniapp/pages/login/login.vue index 10f9c80..c1133d2 100644 --- a/im-uniapp/pages/login/login.vue +++ b/im-uniapp/pages/login/login.vue @@ -54,7 +54,10 @@ uni.setStorageSync("accessToken", data.accessToken); uni.setStorageSync("refreshToken", data.refreshToken); this.$store.dispatch("initStore").then(()=>{ - console.log("成功") + console.log("登录成功,准备跳转...") + uni.switchTab({ + url:"/pages/chat/chat" + }) }) }) diff --git a/im-uniapp/pages/mine/mine.vue b/im-uniapp/pages/mine/mine.vue new file mode 100644 index 0000000..8183fd0 --- /dev/null +++ b/im-uniapp/pages/mine/mine.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/im-uniapp/static/iconfont/iconfont.ttf b/im-uniapp/static/iconfont/iconfont.ttf new file mode 100644 index 0000000..94eaa3b Binary files /dev/null and b/im-uniapp/static/iconfont/iconfont.ttf differ diff --git a/im-uniapp/static/tarbar/chat.png b/im-uniapp/static/tarbar/chat.png new file mode 100644 index 0000000..837284e Binary files /dev/null and b/im-uniapp/static/tarbar/chat.png differ diff --git a/im-uniapp/static/tarbar/chat_active.png b/im-uniapp/static/tarbar/chat_active.png new file mode 100644 index 0000000..a87b39c Binary files /dev/null and b/im-uniapp/static/tarbar/chat_active.png differ diff --git a/im-uniapp/static/tarbar/friend.png b/im-uniapp/static/tarbar/friend.png new file mode 100644 index 0000000..a92a9c6 Binary files /dev/null and b/im-uniapp/static/tarbar/friend.png differ diff --git a/im-uniapp/static/tarbar/friend_active.png b/im-uniapp/static/tarbar/friend_active.png new file mode 100644 index 0000000..d1d821c Binary files /dev/null and b/im-uniapp/static/tarbar/friend_active.png differ diff --git a/im-uniapp/static/tarbar/group.png b/im-uniapp/static/tarbar/group.png new file mode 100644 index 0000000..a7a0a15 Binary files /dev/null and b/im-uniapp/static/tarbar/group.png differ diff --git a/im-uniapp/static/tarbar/group_active.png b/im-uniapp/static/tarbar/group_active.png new file mode 100644 index 0000000..8e31a37 Binary files /dev/null and b/im-uniapp/static/tarbar/group_active.png differ diff --git a/im-uniapp/static/tarbar/mine.png b/im-uniapp/static/tarbar/mine.png new file mode 100644 index 0000000..ab4c7de Binary files /dev/null and b/im-uniapp/static/tarbar/mine.png differ diff --git a/im-uniapp/static/tarbar/mine_active.png b/im-uniapp/static/tarbar/mine_active.png new file mode 100644 index 0000000..ece5717 Binary files /dev/null and b/im-uniapp/static/tarbar/mine_active.png differ diff --git a/im-uniapp/store/groupStore.js b/im-uniapp/store/groupStore.js index f4750d7..6abae22 100644 --- a/im-uniapp/store/groupStore.js +++ b/im-uniapp/store/groupStore.js @@ -45,7 +45,6 @@ export default { }).then((groups) => { context.commit("setGroups", groups); resolve(); - console.log("groupstore") }).catch(() => { reject(); }) diff --git a/im-uniapp/store/index.js b/im-uniapp/store/index.js index acc4a9f..838fe95 100644 --- a/im-uniapp/store/index.js +++ b/im-uniapp/store/index.js @@ -1,25 +1,20 @@ - import chatStore from './chatStore.js'; import friendStore from './friendStore.js'; import userStore from './userStore.js'; import groupStore from './groupStore.js'; import uiStore from './uiStore.js'; - -// #ifndef VUE3 -import Vue from 'vue' -import Vuex from 'vuex' -Vue.use(Vuex) -const store = new Vuex.Store({ -// #endif - -// #ifdef VUE3 -import { createStore } from 'vuex'; - const store = createStore({ -// #endif - modules: {chatStore,friendStore,userStore,groupStore,uiStore}, +import {createStore} from 'vuex'; +const store = createStore({ + modules: { + chatStore, + friendStore, + userStore, + groupStore, + uiStore + }, state: {}, actions: { - initStore(context){ + initStore(context) { const promises = []; promises.push(this.dispatch("initUserStore")); promises.push(this.dispatch("initFriendStore")); @@ -28,6 +23,6 @@ import { createStore } from 'vuex'; } }, strict: true -}); +}) -export default store; +export default store; \ No newline at end of file