Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 新增语音、图片、文件、图标头像封装等 #72

Closed
wants to merge 0 commits into from

Conversation

oljc
Copy link
Contributor

@oljc oljc commented Jul 1, 2023

🤔 这个变动的性质是? (至少选中一项)

  • 日常 bug 修复
  • 新特性提交
  • 组件样式/交互改进
  • 重构
  • 代码风格优化
  • 包体积优化
  • 性能优化
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

#66
Mobile UI

💡 需求背景和解决方案

📝 更新日志

image image
语言 更新描述
🇺🇸 英文 new enhancement
🇨🇳 中文 大更新

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

🚀 概述

copilot:summary

🔍 实现细节

copilot:walkthrough

@Evansy
Copy link
Owner

Evansy commented Jul 1, 2023

感谢大佬PR~, 初步体验了一下,可能有如下问题需要处理下。

  1. 录制语音发出后,撤回提示 消息有误, 原因是,roomId 为 0 了,刷新后可撤回。
  2. 文件上传过程中需禁用下载按钮,避免上传过程中,点击下载导致上传中断。
  3. 回复框为空
    1. 回复图片
      回复图片消息
    2. 回复文件
      回复文件
  4. 无法回复文件
    无法回复文件
    // 下面是请求内容,注意替换 YOU_TOKEN
    curl 'http://localhost:9988/capi/chat/msg' \
       -H 'Accept: */*' \
       -H 'Accept-Language: zh-CN,zh;q=0.9' \
       -H 'Authorization: Bearer YOU_TOKEN' \
       -H 'Connection: keep-alive' \
       -H 'Content-Type: application/json; charset=utf-8' \
       -H 'Origin: http://localhost:9988' \
       -H 'Referer: http://localhost:9988/' \
       -H 'Sec-Fetch-Dest: empty' \
       -H 'Sec-Fetch-Mode: cors' \
       -H 'Sec-Fetch-Site: same-origin' \
       -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \
       -H 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"' \
       -H 'sec-ch-ua-mobile: ?0' \
       -H 'sec-ch-ua-platform: "macOS"' \
       --data-raw '{"roomId":1,"msgType":1,"body":{"content":"56","replyMsgId":706655810}}' \
       --compressed
  5. 图片里面选择文件也可以上传,应该再做一层校验,用户选择的文件不是图片不给过。
  6. 图片的图标是不是考虑用白色的那种,不用彩色的,看起来不太和谐。

Copy link
Owner

@Evansy Evansy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢 PR~, 有点内容需要修改

import 'xgplayer/dist/index.min.css'

onMounted(() => {
new Player({
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

playerunmount 的时候是否需要手动销毁。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

视频消息本次还没正式投入使用。

}, 1000)

const audioChunks: Blob[] = []
mediaRecorder.value.addEventListener('dataavailable', (event) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意销毁事件监听

src/main.ts Outdated
import '@/utils/websocket'
import '@/assets/iconfont/index.css'
import '@/assets/iconfont/index-color.css'
import '@imengyu/vue3-context-menu/lib/vue3-context-menu.css'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

css 放到 src/styles/main.css 里面取导入。

export const useMockMessage = () => {
// 获取本地存储的用户信息
const userInfo = JSON.parse(localStorage.getItem('USER_INFO') || '{}')

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议从 hook computed 否则用户信息更新这里不会及时更新。


isSending.value = true
// 发送消息
const send = (msgType: number, body: any, roomId = 1) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msgType 需定义成枚举

* 转换文件类型
* @param suffix 文件后缀
*/
const convertFileType = (suffix: string) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

工具函数提取。

@oljc oljc closed this Jul 1, 2023
@oljc oljc force-pushed the feat-enhancement branch 2 times, most recently from 28f185c to c0bb921 Compare July 1, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants