diff --git a/README.md b/README.md index 74726d84..d10bd5e6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

- + @@ -11,6 +11,7 @@ vue3-element-admin官方文档 | 在线预览

+ ## 项目介绍 [vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin) 是基于 Vue3 + Vite4+ TypeScript5 + Element-Plus + Pinia 等最新主流技术栈构建的后台管理前端模板(配套后端源码)。 @@ -45,7 +46,7 @@ | 项目 | Gitee | Github |GitCode | | --- | --- | --- | --- | | 前端 | [vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin) | [vue3-element-admin](https://github.com/youlaitech/vue3-element-admin) |[vue3-element-admin](https://gitcode.net/youlai/vue3-element-admin)| -| 后端 | [youlai-boot](https://gitee.com/youlaiorg/youlai-boot) | [youlai-boot](https://github.com/hxrui/youlai-boot.git) |[youlai-boot](https://gitcode.net/youlai/youlai-boot)| +| 后端 | [youlai-boot](https://gitee.com/youlaiorg/youlai-boot) | [youlai-boot](https://github.com/haoxianrui/youlai-boot.git) |[youlai-boot](https://gitcode.net/youlai/youlai-boot)| ## 环境准备 @@ -94,9 +95,30 @@ server { proxy_pass http://vapi.youlai.tech/; # vapi.youlai.tech替换成你的后端API地址 } } -``` +``` + +## 注意事项 + +- **自动导入插件自动生成默认关闭** + + 模板项目的组件类型声明已自动生成。如果添加和使用新的组件,请按照图示方法开启自动生成。在自动生成完成后,记得将其设置为 `false`,避免重复执行引发冲突。 + + ![](https://s2.loli.net/2023/06/03/lrcsHzInYV6wWqo.png) + +- **项目启动浏览器访问空白** + + 请升级浏览器尝试,低版本浏览器内核可能不支持某些新的 JavaScript 语法,比如可选链操作符 `?.`。 + +- **项目同步仓库更新升级** + + 项目同步仓库更新升级之后,建议 `pnpm install` 安装更新依赖之后启动 。 + +- **其他问题** + + 如果有其他问题或者建议,建议 [ISSUE](https://gitee.com/youlaiorg/vue3-element-admin/issues/new) + ## 接口支持 - **接口调用地址**:[https://vapi.youlai.tech](https://vapi.youlai.tech) @@ -105,8 +127,8 @@ server { - **本地接口**:默认使用线上接口,你可以通过以下步骤完成本地接口环境搭建: > 1. 获取基于 `Java 、SpringBoot` 开发的后端 [youlai-boot](https://gitee.com/youlaiorg/youlai-boot.git) 源码 ; - > 2. 根据后端工程说明文档 [README.md](https://gitee.com/youlaiorg/youlai-boot#%E9%A1%B9%E7%9B%AE%E8%BF%90%E8%A1%8C) 完成本地启动; - > 3. 替换 [vite.config.ts](vite.config.ts) 的代理目标地址 [vapi.youlai.tech](vapi.youlai.tech) 为本地的 [localhost:8989](localhost:8989). + >2. 根据后端工程说明文档 [README.md](https://gitee.com/youlaiorg/youlai-boot#%E9%A1%B9%E7%9B%AE%E8%BF%90%E8%A1%8C) 完成本地启动; + > 3. 替换 [vite.config.ts](vite.config.ts) 的代理目标地址 `vapi.youlai.tech` 为本地的 `localhost:8989` @@ -118,6 +140,8 @@ server { - [Husky + Lint-staged + Commitlint + Commitizen + cz-git 配置 Git 提交规范](https://blog.csdn.net/u013737132/article/details/130191363) + + ## 提交规范 执行 `pnpm run commit` 唤起 git commit 交互,根据提示完成信息的输入和选择。 @@ -136,4 +160,3 @@ server { ![](https://s2.loli.net/2023/05/28/7vNjHTotb2h9zBD.png) - diff --git a/package.json b/package.json index b5cefd87..4bd2b5dc 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "axios": "^1.4.0", "codemirror": "^5.65.13", "echarts": "^5.2.2", - "element-plus": "^2.3.4", + "element-plus": "^2.3.6", "lodash-es": "^4.17.21", "nprogress": "^0.2.0", "path-browserify": "^1.0.1", @@ -102,4 +102,4 @@ "repository": "https://gitee.com/youlaiorg/vue3-element-admin.git", "author": "有来开源组织", "license": "MIT" -} \ No newline at end of file +} diff --git a/src/api/user/types.ts b/src/api/user/types.ts index 613ad6e1..057be5f3 100644 --- a/src/api/user/types.ts +++ b/src/api/user/types.ts @@ -2,6 +2,7 @@ * 登录用户信息 */ export interface UserInfo { + userId: number; nickname: string; avatar: string; roles: string[]; diff --git a/src/api/websocket/index.ts b/src/api/websocket/index.ts new file mode 100644 index 00000000..867a2a23 --- /dev/null +++ b/src/api/websocket/index.ts @@ -0,0 +1,27 @@ +import request from "@/utils/request"; + +/** + * 发送消息给所有人 + * + * @param file + */ +export function sendToAll(message: string) { + return request({ + url: "/websocket/sendToAll", + method: "post", + params: { message: message }, + }); +} + +/** + * 发送消息给指定用户 + * + * @param + */ +export function sendToUser(userId: number, message: string) { + return request({ + url: "/websocket/sendToUser/" + userId, + method: "post", + params: { message: message }, + }); +} diff --git a/src/components/GithubCorner/index.vue b/src/components/GithubCorner/index.vue index 6fadd6c4..4b0bba98 100644 --- a/src/components/GithubCorner/index.vue +++ b/src/components/GithubCorner/index.vue @@ -1,6 +1,6 @@