From 8e9680354f5586b6ba5c5eff3497c19156a47d79 Mon Sep 17 00:00:00 2001 From: nongyehong <2439646234@qq.com> Date: Fri, 3 Jan 2025 01:20:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(common):=20:bug:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=B5=81=E7=A8=8B=E5=92=8C=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化消息提示 --- .lintstagedrc.mjs | 6 +- README.en.md | 122 ++++++++++++++++++ README.md | 70 +++++----- README.zh-CN.md | 122 ------------------ package.json | 2 +- .../rightBox/chatBox/ChatHeader.vue | 28 +++- src/components/rightBox/chatBox/ChatMain.vue | 42 +++--- .../rightBox/chatBox/ChatSidebar.vue | 28 +++- src/components/windows/ActionBar.vue | 1 + src/hooks/useMessage.ts | 20 +-- src/hooks/useMsgInput.ts | 8 +- src/hooks/useWindowState.ts | 7 + src/layout/center/index.vue | 4 +- src/layout/index.vue | 5 +- src/layout/left/config.tsx | 2 + src/stores/chat.ts | 31 ++--- src/stores/global.ts | 30 ++--- src/stores/group.ts | 9 +- src/strategy/MessageStrategy.ts | 3 +- src/typings/components.d.ts | 2 - src/utils/ComputedTime.ts | 9 +- src/views/homeWindow/message/index.vue | 38 ++++-- 22 files changed, 324 insertions(+), 265 deletions(-) create mode 100644 README.en.md delete mode 100644 README.zh-CN.md diff --git a/.lintstagedrc.mjs b/.lintstagedrc.mjs index 5d2db1aa..ef9d5175 100644 --- a/.lintstagedrc.mjs +++ b/.lintstagedrc.mjs @@ -1,8 +1,7 @@ import path from 'node:path' function createCommand(prefix, join) { - return (filenames) => - `${prefix} ${filenames.map((f) => path.relative(process.cwd(), f)).join(` ${join} `)}` + return (filenames) => `${prefix} ${filenames.map((f) => path.relative(process.cwd(), f)).join(` ${join} `)}` } export default { @@ -10,6 +9,7 @@ export default { 'oxlint src', createCommand('pnpm eslint --fix', ''), createCommand('prettier --write', '--write'), - () => 'pnpm test:run' + () => 'pnpm test:run', + () => 'vue-tsc --noEmit' ] } diff --git a/README.en.md b/README.en.md new file mode 100644 index 00000000..c0b2c464 --- /dev/null +++ b/README.en.md @@ -0,0 +1,122 @@ +

+ +

+ +

An Instant Messaging System Built with Tauri, Vite 5, Vue 3, and TypeScript

+ +
+ + + + + CI + + + + + + + + + +
+ +

+ gitee:star + github:star +

+

+ WeChat: +

+ +

中文 | English

+ +## Project Introduction + +HuLa is an instant messaging system developed with Tauri, Vite 5, Vue 3, and TypeScript. It leverages the cross-platform capabilities of Tauri and the reactive design of Vue 3, combined with TypeScript's type safety features and the fast build system of Vite 5, to provide users with an efficient, secure, and easy-to-use communication solution. + +## Technology Stack + +- **Tauri**: Provides a lightweight, high-performance desktop application container, enabling the development of cross-platform desktop applications with a web technology stack. Tauri's design philosophy aims to minimize resource consumption while ensuring security. +- **Vite 5**: A modern front-end build tool that uses native ES module import to offer a fast development server. At the same time, it provides robust support for production builds. Vite 5 is its latest version, bringing more optimizations and features. +- **Vue 3**: A progressive JavaScript framework for building user interfaces. Its Composition API, improved TypeScript integration, and optimizations for mobile platforms make developing complex single-page applications simpler and more efficient. +- **TypeScript**: A superset of JavaScript that adds a type system to the language. It enables catching more errors during development and provides better support from editors. + +## Project PreView + +![img.png](preview/img.png) + +![img_1.png](preview/img_1.png) + +![img_2.png](preview/img_2.png) + +![img_3.png](preview/img_3.png) + +![img_4.png](preview/img_4.png) + +![img_5.png](preview/img_5.png) + +![img_6.png](preview/img_6.png) + +![img_6.png](preview/img_7.png) + +![img_6.png](preview/img_8.png) + +## Thanks to the following contributors! + + + + + +## Installation and Running + +```bash +# Clone the project +git clone https://gitee.com/HuLaSpark/HuLa.git +or +git clone https://github.com/HuLaSpark/HuLa.git + +# Enter the project directory +cd HuLa + +# Install dependencies +pnpm install + +# Run the development server +pnpm run tauri:dev + +# Build for production +pnpm run tauri:build +``` + +## ⚠️ Precautions(macOS Users) + +Downloading the installation package on the web page will indicate that the installation package is corrupted, and you may encounter a certificate issue, which is caused by the security mechanism of the macOS system. Follow these steps to solve: + +#### 1. Open "System Settings" - "Security & Privacy", as shown in the figure, check the box: Allow apps downloaded from "Any Source" to run: + +![img.png](preview/img_9.png) + +#### 2. If an error is reported, run the following command in the terminal to resolve the problem: + +```bash +sudo xattr -rd com.apple.quarantine the Path To Install The Package/HuLa.app +``` + +## SubmissionSpecification + +use **pnpm run commit** to invoke the _git commit_ interaction and follow the prompts to complete the input and selection of information + +## Disclaimer + +1. This project is provided as an open source project, and the developer does not provide any express or implied warranty of any kind as to the functionality, security, or suitability of the software to the extent permitted by law +2. The User expressly understands and agrees that the use of the Software is entirely at the User's own risk and that the Software is provided on an "as is" and "as available" basis. The developer disclaims all warranties of any kind, whether express or implied, including, but not limited to, warranties of merchantability, fitness for a particular purpose, and non-infringement +3. In no event shall Developer or its suppliers be liable for any direct, indirect, incidental, special, punitive, or consequential damages, including, but not limited to, lost profits, business interruption, disclosure of personal information, or other commercial damages or losses arising from the use of the Software +4. All users who carry out secondary development on this project shall undertake to use this software for legitimate purposes and shall be responsible for complying with local laws and regulations +5. Developer reserves the right to modify the functionality or features of the Software, as well as any part of this Disclaimer, at any time, and these modifications may be reflected in software updates + +**The final interpretation of this disclaimer belongs to the developer** + +## License + +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FHuLaSpark%2FHuLa.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FHuLaSpark%2FHuLa?ref=badge_large) diff --git a/README.md b/README.md index c0b2c464..9b79a131 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

