diff --git a/pages/chat/chat.vue b/pages/chat/chat.vue index 8f3c7629715208125c1c8a1512aa7cb1eb1adfa9..6411f5e7a4e42c8737942bfd8f1feb6e481edf6c 100644 --- a/pages/chat/chat.vue +++ b/pages/chat/chat.vue @@ -411,18 +411,19 @@ setTimeout(() => { this.$refs["chat-input"]?.focus() }, 100) - } - const {is_temp,friend_uid} = this.conversation - if(is_temp && friend_uid){ - // 为了避免在web端刷新页面之后,本地单聊临时会话丢失,将地址栏中的会话id参数替换为好友的uid,以此来确保在刷新页面之后,本地能够再次创建临时会话。 - const {route:path,options} = getCurrentPages().pop() - delete options.conversation_id - options.user_id = friend_uid - let paramSrt - for (const key in options) { - paramSrt = `${key}=${options[key]}` + }else{ + const {is_temp,friend_uid} = this.conversation + if(is_temp && friend_uid){ + // 为了避免在web端刷新页面之后,本地单聊临时会话丢失,将地址栏中的会话id参数替换为好友的uid,以此来确保在刷新页面之后,本地能够再次创建临时会话。 + const {route:path,options} = getCurrentPages().pop() + delete options.conversation_id + options.user_id = friend_uid + let paramSrt + for (const key in options) { + paramSrt = `${key}=${options[key]}` + } + history.replaceState(null, '', `/#/${path}?${paramSrt}`) } - history.replaceState(null, '', `/#/${path}?${paramSrt}`) } // #endif },