diff --git a/LICENSE b/LICENSE index c4c9813d..9825cba0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2022 有来开源组织 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2021-present 有来开源组织 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index d10bd5e6..7ae7ea76 100644 --- a/README.md +++ b/README.md @@ -22,39 +22,41 @@ - 提供了配套的 Java 后端接口,真实的接口数据,而非使用 Mock 数据。您可以访问在[线接口文档](https://www.apifox.cn/apidoc/shared-195e783f-4d85-4235-a038-eec696de4ea5)查看接口详情。 - 权限系统功能齐全,包括用户管理、角色管理、菜单管理、字典管理和部门管理等,以满足您对权限管理的需求。 - 项目还提供了基础设施支持,包括动态路由、按钮级别的权限控制、国际化支持、代码规范、Git 提交规范以及常用组件的封装,以便开发人员更高效地开发和维护项目。 + ## 项目预览 - **在线预览**: [https://vue3.youlai.tech/](https://vue3.youlai.tech/) - **控制台** - ![暗黑模式](https://s2.loli.net/2023/03/13/QvjY4zf3VCGteNF.png) + ![暗黑模式](https://foruda.gitee.com/images/1687755822903300961/a4d63e22_716974.png) - **接口文档** - ![接口文档](https://s2.loli.net/2023/03/13/bH4J3O6WRgCUpwt.png) + ![接口文档](https://foruda.gitee.com/images/1687755822857820115/96054330_716974.png) + - **权限管理系统** - | ![用户管理](https://s2.loli.net/2023/03/13/L9xgT5sSMVZukQj.png) | ![image-20230313003008012](https://s2.loli.net/2023/03/13/nQg6HmrtFUkPDYv.png) | - | --- | --- | - | ![image-20230313003028425](https://s2.loli.net/2023/03/13/C4fDRJeTuUO7gPI.png) | ![字典管理](https://s2.loli.net/2023/03/13/BzqjHpa64wfeWhE.png) | + |![在这里插入图片描述](https://foruda.gitee.com/images/1687755822816437081/b7620905_716974.png) | ![角色管理](https://foruda.gitee.com/images/1687755822852085747/c13a4d19_716974.png) | + | ------------------------------------------------------ | ------------------------------------------------------ | + | ![菜单管理](https://foruda.gitee.com/images/1687755822966247550/4d4f8118_716974.png) | ![在这里插入图片描述](https://foruda.gitee.com/images/1687755822828758939/8035a91f_716974.png) ## 项目地址 -| 项目 | 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/haoxianrui/youlai-boot.git) |[youlai-boot](https://gitcode.net/youlai/youlai-boot)| +| 项目 | 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/haoxianrui/youlai-boot.git) | [youlai-boot](https://gitcode.net/youlai/youlai-boot) | ## 环境准备 -| 环境 | 名称版本 | 备注 | -| ----------- | :-------- | --------------| -| **开发工具** | VSCode | [下载地址](https://code.visualstudio.com/Download) | -| **运行环境** | Node 16+ | [下载地址](http://nodejs.cn/download) | -| **VSCode插件(必装)** | 1. `Vue Language Features (Volar) `
2. `TypeScript Vue Plugin (Volar) `
3. 禁用 Vetur | ![image-20230224222541797](https://s2.loli.net/2023/02/24/Qt4XDGHFOWqfsyB.png) | +| 环境 | 名称版本 | 备注 | +| -------------------- | :----------------------------------------------------------- | ------------------------------------------------------------ | +| **开发工具** | VSCode | [下载地址](https://code.visualstudio.com/Download) | +| **运行环境** | Node 16+ | [下载地址](http://nodejs.cn/download) | +| **VSCode插件(必装)** | 1. `Vue Language Features (Volar) `
2. `TypeScript Vue Plugin (Volar) `
3. 禁用 Vetur | ![vscode-plugin](https://foruda.gitee.com/images/1687755823108948048/d0198b2d_716974.png) | ## 项目启动 @@ -63,6 +65,9 @@ # 克隆代码 git clone https://gitee.com/youlaiorg/vue3-element-admin.git +# 切换目录 +cd vue3-element-admin + # 安装 pnpm npm install pnpm -g @@ -105,7 +110,7 @@ server { 模板项目的组件类型声明已自动生成。如果添加和使用新的组件,请按照图示方法开启自动生成。在自动生成完成后,记得将其设置为 `false`,避免重复执行引发冲突。 - ![](https://s2.loli.net/2023/06/03/lrcsHzInYV6wWqo.png) + ![](https://foruda.gitee.com/images/1687755823137387608/412ea803_716974.png) - **项目启动浏览器访问空白** @@ -114,7 +119,7 @@ server { - **项目同步仓库更新升级** 项目同步仓库更新升级之后,建议 `pnpm install` 安装更新依赖之后启动 。 - + - **其他问题** 如果有其他问题或者建议,建议 [ISSUE](https://gitee.com/youlaiorg/vue3-element-admin/issues/new) @@ -122,13 +127,16 @@ server { ## 接口支持 - **接口调用地址**:[https://vapi.youlai.tech](https://vapi.youlai.tech) + - **接口文档地址**:[在线接口文档](https://www.apifox.cn/apidoc/shared-195e783f-4d85-4235-a038-eec696de4ea5) + - **OpenAPI文档地址**:[http://vapi.youlai.tech/v3/api-docs](http://vapi.youlai.tech/v3/api-docs) + - **本地接口**:默认使用线上接口,你可以通过以下步骤完成本地接口环境搭建: - > 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` 为本地的 `localhost:8989` + > 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` 为本地的 `localhost:8989` @@ -146,17 +154,20 @@ server { 执行 `pnpm run commit` 唤起 git commit 交互,根据提示完成信息的输入和选择。 -![](https://oss.youlai.tech/youlai-boot/2023/05/21/d9863c6ded9e4363824b0d8c4c1f0642.png) +![](https://foruda.gitee.com/images/1687755823165218215/c1705416_716974.png) -## 公众号🎉 -> 无广告,佛系公众号,随缘更新开源组织成员技术分享,期待您的关注! - -![](https://s2.loli.net/2023/05/28/JaG4L8ZHmkIgRQC.png) ## 交流群🚀 -> 如果交流群的二维码过期,请加我微信,备注「前端」、「后端」或「全栈」即可,我将邀请您加入对应的微信群。 +> 关注「有来技术」公众号,获取交流群二维码。 +> +> 如果交流群的二维码过期,加我微信,备注「前端」、「后端」或「全栈」即可。 +> +> 为了避免营销广告人群混入,此举无奈,望理解! -![](https://s2.loli.net/2023/05/28/7vNjHTotb2h9zBD.png) + +| 公众号 | 交流群 | +| ------------------------------------------------------------ | ------------------------------------------------------------ | +| | | diff --git a/licenses/vue-element-admin/LICENSE b/licenses/vue-element-admin/LICENSE new file mode 100644 index 00000000..3fce3848 --- /dev/null +++ b/licenses/vue-element-admin/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present PanJiaChen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/licenses/vue3-element-admin/LICENSE b/licenses/vue3-element-admin/LICENSE new file mode 100644 index 00000000..9825cba0 --- /dev/null +++ b/licenses/vue3-element-admin/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021-present 有来开源组织 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package.json b/package.json index 53a5a49d..e9c315f4 100644 --- a/package.json +++ b/package.json @@ -48,14 +48,14 @@ "axios": "^1.4.0", "codemirror": "^5.65.13", "echarts": "^5.2.2", - "element-plus": "^2.3.6", + "element-plus": "^2.3.7", "lodash-es": "^4.17.21", "nprogress": "^0.2.0", "path-browserify": "^1.0.1", "path-to-regexp": "^6.2.0", "pinia": "^2.0.33", "screenfull": "^6.0.0", - "vue": "^3.3.1", + "vue": "^3.3.4", "vue-i18n": "9.2.2", "vue-router": "^4.2.0", "xlsx": "^0.18.5" @@ -98,7 +98,7 @@ "unplugin-auto-import": "^0.15.3", "unplugin-icons": "^0.16.1", "unplugin-vue-components": "^0.24.1", - "vite": "^4.3.5", + "vite": "^4.4.2", "vite-plugin-svg-icons": "^2.0.1", "vue-tsc": "^1.6.5 " }, diff --git a/src/api/auth/index.ts b/src/api/auth/index.ts index d75d67b1..92663750 100644 --- a/src/api/auth/index.ts +++ b/src/api/auth/index.ts @@ -1,6 +1,6 @@ -import request from '@/utils/request'; -import { AxiosPromise } from 'axios'; -import { CaptchaResult, LoginData, LoginResult } from './types'; +import request from "@/utils/request"; +import { AxiosPromise } from "axios"; +import { CaptchaResult, LoginData, LoginResult } from "./types"; /** * 登录API @@ -9,10 +9,18 @@ import { CaptchaResult, LoginData, LoginResult } from './types'; * @returns */ export function loginApi(data: LoginData): AxiosPromise { + const formData = new FormData(); + formData.append("username", data.username); + formData.append("password", data.password); + formData.append("verifyCodeKey", data.verifyCodeKey || ""); + formData.append("verifyCode", data.verifyCode || ""); return request({ - url: '/api/v1/auth/login', - method: 'post', - params: data + url: "/api/v1/auth/login", + method: "post", + data: formData, + headers: { + "Content-Type": "multipart/form-data", + }, }); } @@ -21,19 +29,17 @@ export function loginApi(data: LoginData): AxiosPromise { */ export function logoutApi() { return request({ - url: '/api/v1/auth/logout', - method: 'delete' + url: "/api/v1/auth/logout", + method: "delete", }); } - - /** * 获取验证码 */ export function getCaptchaApi(): AxiosPromise { return request({ - url: '/api/v1/auth/captcha', - method: 'get' + url: "/api/v1/auth/captcha", + method: "get", }); } diff --git a/src/api/auth/types.ts b/src/api/auth/types.ts index dcc47d09..858f1d9e 100644 --- a/src/api/auth/types.ts +++ b/src/api/auth/types.ts @@ -5,11 +5,11 @@ export interface LoginData { /** * 用户名 */ - username?: string; + username: string; /** * 密码 */ - password?: string; + password: string; /** * 验证码缓存key @@ -57,4 +57,3 @@ export interface CaptchaResult { */ verifyCodeBase64: string; } - diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 546f0ee1..417e372c 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -121,7 +121,7 @@ orderCount.value = 2000;
访问数
-
+
{{ Math.round(visitCountOutput) }}
@@ -138,7 +138,7 @@ orderCount.value = 2000;
消息数
-
+
{{ Math.round(messageCountOutput) }}
@@ -169,7 +169,7 @@ orderCount.value = 2000;
订单数
-
+
{{ Math.round(orderCountOutput) }}
diff --git a/src/views/system/dict/DictData.vue b/src/views/system/dict/DictData.vue index 605c3365..ce3b12f7 100644 --- a/src/views/system/dict/DictData.vue +++ b/src/views/system/dict/DictData.vue @@ -33,6 +33,7 @@ watch( () => props.typeCode, (newVal: string) => { queryParams.typeCode = newVal; + formData.typeCode = newVal; resetQuery(); } ); @@ -121,9 +122,9 @@ function openDialog(dictId?: number) { * 字典表单提交 */ function handleSubmit() { - loading.value = false; dataFormRef.value.validate((isValid: boolean) => { if (isValid) { + loading.value = false; const dictId = formData.id; if (dictId) { updateDict(dictId, formData) diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 518f121a..9d7e07fb 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -96,9 +96,9 @@ function openDialog(dicTypeId?: number) { * 字典类型表单提交 */ function handleSubmit() { - loading.value = false; dataFormRef.value.validate((isValid: boolean) => { if (isValid) { + loading.value = false; const dictTypeId = formData.id; if (dictTypeId) { updateDictType(dictTypeId, formData) @@ -166,11 +166,10 @@ const dictDataDialog = reactive({ visible: false, }); -// 当前选中的字典类型 -const selectedDictType = reactive({ typeCode: "", typeName: "" }); +const selectedDictType = reactive({ typeCode: "", typeName: "" }); // 当前选中的字典类型 /** - * 打开字典弹窗 + * 打开字典数据弹窗 */ function openDictDialog(row: DictTypePageVO) { dictDataDialog.visible = true; @@ -181,7 +180,7 @@ function openDictDialog(row: DictTypePageVO) { } /** - * 关闭字典弹窗 + * 关闭字典数据弹窗 */ function closeDictDialog() { dictDataDialog.visible = false; diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index b2a2a697..59785f6b 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -111,9 +111,9 @@ function openDialog(roleId?: number) { * 角色表单提交 */ function handleSubmit() { - loading.value = true; roleFormRef.value.validate((valid: any) => { if (valid) { + loading.value = true; const roleId = formData.id; if (roleId) { updateRole(roleId, formData)