-

An Instant Messaging System Built with Tauri, Vite 5, Vue 3, and TypeScript

+

一个基于Tauri、Vite 5、Vue 3 和 TypeScript 构建的即时通讯系统

@@ -18,7 +18,7 @@ - +

@@ -26,23 +26,23 @@ github:star

- WeChat: + 微信:

-

中文 | English

+

English | 中文

-## Project Introduction +## 项目介绍 -HuLa is an instant messaging system developed with Tauri, Vite 5, Vue 3, and TypeScript. It leverages the cross-platform capabilities of Tauri and the reactive design of Vue 3, combined with TypeScript's type safety features and the fast build system of Vite 5, to provide users with an efficient, secure, and easy-to-use communication solution. +HuLa 是一个基于 Tauri、Vite 5、Vue 3 和 TypeScript 构建的即时通讯系统。它利用了 Tauri 的跨平台能力和 Vue 3 的响应式设计,结合了 TypeScript 的类型安全特性和 Vite 5 的快速构建,为用户提供了一个高效、安全和易用的通讯解决方案。 -## Technology Stack +## 技术栈 -- **Tauri**: Provides a lightweight, high-performance desktop application container, enabling the development of cross-platform desktop applications with a web technology stack. Tauri's design philosophy aims to minimize resource consumption while ensuring security. -- **Vite 5**: A modern front-end build tool that uses native ES module import to offer a fast development server. At the same time, it provides robust support for production builds. Vite 5 is its latest version, bringing more optimizations and features. -- **Vue 3**: A progressive JavaScript framework for building user interfaces. Its Composition API, improved TypeScript integration, and optimizations for mobile platforms make developing complex single-page applications simpler and more efficient. -- **TypeScript**: A superset of JavaScript that adds a type system to the language. It enables catching more errors during development and provides better support from editors. +- **Tauri**: 为本项目提供了一个轻量级的、高性能的桌面应用容器,使得我们可以使用前端技术栈来开发跨平台的桌面应用。Tauri 的设计哲学是在保证安全性的前提下,尽可能减少资源占用。 +- **Vite 5**: Vite 是一个现代化的前端构建工具,它利用原生 ES 模块导入的能力来提供一个快速的开发服务器,与此同时,它也为生产环境打包提供了强大的支持。Vite 5 是其最新的版本,带来了更多的优化和特性。 +- **Vue 3**: Vue 3 是一个渐进式JavaScript框架,用于构建用户界面。它的组合式API、更好的TypeScript集成和对移动端的优化使得开发复杂的单页应用变得更加简单和高效。 +- **TypeScript**: TypeScript 是 JavaScript 的一个超集,它在 JavaScript 的基础上增加了类型系统。这让我们能够在开发过程中捕获更多的错误,并且提供更好的编辑器支持。 -## Project PreView +## 项目预览 ![img.png](preview/img.png) @@ -62,61 +62,61 @@ HuLa is an instant messaging system developed with Tauri, Vite 5, Vue 3, and Typ ![img_6.png](preview/img_8.png) -## Thanks to the following contributors! +## 感谢以下贡献者们! -## Installation and Running +## 安装与运行 ```bash -# Clone the project +# 克隆项目 git clone https://gitee.com/HuLaSpark/HuLa.git -or +或者 git clone https://github.com/HuLaSpark/HuLa.git -# Enter the project directory +# 进入项目目录 cd HuLa -# Install dependencies +# 安装依赖 pnpm install -# Run the development server +# 运行开发服务器 pnpm run tauri:dev -# Build for production +# 构建生产版本 pnpm run tauri:build ``` -## ⚠️ Precautions(macOS Users) +## ⚠️ 注意事项(macOS用户) -Downloading the installation package on the web page will indicate that the installation package is corrupted, and you may encounter a certificate issue, which is caused by the security mechanism of the macOS system. Follow these steps to solve: +网页上下载安装包会提示安装包已损坏,可能会遇到证书问题,这是因为 macOS 系统的安全机制导致的。请按照以下步骤解决: -#### 1. Open "System Settings" - "Security & Privacy", as shown in the figure, check the box: Allow apps downloaded from "Any Source" to run: +#### 1. 打开 “系统设置” - “安全性与隐私”,如图勾选:允许 “任何来源” 下载的 App 运行: ![img.png](preview/img_9.png) -#### 2. If an error is reported, run the following command in the terminal to resolve the problem: +#### 2. 如果还报错,请在终端执行以下命令解决: ```bash -sudo xattr -rd com.apple.quarantine the Path To Install The Package/HuLa.app +sudo xattr -rd com.apple.quarantine 你的安装包路径/HuLa.app ``` -## SubmissionSpecification +## 提交规范 -use **pnpm run commit** to invoke the _git commit_ interaction and follow the prompts to complete the input and selection of information +执行 **pnpm run commit** 唤起 _git commit_ 交互,根据提示完成信息的输入和选择 -## Disclaimer +## 免责声明 -1. This project is provided as an open source project, and the developer does not provide any express or implied warranty of any kind as to the functionality, security, or suitability of the software to the extent permitted by law -2. The User expressly understands and agrees that the use of the Software is entirely at the User's own risk and that the Software is provided on an "as is" and "as available" basis. The developer disclaims all warranties of any kind, whether express or implied, including, but not limited to, warranties of merchantability, fitness for a particular purpose, and non-infringement -3. In no event shall Developer or its suppliers be liable for any direct, indirect, incidental, special, punitive, or consequential damages, including, but not limited to, lost profits, business interruption, disclosure of personal information, or other commercial damages or losses arising from the use of the Software -4. All users who carry out secondary development on this project shall undertake to use this software for legitimate purposes and shall be responsible for complying with local laws and regulations -5. Developer reserves the right to modify the functionality or features of the Software, as well as any part of this Disclaimer, at any time, and these modifications may be reflected in software updates +1. 本项目是作为一个开源项目提供的,开发者在法律允许的范围内不对软件的功能性、安全性或适用性提供任何形式的明示或暗示的保证 +2. 用户明确理解并同意,使用本软件的风险完全由用户自己承担,软件以"现状"和"现有"基础提供。开发者不提供任何形式的担保,无论是明示还是暗示的,包括但不限于适销性、特定用途的适用性和非侵权的担保 +3. 在任何情况下,开发者或其供应商都不对任何直接的、间接的、偶然的、特殊的、惩罚性的或后果性的损害承担责任,包括但不限于使用本软件产生的利润损失、业务中断、个人信息泄露或其他商业损害或损失 +4. 所有在本项目上进行二次开发的用户,都需承诺将本软件用于合法目的,并自行负责遵守当地的法律和法规 +5. 开发者有权在任何时间修改软件的功能或特性,以及本免责声明的任何部分,并且这些修改可能会以软件更新的形式体现 -**The final interpretation of this disclaimer belongs to the developer** +**本免责声明的最终解释权归开发者所有** -## License +## License [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FHuLaSpark%2FHuLa.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FHuLaSpark%2FHuLa?ref=badge_large) diff --git a/README.zh-CN.md b/README.zh-CN.md deleted file mode 100644 index 538329ad..00000000 --- a/README.zh-CN.md +++ /dev/null @@ -1,122 +0,0 @@ -

