-
{{rtcInfo.userInfos.length+'人正在通话中'}}
+
{{ rtcInfo.userInfos.length + '人正在通话中' }}
-
+
@@ -23,67 +22,67 @@
\ No newline at end of file
diff --git a/im-uniapp/components/head-image/head-image.vue b/im-uniapp/components/head-image/head-image.vue
index 5a12ed3..4bc68bf 100644
--- a/im-uniapp/components/head-image/head-image.vue
+++ b/im-uniapp/components/head-image/head-image.vue
@@ -1,9 +1,9 @@
-
+
- {{name?.substring(0,1).toUpperCase()}}
+ {{ name?.substring(0, 1).toUpperCase() }}
@@ -11,110 +11,110 @@
\ No newline at end of file
diff --git a/im-uniapp/components/image-upload/image-upload.vue b/im-uniapp/components/image-upload/image-upload.vue
index de625c3..6cfe9e5 100644
--- a/im-uniapp/components/image-upload/image-upload.vue
+++ b/im-uniapp/components/image-upload/image-upload.vue
@@ -5,89 +5,88 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/im-uniapp/components/loading/loading.vue b/im-uniapp/components/loading/loading.vue
index bc33f11..a56b8ea 100644
--- a/im-uniapp/components/loading/loading.vue
+++ b/im-uniapp/components/loading/loading.vue
@@ -6,59 +6,57 @@
\ No newline at end of file
diff --git a/im-uniapp/components/nav-bar/nav-bar.vue b/im-uniapp/components/nav-bar/nav-bar.vue
index d928939..b2fb631 100644
--- a/im-uniapp/components/nav-bar/nav-bar.vue
+++ b/im-uniapp/components/nav-bar/nav-bar.vue
@@ -11,9 +11,11 @@
-
+
-
+
@@ -85,8 +87,7 @@ export default {
box-sizing: border-box;
height: $im-nav-bar-height;
- .title {
- }
+ .title {}
.back {
position: absolute;
diff --git a/im-uniapp/components/pop-menu/pop-menu.vue b/im-uniapp/components/pop-menu/pop-menu.vue
index e9b2cb4..27a2fe0 100644
--- a/im-uniapp/components/pop-menu/pop-menu.vue
+++ b/im-uniapp/components/pop-menu/pop-menu.vue
@@ -5,117 +5,117 @@
\ No newline at end of file
diff --git a/im-uniapp/main.js b/im-uniapp/main.js
index b47b541..be8e65b 100644
--- a/im-uniapp/main.js
+++ b/im-uniapp/main.js
@@ -27,9 +27,6 @@ import * as recorder from './common/recorder-h5';
// #ifndef H5
import * as recorder from './common/recorder-app';
// #endif
-
-
-
export function createApp() {
const app = createSSRApp(App)
app.use(uviewPlus);
@@ -46,15 +43,15 @@ export function createApp() {
app.config.globalProperties.$date = date;
app.config.globalProperties.$rc = recorder;
// 初始化时再挂载store对象
- app.config.globalProperties.$mountStore = ()=>{
- app.config.globalProperties.chatStore = useChatStore();
- app.config.globalProperties.friendStore = useFriendStore();
- app.config.globalProperties.groupStore = useGroupStore();
- app.config.globalProperties.configStore = useConfigStore();
- app.config.globalProperties.userStore = useUserStore();
+ app.config.globalProperties.$mountStore = () => {
+ app.config.globalProperties.chatStore = useChatStore();
+ app.config.globalProperties.friendStore = useFriendStore();
+ app.config.globalProperties.groupStore = useGroupStore();
+ app.config.globalProperties.configStore = useConfigStore();
+ app.config.globalProperties.userStore = useUserStore();
}
return {
app,
- pinia
+ pinia
}
}
diff --git a/im-uniapp/manifest.json b/im-uniapp/manifest.json
index a0ed444..eb44f57 100644
--- a/im-uniapp/manifest.json
+++ b/im-uniapp/manifest.json
@@ -1,32 +1,32 @@
{
- "name" : "盒子IM",
- "appid" : "__UNI__69DD57A",
- "description" : "",
- "versionName" : "3.1.0",
- "versionCode" : 3100,
- "transformPx" : false,
+ "name": "盒子IM",
+ "appid": "__UNI__69DD57A",
+ "description": "",
+ "versionName": "3.1.0",
+ "versionCode": 3100,
+ "transformPx": false,
/* 5+App特有相关 */
- "app-plus" : {
- "usingComponents" : true,
- "nvueStyleCompiler" : "uni-app",
- "compilerVersion" : 3,
- "splashscreen" : {
- "alwaysShowBeforeRender" : true,
- "waiting" : true,
- "autoclose" : true,
- "delay" : 0
+ "app-plus": {
+ "usingComponents": true,
+ "nvueStyleCompiler": "uni-app",
+ "compilerVersion": 3,
+ "splashscreen": {
+ "alwaysShowBeforeRender": true,
+ "waiting": true,
+ "autoclose": true,
+ "delay": 0
},
/* 模块配置 */
- "modules" : {
- "Camera" : {},
- "Record" : {},
- "Bluetooth" : {}
+ "modules": {
+ "Camera": {},
+ "Record": {},
+ "Bluetooth": {}
},
/* 应用发布信息 */
- "distribute" : {
+ "distribute": {
/* android打包配置 */
- "android" : {
- "permissions" : [
+ "android": {
+ "permissions": [
"",
"",
"",
@@ -45,87 +45,90 @@
"",
""
],
- "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
- "minSdkVersion" : 21
+ "abiFilters": [
+ "armeabi-v7a",
+ "arm64-v8a",
+ "x86"
+ ],
+ "minSdkVersion": 21
},
/* ios打包配置 */
- "ios" : {
- "dSYMs" : false,
- "privacyDescription" : {
- "NSMicrophoneUsageDescription" : "",
- "NSCameraUsageDescription" : ""
+ "ios": {
+ "dSYMs": false,
+ "privacyDescription": {
+ "NSMicrophoneUsageDescription": "",
+ "NSCameraUsageDescription": ""
},
- "idfa" : false
+ "idfa": false
},
/* SDK配置 */
- "sdkConfigs" : {
- "ad" : {},
- "speech" : {}
+ "sdkConfigs": {
+ "ad": {},
+ "speech": {}
},
- "icons" : {
- "android" : {
- "xhdpi" : "unpackage/res/icons/96x96.png",
- "hdpi" : "unpackage/res/icons/72x72.png",
- "xxhdpi" : "unpackage/res/icons/144x144.png",
- "xxxhdpi" : "unpackage/res/icons/192x192.png"
+ "icons": {
+ "android": {
+ "xhdpi": "unpackage/res/icons/96x96.png",
+ "hdpi": "unpackage/res/icons/72x72.png",
+ "xxhdpi": "unpackage/res/icons/144x144.png",
+ "xxxhdpi": "unpackage/res/icons/192x192.png"
},
- "ios" : {
- "appstore" : "unpackage/res/icons/1024x1024.png",
- "ipad" : {
- "app" : "unpackage/res/icons/76x76.png",
- "app@2x" : "unpackage/res/icons/152x152.png",
- "notification" : "unpackage/res/icons/20x20.png",
- "notification@2x" : "unpackage/res/icons/40x40.png",
- "proapp@2x" : "unpackage/res/icons/167x167.png",
- "settings" : "unpackage/res/icons/29x29.png",
- "settings@2x" : "unpackage/res/icons/58x58.png",
- "spotlight" : "unpackage/res/icons/40x40.png",
- "spotlight@2x" : "unpackage/res/icons/80x80.png"
+ "ios": {
+ "appstore": "unpackage/res/icons/1024x1024.png",
+ "ipad": {
+ "app": "unpackage/res/icons/76x76.png",
+ "app@2x": "unpackage/res/icons/152x152.png",
+ "notification": "unpackage/res/icons/20x20.png",
+ "notification@2x": "unpackage/res/icons/40x40.png",
+ "proapp@2x": "unpackage/res/icons/167x167.png",
+ "settings": "unpackage/res/icons/29x29.png",
+ "settings@2x": "unpackage/res/icons/58x58.png",
+ "spotlight": "unpackage/res/icons/40x40.png",
+ "spotlight@2x": "unpackage/res/icons/80x80.png"
},
- "iphone" : {
- "app@2x" : "unpackage/res/icons/120x120.png",
- "app@3x" : "unpackage/res/icons/180x180.png",
- "notification@2x" : "unpackage/res/icons/40x40.png",
- "notification@3x" : "unpackage/res/icons/60x60.png",
- "settings@2x" : "unpackage/res/icons/58x58.png",
- "settings@3x" : "unpackage/res/icons/87x87.png",
- "spotlight@2x" : "unpackage/res/icons/80x80.png",
- "spotlight@3x" : "unpackage/res/icons/120x120.png"
+ "iphone": {
+ "app@2x": "unpackage/res/icons/120x120.png",
+ "app@3x": "unpackage/res/icons/180x180.png",
+ "notification@2x": "unpackage/res/icons/40x40.png",
+ "notification@3x": "unpackage/res/icons/60x60.png",
+ "settings@2x": "unpackage/res/icons/58x58.png",
+ "settings@3x": "unpackage/res/icons/87x87.png",
+ "spotlight@2x": "unpackage/res/icons/80x80.png",
+ "spotlight@3x": "unpackage/res/icons/120x120.png"
}
}
}
}
},
/* 快应用特有相关 */
- "quickapp" : {},
+ "quickapp": {},
/* 小程序特有相关 */
- "mp-weixin" : {
- "appid" : "wxda94f40bfad0262c",
- "libVersion" : "latest",
- "setting" : {
- "urlCheck" : false
+ "mp-weixin": {
+ "appid": "wxda94f40bfad0262c",
+ "libVersion": "latest",
+ "setting": {
+ "urlCheck": false
},
- "usingComponents" : true
+ "usingComponents": true
},
- "mp-alipay" : {
- "usingComponents" : true
+ "mp-alipay": {
+ "usingComponents": true
},
- "mp-baidu" : {
- "usingComponents" : true
+ "mp-baidu": {
+ "usingComponents": true
},
- "mp-toutiao" : {
- "usingComponents" : true
+ "mp-toutiao": {
+ "usingComponents": true
},
- "uniStatistics" : {
- "enable" : false
+ "uniStatistics": {
+ "enable": false
},
- "vueVersion" : "3",
- "h5" : {
- "title" : "盒子IM",
- "router" : {
- "base" : "/h5/"
+ "vueVersion": "3",
+ "h5": {
+ "title": "盒子IM",
+ "router": {
+ "base": "/h5/"
}
}
}
-/* ios打包配置 *//* SDK配置 */
-
+/* ios打包配置 */ /* SDK配置 */
\ No newline at end of file
diff --git a/im-uniapp/package.json b/im-uniapp/package.json
index f4368f4..2ada879 100644
--- a/im-uniapp/package.json
+++ b/im-uniapp/package.json
@@ -8,4 +8,4 @@
"pinyin-pro": "^3.23.1",
"vconsole": "^3.15.1"
}
-}
+}
\ No newline at end of file
diff --git a/im-uniapp/pages.json b/im-uniapp/pages.json
index 1f9613c..c6c64f2 100644
--- a/im-uniapp/pages.json
+++ b/im-uniapp/pages.json
@@ -1,47 +1,64 @@
{
"easycom": {
- "autoscan": true,
- "custom": {
- "^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
- "^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
- "^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue"
- }
+ "autoscan": true,
+ "custom": {
+ "^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
+ "^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
+ "^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue"
+ }
+ },
+ "pages": [
+ {
+ "path": "pages/login/login"
+ },
+ {
+ "path": "pages/register/register"
+ },
+ {
+ "path": "pages/chat/chat"
+ },
+ {
+ "path": "pages/friend/friend"
+ },
+ {
+ "path": "pages/group/group"
+ },
+ {
+ "path": "pages/mine/mine"
+ },
+ {
+ "path": "pages/common/user-info"
+ },
+ {
+ "path": "pages/chat/chat-box"
},
- "pages": [{
- "path": "pages/login/login"
- }, {
- "path" : "pages/register/register"
- },{
- "path": "pages/chat/chat"
- }, {
- "path": "pages/friend/friend"
- }, {
- "path": "pages/group/group"
- }, {
- "path": "pages/mine/mine"
- }, {
- "path": "pages/common/user-info"
- }, {
- "path": "pages/chat/chat-box"
- },{
- "path": "pages/chat/chat-private-video"
- },{
- "path": "pages/chat/chat-group-video"
- }, {
- "path": "pages/friend/friend-add"
- }, {
- "path": "pages/group/group-info"
- }, {
- "path": "pages/group/group-edit"
- }, {
- "path": "pages/group/group-invite"
- }, {
- "path": "pages/group/group-member"
- }, {
- "path": "pages/mine/mine-edit"
- },{
- "path": "pages/mine/mine-password"
- }
+ {
+ "path": "pages/chat/chat-private-video"
+ },
+ {
+ "path": "pages/chat/chat-group-video"
+ },
+ {
+ "path": "pages/friend/friend-add"
+ },
+ {
+ "path": "pages/group/group-info"
+ },
+ {
+ "path": "pages/group/group-edit"
+ },
+ {
+ "path": "pages/group/group-invite"
+ },
+ {
+ "path": "pages/group/group-member"
+ },
+ {
+ "path": "pages/mine/mine-edit"
+ },
+ {
+ "path": "pages/mine/mine-password"
+ }
],
"globalStyle": {
"navigationStyle": "custom",
@@ -53,12 +70,12 @@
"selectedColor": "#587ff0",
"borderStyle": "black",
"backgroundColor": "#ffffff",
- "list": [{
+ "list": [
+ {
"pagePath": "pages/chat/chat",
"iconPath": "static/tarbar/chat.png",
"selectedIconPath": "static/tarbar/chat_active.png",
"text": "消息"
-
},
{
"pagePath": "pages/friend/friend",
diff --git a/im-uniapp/pages/chat/chat-box.vue b/im-uniapp/pages/chat/chat-box.vue
index ab8c7e2..add8199 100644
--- a/im-uniapp/pages/chat/chat-box.vue
+++ b/im-uniapp/pages/chat/chat-box.vue
@@ -1,21 +1,21 @@
- {{title}}
-
+ {{ title }}
+
-
-
+
+
+ :id="'chat-item-' + idx" :msgInfo="msgInfo" :groupMembers="groupMembers">
-
+
:
-
+
@@ -29,19 +29,20 @@
-
+
-
+
-
-
+
语音消息
-
+
回执消息
@@ -90,7 +91,7 @@
-
+
\ No newline at end of file
diff --git a/im-uniapp/pages/chat/chat-group-video.vue b/im-uniapp/pages/chat/chat-group-video.vue
index b8a4314..7bb7314 100644
--- a/im-uniapp/pages/chat/chat-group-video.vue
+++ b/im-uniapp/pages/chat/chat-group-video.vue
@@ -3,137 +3,137 @@
\ No newline at end of file
diff --git a/im-uniapp/pages/chat/chat-private-video.vue b/im-uniapp/pages/chat/chat-private-video.vue
index 60d217d..0677af7 100644
--- a/im-uniapp/pages/chat/chat-private-video.vue
+++ b/im-uniapp/pages/chat/chat-private-video.vue
@@ -3,101 +3,98 @@
\ No newline at end of file
diff --git a/im-uniapp/pages/chat/chat.vue b/im-uniapp/pages/chat/chat.vue
index 692bdc9..d019574 100644
--- a/im-uniapp/pages/chat/chat.vue
+++ b/im-uniapp/pages/chat/chat.vue
@@ -1,6 +1,6 @@
- 消息
+ 消息
消息接收中...
@@ -11,15 +11,13 @@
-
- 温馨提示:您现在还没有任何聊天消息,快跟您的好友发起聊天吧~
+
+ 温馨提示:您现在还没有任何聊天消息,快跟您的好友发起聊天吧~
-
-
-
+
+
+
@@ -27,131 +25,130 @@
\ No newline at end of file
diff --git a/im-uniapp/pages/common/user-info.vue b/im-uniapp/pages/common/user-info.vue
index bd17dce..c226c63 100644
--- a/im-uniapp/pages/common/user-info.vue
+++ b/im-uniapp/pages/common/user-info.vue
@@ -9,17 +9,17 @@
- {{userInfo.userName}}
+ {{ userInfo.userName }}
-
-
+
+
昵称:
- {{userInfo.nickName}}
+ {{ userInfo.nickName }}
@@ -28,7 +28,7 @@
签名:
- {{userInfo.signature}}
+ {{ userInfo.signature }}
@@ -45,174 +45,174 @@
\ No newline at end of file
diff --git a/im-uniapp/pages/friend/friend-add.vue b/im-uniapp/pages/friend/friend-add.vue
index 41e3988..15231f0 100644
--- a/im-uniapp/pages/friend/friend-add.vue
+++ b/im-uniapp/pages/friend/friend-add.vue
@@ -1,19 +1,19 @@
- 添加好友
+ 添加好友
-
-
-
+
+
+
-
- {{ user.nickName}}
+
+ {{ user.nickName }}
@@ -27,91 +27,92 @@
\ No newline at end of file
diff --git a/im-uniapp/pages/friend/friend.vue b/im-uniapp/pages/friend/friend.vue
index 46331b1..736674a 100644
--- a/im-uniapp/pages/friend/friend.vue
+++ b/im-uniapp/pages/friend/friend.vue
@@ -1,146 +1,150 @@
- 好友
+
+ 好友
-
+
-
+
温馨提示:您现在还没有任何好友,快点击右上方'+'按钮添加好友吧~
-
-
+
+
-
-
+
+
-
\ No newline at end of file
diff --git a/im-uniapp/pages/group/group-edit.vue b/im-uniapp/pages/group/group-edit.vue
index 62a7136..1b5f6e8 100644
--- a/im-uniapp/pages/group/group-edit.vue
+++ b/im-uniapp/pages/group/group-edit.vue
@@ -1,156 +1,157 @@
- 修改群资料
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ 修改群资料
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/im-uniapp/pages/group/group-info.vue b/im-uniapp/pages/group/group-info.vue
index 51c0584..9944bd4 100644
--- a/im-uniapp/pages/group/group-info.vue
+++ b/im-uniapp/pages/group/group-info.vue
@@ -1,14 +1,14 @@
- 群聊信息
-
+ 群聊信息
+
-
-
+
+
+ :online="member.online">
- {{member.showNickName}}
+ {{ member.showNickName }}
@@ -16,38 +16,37 @@
- {{`查看全部群成员${groupMembers.length}人`}}>
+ {{ `查看全部群成员${groupMembers.length}人` }}>
- {{group.name}}
+ {{ group.name }}
- {{ownerName}}
+ {{ ownerName }}
-
- {{group.remarkGroupName}}
+ {{ group.remarkGroupName }}
- {{group.showNickName}}
+ {{ group.showNickName }}
- 修改群聊资料 >
+ 修改群聊资料 >
-
+
@@ -55,213 +54,213 @@
\ No newline at end of file
diff --git a/im-uniapp/pages/group/group-invite.vue b/im-uniapp/pages/group/group-invite.vue
index 25fbb8f..a5a6db3 100644
--- a/im-uniapp/pages/group/group-invite.vue
+++ b/im-uniapp/pages/group/group-invite.vue
@@ -1,166 +1,165 @@
-
-
-
-
-
+
+
+
+
+
-
-
-
- {{ friend.nickName}}
-
-
-
+
+
+ {{ friend.nickName }}
-
+
\ No newline at end of file
diff --git a/im-uniapp/pages/group/group-member.vue b/im-uniapp/pages/group/group-member.vue
index f680e23..d90a813 100644
--- a/im-uniapp/pages/group/group-member.vue
+++ b/im-uniapp/pages/group/group-member.vue
@@ -1,27 +1,27 @@
-
- 群成员
-
-
-
-
-
+
+ 群成员
+
+
+
+
+
-
-
- {{ member.showNickName}}
-
-
-
+
+ {{ member.showNickName }}
+
+
+
+ @click.stop="onKickOut(member, idx)">移出群聊
@@ -31,128 +31,128 @@
\ No newline at end of file
diff --git a/im-uniapp/pages/group/group.vue b/im-uniapp/pages/group/group.vue
index 2bb1d19..1242d84 100644
--- a/im-uniapp/pages/group/group.vue
+++ b/im-uniapp/pages/group/group.vue
@@ -1,19 +1,19 @@
- 群聊
+ 群聊
-
+
温馨提示:您现在还没有加入任何群聊,点击右上方'+'按钮可以创建群聊哦~
-
@@ -22,52 +22,51 @@
\ No newline at end of file
diff --git a/im-uniapp/pages/login/login.vue b/im-uniapp/pages/login/login.vue
index 7d7162b..b8e5faf 100644
--- a/im-uniapp/pages/login/login.vue
+++ b/im-uniapp/pages/login/login.vue
@@ -6,7 +6,7 @@
-
+
@@ -17,85 +17,85 @@
\ No newline at end of file
diff --git a/im-uniapp/pages/mine/mine-edit.vue b/im-uniapp/pages/mine/mine-edit.vue
index 08247a8..8fda220 100644
--- a/im-uniapp/pages/mine/mine-edit.vue
+++ b/im-uniapp/pages/mine/mine-edit.vue
@@ -1,81 +1,81 @@
- 修改我的信息
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 修改我的信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/im-uniapp/pages/mine/mine-password.vue b/im-uniapp/pages/mine/mine-password.vue
index e66e267..a029d15 100644
--- a/im-uniapp/pages/mine/mine-password.vue
+++ b/im-uniapp/pages/mine/mine-password.vue
@@ -1,102 +1,101 @@
- 修改密码
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 修改密码
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/im-uniapp/pages/mine/mine.vue b/im-uniapp/pages/mine/mine.vue
index f8876aa..c863fda 100644
--- a/im-uniapp/pages/mine/mine.vue
+++ b/im-uniapp/pages/mine/mine.vue
@@ -1,45 +1,41 @@
- 我的
-
-
-
-
-
-
- {{userInfo.userName}}
-
-
-
-
-
-
- 昵称:
-
-
- {{userInfo.nickName}}
-
-
-
-
-
- 签名:
-
-
- {{userInfo.signature}}
-
-
-
-
-
-
-
-
-
+ 我的
+
+
+
+
+
+
+ {{ userInfo.userName }}
+
+
+
+
+
+
+ 昵称:
+
+
+ {{ userInfo.nickName }}
+
+
+
+
+
+ 签名:
+
+
+ {{ userInfo.signature }}
+
+
+
+
+
+
+
+
+
@@ -50,102 +46,104 @@
diff --git a/im-uniapp/pages/register/register.vue b/im-uniapp/pages/register/register.vue
index fb85e2e..2061ff8 100644
--- a/im-uniapp/pages/register/register.vue
+++ b/im-uniapp/pages/register/register.vue
@@ -16,128 +16,128 @@
-
+
返回登陆页面
\ No newline at end of file
diff --git a/im-uniapp/store/chatStore.js b/im-uniapp/store/chatStore.js
index e85cd24..da631dc 100644
--- a/im-uniapp/store/chatStore.js
+++ b/im-uniapp/store/chatStore.js
@@ -86,7 +86,7 @@ export default defineStore('chatStore', {
this.saveToStorage();
}
}
-
+
},
readedMessage(pos) {
let chat = this.findChatByFriend(pos.friendId);
@@ -99,7 +99,7 @@ export default defineStore('chatStore', {
}
}
})
- if(!chat.stored){
+ if (!chat.stored) {
this.saveToStorage();
}
},
@@ -293,7 +293,7 @@ export default defineStore('chatStore', {
}
},
refreshChats() {
- if(!cacheChats){
+ if (!cacheChats) {
return;
}
// 排序
@@ -316,18 +316,18 @@ export default defineStore('chatStore', {
let key = "chats-app-" + userId;
let chatKeys = [];
// 按会话为单位存储,只存储有改动的会话
- this.chats.forEach((chat)=>{
+ this.chats.forEach((chat) => {
let chatKey = `${key}-${chat.type}-${chat.targetId}`
- if(!chat.stored){
- if(chat.delete){
+ if (!chat.stored) {
+ if (chat.delete) {
uni.removeStorageSync(chatKey);
- }else{
- uni.setStorageSync(chatKey,chat);
+ } else {
+ uni.setStorageSync(chatKey, chat);
}
chat.stored = true;
}
- if(!chat.delete){
- chatKeys.push(chatKey);
+ if (!chat.delete) {
+ chatKeys.push(chatKey);
}
})
// 会话核心信息
@@ -353,15 +353,15 @@ export default defineStore('chatStore', {
let userStore = useUserStore();
let userId = userStore.userInfo.id;
let chatsData = uni.getStorageSync("chats-app-" + userId)
- if(chatsData){
- if(chatsData.chatKeys){
+ if (chatsData) {
+ if (chatsData.chatKeys) {
let time = new Date().getTime();
chatsData.chats = [];
- chatsData.chatKeys.forEach(key=>{
+ chatsData.chatKeys.forEach(key => {
let chat = uni.getStorageSync(key);
- if(chat){
+ if (chat) {
chatsData.chats.push(chat);
- }
+ }
})
}
this.initChats(chatsData);
@@ -375,7 +375,7 @@ export default defineStore('chatStore', {
return state.loadingPrivateMsg || state.loadingGroupMsg
},
curChats: (state) => {
- if(cacheChats && state.isLoading()){
+ if (cacheChats && state.isLoading()) {
return cacheChats;
}
return state.chats;
diff --git a/im-uniapp/store/userStore.js b/im-uniapp/store/userStore.js
index 0023d63..168fc1b 100644
--- a/im-uniapp/store/userStore.js
+++ b/im-uniapp/store/userStore.js
@@ -14,7 +14,7 @@ export default defineStore('userStore', {
clear() {
this.userInfo = {};
},
- loadUser(context) {
+ loadUser() {
return new Promise((resolve, reject) => {
http({
url: '/user/self',
diff --git a/im-uniapp/vite.config.js b/im-uniapp/vite.config.js
index d337d8c..8f10427 100644
--- a/im-uniapp/vite.config.js
+++ b/im-uniapp/vite.config.js
@@ -1,7 +1,5 @@
import { defineConfig } from "vite"
import uni from "@dcloudio/vite-plugin-uni";
-const path = require('path')
-const fs = require('fs')
export default defineConfig({
plugins: [
uni()
diff --git a/im-web/src/view/Login.vue b/im-web/src/view/Login.vue
index 33fef81..b44c354 100644
--- a/im-web/src/view/Login.vue
+++ b/im-web/src/view/Login.vue
@@ -29,7 +29,6 @@