- -

- -

一个基于Tauri、Vite 5、Vue 3 和 TypeScript 构建的即时通讯系统

- -
- - - - - CI - - - - - - - - - -
- -

- gitee:star - github:star -

-

- 微信: -

- -

English | 中文

- -## 项目介绍 - -HuLa 是一个基于 Tauri、Vite 5、Vue 3 和 TypeScript 构建的即时通讯系统。它利用了 Tauri 的跨平台能力和 Vue 3 的响应式设计,结合了 TypeScript 的类型安全特性和 Vite 5 的快速构建,为用户提供了一个高效、安全和易用的通讯解决方案。 - -## 技术栈 - -- **Tauri**: 为本项目提供了一个轻量级的、高性能的桌面应用容器,使得我们可以使用前端技术栈来开发跨平台的桌面应用。Tauri 的设计哲学是在保证安全性的前提下,尽可能减少资源占用。 -- **Vite 5**: Vite 是一个现代化的前端构建工具,它利用原生 ES 模块导入的能力来提供一个快速的开发服务器,与此同时,它也为生产环境打包提供了强大的支持。Vite 5 是其最新的版本,带来了更多的优化和特性。 -- **Vue 3**: Vue 3 是一个渐进式JavaScript框架,用于构建用户界面。它的组合式API、更好的TypeScript集成和对移动端的优化使得开发复杂的单页应用变得更加简单和高效。 -- **TypeScript**: TypeScript 是 JavaScript 的一个超集,它在 JavaScript 的基础上增加了类型系统。这让我们能够在开发过程中捕获更多的错误,并且提供更好的编辑器支持。 - -## 项目预览 - -![img.png](preview/img.png) - -![img_1.png](preview/img_1.png) - -![img_2.png](preview/img_2.png) - -![img_3.png](preview/img_3.png) - -![img_4.png](preview/img_4.png) - -![img_5.png](preview/img_5.png) - -![img_6.png](preview/img_6.png) - -![img_6.png](preview/img_7.png) - -![img_6.png](preview/img_8.png) - -## 感谢以下贡献者们! - - - - - -## 安装与运行 - -```bash -# 克隆项目 -git clone https://gitee.com/HuLaSpark/HuLa.git -或者 -git clone https://github.com/HuLaSpark/HuLa.git - -# 进入项目目录 -cd HuLa - -# 安装依赖 -pnpm install - -# 运行开发服务器 -pnpm run tauri:dev - -# 构建生产版本 -pnpm run tauri:build -``` - -## ⚠️ 注意事项(macOS用户) - -网页上下载安装包会提示安装包已损坏,可能会遇到证书问题,这是因为 macOS 系统的安全机制导致的。请按照以下步骤解决: - -#### 1. 打开 “系统设置” - “安全性与隐私”,如图勾选:允许 “任何来源” 下载的 App 运行: - -![img.png](preview/img_9.png) - -#### 2. 如果还报错,请在终端执行以下命令解决: - -```bash -sudo xattr -rd com.apple.quarantine 你的安装包路径/HuLa.app -``` - -## 提交规范 - -执行 **pnpm run commit** 唤起 _git commit_ 交互,根据提示完成信息的输入和选择 - -## 免责声明 - -1. 本项目是作为一个开源项目提供的,开发者在法律允许的范围内不对软件的功能性、安全性或适用性提供任何形式的明示或暗示的保证 -2. 用户明确理解并同意,使用本软件的风险完全由用户自己承担,软件以"现状"和"现有"基础提供。开发者不提供任何形式的担保,无论是明示还是暗示的,包括但不限于适销性、特定用途的适用性和非侵权的担保 -3. 在任何情况下,开发者或其供应商都不对任何直接的、间接的、偶然的、特殊的、惩罚性的或后果性的损害承担责任,包括但不限于使用本软件产生的利润损失、业务中断、个人信息泄露或其他商业损害或损失 -4. 所有在本项目上进行二次开发的用户,都需承诺将本软件用于合法目的,并自行负责遵守当地的法律和法规 -5. 开发者有权在任何时间修改软件的功能或特性,以及本免责声明的任何部分,并且这些修改可能会以软件更新的形式体现 - -**本免责声明的最终解释权归开发者所有** - - -## License -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FHuLaSpark%2FHuLa.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FHuLaSpark%2FHuLa?ref=badge_large) diff --git a/package.json b/package.json index 6750250a..0ab93c00 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "========= 使用commit来进行代码提交 =========": "", "commit": "git add . && git-cz", "========= 校验代码规范 =========": "", - "lint:staged": "lint-staged", + "lint:staged": "lint-staged && vue-tsc --noEmit", "========= 安装husky =========": "", "prepare": "husky install", "========= 发版 =========": "", diff --git a/src/components/rightBox/chatBox/ChatHeader.vue b/src/components/rightBox/chatBox/ChatHeader.vue index fb246033..7eef1d5c 100644 --- a/src/components/rightBox/chatBox/ChatHeader.vue +++ b/src/components/rightBox/chatBox/ChatHeader.vue @@ -103,7 +103,10 @@

删除聊天记录

-
+

删除好友

@@ -134,7 +137,7 @@

群成员

- +