diff --git a/.stylelintrc.cjs b/.stylelintrc.cjs index e6b1be15..215713f3 100644 --- a/.stylelintrc.cjs +++ b/.stylelintrc.cjs @@ -1,13 +1,15 @@ module.exports = { - // 继承推荐规范配置 extends: [ - "stylelint-config-standard", + "stylelint-config-recommended", "stylelint-config-recommended-scss", "stylelint-config-recommended-vue/scss", "stylelint-config-html/vue", "stylelint-config-recess-order", ], - // 指定不同文件对应的解析器 + + plugins: [ + "stylelint-prettier", // 统一代码风格,格式冲突时以 Prettier 规则为准 + ], overrides: [ { files: ["**/*.{vue,html}"], @@ -18,29 +20,18 @@ module.exports = { customSyntax: "postcss-scss", }, ], - // 自定义规则 rules: { - "import-notation": "string", // 指定导入CSS文件的方式("string"|"url") - "selector-class-pattern": null, // 选择器类名命名规则 - "custom-property-pattern": null, // 自定义属性命名规则 - "keyframes-name-pattern": null, // 动画帧节点样式命名规则 - "no-descending-specificity": null, // 允许无降序特异性 - "no-empty-source": null, // 允许空样式 - // 允许 global 、export 、deep伪类 + "prettier/prettier": true, // 强制执行 Prettier 格式化规则(需配合 .prettierrc 配置文件) + "no-empty-source": null, // 允许空的样式文件 + "declaration-property-value-no-unknown": null, // 允许非常规数值格式 ,如 height: calc(100% - 50) + // 允许使用未知伪类 "selector-pseudo-class-no-unknown": [ true, { ignorePseudoClasses: ["global", "export", "deep"], }, ], - // 允许未知属性 - "property-no-unknown": [ - true, - { - ignoreProperties: [], - }, - ], - // 允许未知规则 + // 允许使用未知伪元素 "at-rule-no-unknown": [ true, { diff --git a/CHANGELOG.md b/CHANGELOG.md index fd2cef30..aef3f6da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## ✨ feat -- 支持后端文件导入([#142](https://github.com/youlaitech/vue3-element-admin/pull/142)) [@cshaptx4869](https://github.com/cshaptx4869) +- 支持后端文件导入([#142](https://github.com/youlaitech/vue3-element-admin/pull/142)) [@cshaptx4869](https://github.com/cshaptx4869) ## 🐛 fix @@ -15,7 +15,7 @@ ## ✨ feat -- 操作栏增加render配置参数([#138](https://github.com/youlaitech/vue3-element-admin/pull/140)) [@cshaptx4869](https://github.com/cshaptx4869) +- 操作栏增加render配置参数([#138](https://github.com/youlaitech/vue3-element-admin/pull/140)) [@cshaptx4869](https://github.com/cshaptx4869) - 左侧工具栏增加type配置参数([#141](https://github.com/youlaitech/vue3-element-admin/pull/141)) [@diamont1001](https://github.com/diamont1001) ## ♻️ refactor @@ -27,7 +27,7 @@ ## ✨ feat -- 支持默认工具栏的导入([#138](https://github.com/youlaitech/vue3-element-admin/pull/138)) [@cshaptx4869](https://github.com/cshaptx4869) +- 支持默认工具栏的导入([#138](https://github.com/youlaitech/vue3-element-admin/pull/138)) [@cshaptx4869](https://github.com/cshaptx4869) - 添加CURD导入示例([19e7bb](https://github.com/youlaitech/vue3-element-admin/commit/eab91effd6a01d5a3d9257249c8d06aa252b3bf8)) [@cshaptx4869](https://github.com/cshaptx4869) ## ♻️ refactor @@ -40,13 +40,13 @@ ## ✨ feat -- 支持表格远程筛选([#131](https://github.com/youlaitech/vue3-element-admin/pull/131)) [@cshaptx4869](https://github.com/cshaptx4869) +- 支持表格远程筛选([#131](https://github.com/youlaitech/vue3-element-admin/pull/131)) [@cshaptx4869](https://github.com/cshaptx4869) - 支持标签输入框([#132](https://github.com/youlaitech/vue3-element-admin/pull/132)) [@cshaptx4869](https://github.com/cshaptx4869) -- 表单项支持tips配置([#133](https://github.com/youlaitech/vue3-element-admin/pull/133)) [@cshaptx4869](https://github.com/cshaptx4869) -- 前端导出支持全量数据([#134](https://github.com/youlaitech/vue3-element-admin/pull/134)) [@cshaptx4869](https://github.com/cshaptx4869) -- 支持选中数据导出([#135](https://github.com/youlaitech/vue3-element-admin/pull/135)) [@cshaptx4869](https://github.com/cshaptx4869) -- 表格默认工具栏的导出、搜索按钮增加权限点控制([883128](https://github.com/youlaitech/vue3-element-admin/commit/8831289b655f2cc086ecdababaa89f8d8a087c42)) [@cshaptx4869](https://github.com/cshaptx4869) -- 页签title支持动态设置([23876a](https://github.com/youlaitech/vue3-element-admin/commit/23876aa396143bf77cb5c86af8d6023d9ff6555a)) [@haoxianrui](https://github.com/haoxianrui) +- 表单项支持tips配置([#133](https://github.com/youlaitech/vue3-element-admin/pull/133)) [@cshaptx4869](https://github.com/cshaptx4869) +- 前端导出支持全量数据([#134](https://github.com/youlaitech/vue3-element-admin/pull/134)) [@cshaptx4869](https://github.com/cshaptx4869) +- 支持选中数据导出([#135](https://github.com/youlaitech/vue3-element-admin/pull/135)) [@cshaptx4869](https://github.com/cshaptx4869) +- 表格默认工具栏的导出、搜索按钮增加权限点控制([883128](https://github.com/youlaitech/vue3-element-admin/commit/8831289b655f2cc086ecdababaa89f8d8a087c42)) [@cshaptx4869](https://github.com/cshaptx4869) +- 页签title支持动态设置([23876a](https://github.com/youlaitech/vue3-element-admin/commit/23876aa396143bf77cb5c86af8d6023d9ff6555a)) [@haoxianrui](https://github.com/haoxianrui) ## ♻️ refactor - 默认工具栏支持自定义([#136](https://github.com/youlaitech/vue3-element-admin/pull/136)) [@cshaptx4869](https://github.com/cshaptx4869) @@ -59,9 +59,9 @@ ## ✨ feat -- 增加pagination、request、parseData配置参数([#119](https://github.com/youlaitech/vue3-element-admin/pull/119)) [@cshaptx4869](https://github.com/cshaptx4869) +- 增加pagination、request、parseData配置参数([#119](https://github.com/youlaitech/vue3-element-admin/pull/119)) [@cshaptx4869](https://github.com/cshaptx4869) - 增加返回顶部功能([#120](https://github.com/youlaitech/vue3-element-admin/pull/120)) [@cshaptx4869](https://github.com/cshaptx4869) -- 支持前端导出([#126](https://github.com/youlaitech/vue3-element-admin/pull/126)) [@cshaptx4869](https://github.com/cshaptx4869) +- 支持前端导出([#126](https://github.com/youlaitech/vue3-element-admin/pull/126)) [@cshaptx4869](https://github.com/cshaptx4869) ## ♻️ refactor - 重构布局样式(解决页面抖动问题)([#116](https://github.com/youlaitech/vue3-element-admin/pull/116)) [@cshaptx4869](https://github.com/cshaptx4869) @@ -174,7 +174,7 @@ - 本地缓存的 token 变量重命名(author by [haoxianrui](https://github.com/haoxianrui)) - 完善 Vite 环境变量类型声明(author by [haoxianrui](https://github.com/haoxianrui)) -## 🐛 fix +## 🐛 fix - 修复构建时提示iconComponent.name可能为undefined的报错 (author by [wangji1042](https://github.com/wangji1042)) - 修复浏览器密码自动填充时可能存在的报错 (author by [cshaptx4869](https://github.com/cshaptx4869)) - 修复eslint报错(author by [cshaptx4869](https://github.com/cshaptx4869)) @@ -211,7 +211,7 @@ ## ♻️ refactor - 项目配置按钮移入navbar(author by [cshaptx4869](https://github.com/cshaptx4869)) - 优化user数据定义(author by [cshaptx4869](https://github.com/cshaptx4869)) -- 统一设置栏的 SVG 图标风格 +- 统一设置栏的 SVG 图标风格 ## 🐛 fix - 规整一些开发依赖(author by [cshaptx4869](https://github.com/cshaptx4869)) @@ -241,7 +241,7 @@ # 2.8.1 (2024/01/10) ## ✨ feat -- 替换 Mock 解决方案 vite-plugin-mock 为 vite-plugin-mock-dev-server 适配 Vite5 +- 替换 Mock 解决方案 vite-plugin-mock 为 vite-plugin-mock-dev-server 适配 Vite5 # 2.8.0 (2023/12/27) @@ -280,7 +280,7 @@ ## ✨ feat - 菜单管理新增目录只有一级子路由是否始终显示(alwaysShow)和路由页面是否缓存(keepAlive)的配置 - 接口文档新增 swagger、knife4j -- 引入和支持 tsx +- 引入和支持 tsx ## ♻️ refactor - 代码瘦身,整理并删除未使用的 svg @@ -329,7 +329,7 @@ - 字典组件封装(author by [haoxr](https://juejin.cn/user/4187394044331261/posts)) ## 🐛 fix -- 分页组件hidden无效 +- 分页组件hidden无效 - 签名无法保存至后端 - Git 提交 stylelint 校验部分机器报错 diff --git a/README.md b/README.md index a97ac1ae..5b0e94ee 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@

vue3-element-admin

- - + + @@ -12,7 +12,7 @@ 有来技术 - + 有来技术 @@ -26,37 +26,32 @@
- 🔍 在线预览 | 📖 阅读文档 | 🌐English + 🖥️ 在线预览 | 📑 阅读文档 | 💬 English
- ## 项目简介 -[vue3-element-admin](https://gitcode.com/youlai/vue3-element-admin) 是基于 Vue3 + Vite5+ TypeScript5 + Element-Plus + Pinia 等主流技术栈构建的免费开源的中后台管理的前端模板(配套[Java 后端源码](https://gitee.com/youlaiorg/youlai-boot))。 +[vue3-element-admin](https://gitcode.com/youlai/vue3-element-admin) 基于 Vue3、Vite、TypeScript 和 Element-Plus 搭建的极简开箱即用企业级后台管理前端模板。 (配套 Java 后端 [youlai-boot](https://gitee.com/youlaiorg/youlai-boot) 和 Node 后端 [youlai-nest](https://gitee.com/youlaiorg/youlai-nest))。 ## 项目特色 - **简洁易用**:基于 [vue-element-admin](https://gitee.com/panjiachen/vue-element-admin) 升级的 Vue3 版本,无过渡封装 ,易上手。 +- **数据交互**: 支持 `Mock` 数据和[线上接口文档](https://www.apifox.cn/apidoc/shared-195e783f-4d85-4235-a038-eec696de4ea5),并提供配套的 [Java](https://gitee.com/youlaiorg/youlai-boot) 和 [Node](https://gitee.com/youlaiorg/youlai-nest) 后端源码。 -- **数据交互**:同时支持本地 `Mock` 和线上接口,配套 [Java 后端源码](https://gitee.com/youlaiorg/youlai-boot)和[在线接口文档](https://www.apifox.cn/apidoc/shared-195e783f-4d85-4235-a038-eec696de4ea5)。 - -- **权限管理**:用户、角色、菜单、字典、部门等完善的权限系统功能。 - -- **基础设施**:动态路由、按钮权限、国际化、代码规范、Git 提交规范、常用组件封装。 +- **系统功能:** 提供用户管理、角色管理、菜单管理、部门管理、字典管理等功能模块。 +- **权限管理:** 支持动态路由、按钮权限、角色权限和数据权限等多种权限管理方式。 +- **基础设施:** 提供国际化、多布局、暗黑模式、全屏、水印、接口文档和代码生成器等功能。 - **持续更新**:项目持续开源更新,实时更新工具和依赖。 +## 项目截图 -## 项目预览 +![](https://www.youlai.tech/storage/blog/2025/01/18/20250118160647.png) -![明亮模式](https://foruda.gitee.com/images/1709651876583793739/0ba1ee1c_716974.png) - -![暗黑模式](https://foruda.gitee.com/images/1709651875494206224/2a2b0b53_716974.png) - -![接口文档](https://foruda.gitee.com/images/1687755822857820115/96054330_716974.png) +![](https://www.youlai.tech/storage/blog/2025/01/18/20250118183539.png) ## 项目源码 @@ -100,29 +95,34 @@ pnpm run dev ## 项目部署 +执行 `pnpm run build` 命令后,项目将被打包并生成 `dist` 目录。接下来,将 `dist` 目录下的文件上传到服务器 `/usr/share/nginx/html` 目录下,并配置 Nginx 进行反向代理。 + ```bash -# 项目打包 pnpm run build +``` -# 上传文件至远程服务器 -将本地打包生成的 dist 目录下的所有文件拷贝至服务器的 /usr/share/nginx/html 目录。 +以下是 Nginx 的配置示例: -# nginx.cofig 配置 +```nginx server { - listen 80; - server_name localhost; - location / { - root /usr/share/nginx/html; - index index.html index.htm; - } - # 反向代理配置 - location /prod-api/ { - # api.youlai.tech 替换后端API地址,注意保留后面的斜杠 / - proxy_pass http://api.youlai.tech/; - } + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + # 反向代理配置 + location /prod-api/ { + # 请将 api.youlai.tech 替换为您的后端 API 地址,并注意保留后面的斜杠 / + proxy_pass http://api.youlai.tech/; + } } ``` +更多详细信息,请参考这篇文章:[Nginx 安装和配置](https://blog.csdn.net/u013737132/article/details/145667694)。 + ## 本地Mock 项目同时支持在线和本地 Mock 接口,默认使用线上接口,如需替换为 Mock 接口,修改文件 `.env.development` 的 `VITE_MOCK_DEV_SERVER` 为 `true` **即可**。 @@ -166,8 +166,8 @@ server { - [基于 Vue3 + Vite + TypeScript + Element-Plus 从0到1搭建后台管理系统](https://blog.csdn.net/u013737132/article/details/130191394) -- [ESLint+Prettier+Stylelint+EditorConfig 约束和统一前端代码规范](https://blog.csdn.net/u013737132/article/details/130190788) -- [Husky + Lint-staged + Commitlint + Commitizen + cz-git 配置 Git 提交规范](https://blog.csdn.net/u013737132/article/details/130191363) +- [ESLint+Prettier+Stylelint+EditorConfig 约束和统一前端代码规范](https://youlai.blog.csdn.net/article/details/145608723) +- [Husky + Lint-staged + Commitlint + Commitizen + cz-git 配置 Git 提交规范](https://youlai.blog.csdn.net/article/details/145615236) ## 提交规范 @@ -190,15 +190,13 @@ Thanks to all the contributors! ![](https://foruda.gitee.com/images/1728577513089814203/95f2a70d_716974.jpeg) -## 交流群🚀 +## 加群交流 -> **关注「有来技术」公众号,获取交流群二维码。** +> **关注「有来技术」公众号,点击菜单“交流群”获取加群二维码。** > -> 如果交流群的二维码过期,请加微信(haoxianrui)并备注「前端」、「后端」或「全栈」以获取最新二维码。 +> 如果二维码过期,请加微信(haoxianrui)备注「前端」、「后端」或「全栈」拉你进群。 > -> 为确保交流群质量,防止营销广告人群混入,我们采取了此措施。望各位理解! +> 交流群仅限技术交流,为过滤广告营销暂设此门槛,感谢理解与配合 -| 公众号 | 交流群 | -|:----:|:----:| -| ![有来技术公众号二维码](https://foruda.gitee.com/images/1687689212187063809/3c69eaee_716974.png) | ![交流群二维码](https://foruda.gitee.com/images/1687689212139273561/6a65ef69_716974.png) | +![有来技术公众号二维码](https://foruda.gitee.com/images/1737108820762592766/3390ed0d_716974.png) diff --git a/commitlint.config.cjs b/commitlint.config.cjs index 4ecb995f..5f556e2c 100644 --- a/commitlint.config.cjs +++ b/commitlint.config.cjs @@ -74,9 +74,7 @@ module.exports = { breaklineNumber: 100, breaklineChar: "|", skipQuestions: [], - issuePrefixes: [ - { value: "closed", name: "closed: ISSUES has been processed" }, - ], + issuePrefixes: [{ value: "closed", name: "closed: ISSUES has been processed" }], customIssuePrefixAlign: "top", emptyIssuePrefixAlias: "skip", customIssuePrefixAlias: "custom", diff --git a/eslint.config.js b/eslint.config.js index f5997a7f..d952d1e7 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,115 +1,99 @@ +// https://eslint.nodejs.cn/docs/latest/use/configure/configuration-files + import globals from "globals"; -import js from "@eslint/js"; +import pluginJs from "@eslint/js"; // JavaScript 规则 +import pluginVue from "eslint-plugin-vue"; // Vue 规则 +import pluginTypeScript from "@typescript-eslint/eslint-plugin"; // TypeScript 规则 -// ESLint 核心插件 -import pluginVue from "eslint-plugin-vue"; -import pluginTypeScript from "@typescript-eslint/eslint-plugin"; +import parserVue from "vue-eslint-parser"; // Vue 解析器 +import parserTypeScript from "@typescript-eslint/parser"; // TypeScript 解析器 -// Prettier 插件及配置 -import configPrettier from "eslint-config-prettier"; -import pluginPrettier from "eslint-plugin-prettier"; +import configPrettier from "eslint-config-prettier"; // 禁用与 Prettier 冲突的规则 +import pluginPrettier from "eslint-plugin-prettier"; // 运行 Prettier 规则 -// 解析器 -import * as parserVue from "vue-eslint-parser"; -import * as parserTypeScript from "@typescript-eslint/parser"; +// 解析自动导入配置 +import fs from "fs"; +const autoImportConfig = JSON.parse(fs.readFileSync(".eslintrc-auto-import.json", "utf-8")); -// 定义 ESLint 配置 +/** @type {import('eslint').Linter.Config[]} */ export default [ - // 通用 JavaScript 配置 + // 指定检查文件和忽略文件 + { + files: ["**/*.{js,mjs,cjs,ts,vue}"], + ignores: ["**/*.d.ts"], + }, + // 全局配置 { - ...js.configs.recommended, - ignores: ["**/.*", "dist/*", "*.d.ts", "public/*", "src/assets/**"], languageOptions: { globals: { - ...globals.browser, // 浏览器变量 (window, document 等) - ...globals.node, // Node.js 变量 (process, require 等) + ...globals.browser, + ...globals.node, + ...autoImportConfig.globals, + ...{ + PageQuery: "readonly", + PageResult: "readonly", + OptionType: "readonly", + ResponseData: "readonly", + ExcelResult: "readonly", + TagView: "readonly", + AppSettings: "readonly", + __APP_INFO__: "readonly", + }, }, }, - plugins: { - prettier: pluginPrettier, - }, + plugins: { prettier: pluginPrettier }, rules: { - ...configPrettier.rules, - ...pluginPrettier.configs.recommended.rules, - "no-debug": "off", // 禁止 debugger - "prettier/prettier": [ + ...configPrettier.rules, // 关闭与 Prettier 冲突的规则 + ...pluginPrettier.configs.recommended.rules, // 启用 Prettier 规则 + "prettier/prettier": "error", // 强制 Prettier 格式化 + "no-unused-vars": [ "error", { - endOfLine: "auto", // 自动识别换行符 + argsIgnorePattern: "^_", // 忽略参数名以 _ 开头的参数未使用警告 + varsIgnorePattern: "^[A-Z0-9_]+$", // 忽略变量名为大写字母、数字或下划线组合的未使用警告(枚举定义未使用场景) + ignoreRestSiblings: true, // 忽略解构赋值中同级未使用变量的警告 }, ], }, }, + // JavaScript 配置 + pluginJs.configs.recommended, // TypeScript 配置 { - files: ["**/*.?([cm])ts"], + files: ["**/*.ts"], + ignores: ["**/*.d.ts"], // 排除d.ts文件 languageOptions: { parser: parserTypeScript, parserOptions: { sourceType: "module", }, }, - plugins: { - "@typescript-eslint": pluginTypeScript, - }, + plugins: { "@typescript-eslint": pluginTypeScript }, rules: { - ...pluginTypeScript.configs.strict.rules, + ...pluginTypeScript.configs.strict.rules, // TypeScript 严格规则 "@typescript-eslint/no-explicit-any": "off", // 允许使用 any "@typescript-eslint/no-empty-function": "off", // 允许空函数 "@typescript-eslint/no-empty-object-type": "off", // 允许空对象类型 - "@typescript-eslint/consistent-type-imports": [ - "error", - { disallowTypeAnnotations: false, fixStyle: "inline-type-imports" }, - ], // 统一类型导入风格 }, }, - // TypeScript 声明文件的特殊配置 - { - files: ["**/*.d.ts"], - rules: { - "eslint-comments/no-unlimited-disable": "off", - "unused-imports/no-unused-vars": "off", - "@typescript-eslint/ban-ts-comment": "off", // 允许使用 @ts-nocheck 注释 - }, - }, - - // JavaScript (commonjs) 配置 - { - files: ["**/*.?([cm])js"], - rules: { - "@typescript-eslint/no-var-requires": "off", // 允许 require - }, - }, - - // Vue 文件配置 + // Vue 配置 { files: ["**/*.vue"], languageOptions: { parser: parserVue, parserOptions: { - parser: "@typescript-eslint/parser", + parser: parserTypeScript, sourceType: "module", }, }, - plugins: { - vue: pluginVue, - }, + plugins: { vue: pluginVue, "@typescript-eslint": pluginTypeScript }, processor: pluginVue.processors[".vue"], rules: { - ...pluginVue.configs["vue3-recommended"].rules, + ...pluginVue.configs["vue3-recommended"].rules, // Vue 3 推荐规则 "vue/no-v-html": "off", // 允许 v-html - "vue/require-default-prop": "off", // 允许没有默认值的 prop - "vue/multi-word-component-names": "off", // 关闭组件名称多词要求 - "vue/html-self-closing": [ - "error", - { - html: { void: "always", normal: "always", component: "always" }, - svg: "always", - math: "always", - }, - ], // 自闭合标签 + "vue/multi-word-component-names": "off", // 允许单个单词组件名 }, }, ]; diff --git a/package.json b/package.json index ff1502d3..6fead508 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue3-element-admin", - "version": "2.20.4", + "version": "2.23.0", "private": true, "type": "module", "scripts": { @@ -9,9 +9,9 @@ "preview": "vite preview", "build-only": "vite build", "type-check": "vue-tsc --noEmit", - "lint:eslint": "eslint --fix ./src", - "lint:prettier": "prettier --write \"**/*.{js,cjs,ts,json,tsx,css,less,scss,vue,html,md}\"", - "lint:stylelint": "stylelint \"**/*.{css,scss,vue}\" --fix", + "lint:eslint": "eslint --cache \"src/**/*.{vue,ts}\" --fix", + "lint:prettier": "prettier --write \"**/*.{js,cjs,ts,json,css,scss,vue,html,md}\"", + "lint:stylelint": "stylelint --cache \"**/*.{css,scss,vue}\" --fix", "lint:lint-staged": "lint-staged", "preinstall": "npx only-allow pnpm", "prepare": "husky", @@ -46,70 +46,73 @@ "dependencies": { "@element-plus/icons-vue": "^2.3.1", "@stomp/stompjs": "^7.0.0", - "@vueuse/core": "^10.11.1", - "@wangeditor/editor": "^5.1.23", - "@wangeditor/editor-for-vue": "5.1.10", + "@vueuse/core": "^12.6.1", + "@wangeditor-next/editor": "^5.6.31", + "@wangeditor-next/editor-for-vue": "^5.1.14", + "animate.css": "^4.1.1", "axios": "^1.7.9", "codemirror": "^5.65.18", "codemirror-editor-vue3": "^2.8.0", + "default-passive-events": "^2.0.0", "echarts": "^5.6.0", - "element-plus": "^2.9.3", + "element-plus": "^2.9.4", "exceljs": "^4.4.0", "lodash-es": "^4.17.21", "nprogress": "^0.2.0", "path-browserify": "^1.0.1", - "path-to-regexp": "^6.3.0", - "pinia": "^2.3.0", + "path-to-regexp": "^8.2.0", + "pinia": "^3.0.1", "qs": "^6.14.0", "sortablejs": "^1.15.6", "vue": "^3.5.13", - "vue-i18n": "9.9.1", + "vue-i18n": "^11.1.1", "vue-router": "^4.5.0" }, "devDependencies": { - "@commitlint/cli": "^19.6.1", - "@commitlint/config-conventional": "^19.6.0", - "@eslint/js": "^9.18.0", + "@commitlint/cli": "^19.7.1", + "@commitlint/config-conventional": "^19.7.1", + "@eslint/js": "^9.20.0", + "@iconify/utils": "^2.3.0", "@types/codemirror": "^5.60.15", - "@types/lodash": "^4.17.14", - "@types/node": "^22.10.7", + "@types/lodash-es": "^4.17.12", + "@types/node": "^22.13.4", "@types/nprogress": "^0.2.3", "@types/path-browserify": "^1.0.3", "@types/qs": "^6.9.18", "@types/sortablejs": "^1.15.8", - "@typescript-eslint/eslint-plugin": "^8.20.0", - "@typescript-eslint/parser": "^8.20.0", + "@typescript-eslint/eslint-plugin": "^8.24.0", + "@typescript-eslint/parser": "^8.24.0", "@vitejs/plugin-vue": "^5.2.1", "autoprefixer": "^10.4.20", "commitizen": "^4.3.1", - "cz-git": "1.9.4", - "eslint": "^9.18.0", - "eslint-config-prettier": "^9.1.0", + "cz-git": "^1.11.0", + "eslint": "^9.20.1", + "eslint-config-prettier": "^10.0.1", "eslint-plugin-prettier": "^5.2.3", "eslint-plugin-vue": "^9.32.0", - "globals": "^15.14.0", + "globals": "^15.15.0", "husky": "^9.1.7", - "lint-staged": "^15.4.1", - "postcss": "^8.5.1", + "lint-staged": "^15.4.3", + "postcss": "^8.5.2", "postcss-html": "^1.8.0", "postcss-scss": "^4.0.9", - "prettier": "^3.4.2", - "sass": "^1.83.4", - "stylelint": "^16.13.2", + "prettier": "^3.5.1", + "sass": "^1.85.0", + "stylelint": "^16.14.1", "stylelint-config-html": "^1.1.0", - "stylelint-config-recess-order": "^5.1.1", + "stylelint-config-recess-order": "^6.0.0", + "stylelint-config-recommended": "^15.0.0", "stylelint-config-recommended-scss": "^14.1.0", - "stylelint-config-recommended-vue": "^1.5.0", - "stylelint-config-standard": "^36.0.1", - "terser": "^5.37.0", - "typescript": "5.5.4", - "typescript-eslint": "^8.20.0", - "unocss": "0.65.3", - "unplugin-auto-import": "^0.18.6", - "unplugin-vue-components": "^0.27.5", - "vite": "^6.0.7", - "vite-plugin-mock-dev-server": "^1.8.3", - "vite-plugin-svg-icons": "^2.0.1", + "stylelint-config-recommended-vue": "^1.6.0", + "stylelint-prettier": "^5.0.3", + "terser": "^5.39.0", + "typescript": "^5.7.3", + "typescript-eslint": "^8.24.0", + "unocss": "65.4.3", + "unplugin-auto-import": "^19.0.0", + "unplugin-vue-components": "^28.0.0", + "vite": "^6.1.0", + "vite-plugin-mock-dev-server": "^1.8.4", "vue-eslint-parser": "^9.4.3", "vue-tsc": "^2.2.0" }, diff --git a/src/api/auth/index.ts b/src/api/auth/index.ts index ec95620c..64fb97b2 100644 --- a/src/api/auth/index.ts +++ b/src/api/auth/index.ts @@ -22,19 +22,17 @@ const AuthAPI = { /** 刷新 token 接口*/ refreshToken(refreshToken: string) { - const formData = new FormData(); - formData.append("refreshToken", refreshToken); return request({ url: `${AUTH_BASE_URL}/refresh-token`, method: "post", - data: formData, + params: { refreshToken: refreshToken }, headers: { Authorization: "no-auth", }, }); }, - /** 注销接口 */ + /** 注销登录接口 */ logout() { return request({ url: `${AUTH_BASE_URL}/logout`, diff --git a/src/api/file/index.ts b/src/api/file/index.ts index 509e6955..0b109772 100644 --- a/src/api/file/index.ts +++ b/src/api/file/index.ts @@ -2,16 +2,25 @@ import request from "@/utils/request"; const FileAPI = { /** - * 文件上传地址 + * 上传文件 + * + * @param formData */ - uploadUrl: import.meta.env.VITE_APP_BASE_API + "/api/v1/files", + upload(formData: FormData) { + return request({ + url: "/api/v1/files", + method: "post", + data: formData, + headers: { + "Content-Type": "multipart/form-data", + }, + }); + }, /** * 上传文件 - * - * @param file */ - upload(file: File) { + uploadFile(file: File) { const formData = new FormData(); formData.append("file", file); return request({ @@ -29,7 +38,7 @@ const FileAPI = { * * @param filePath 文件完整路径 */ - deleteByPath(filePath?: string) { + delete(filePath?: string) { return request({ url: "/api/v1/files", method: "delete", @@ -42,7 +51,7 @@ const FileAPI = { * @param url * @param fileName */ - downloadFile(url: string, fileName?: string) { + download(url: string, fileName?: string) { return request({ url: url, method: "get", diff --git a/src/components/CURD/PageContent.vue b/src/components/CURD/PageContent.vue index e8a408f7..f079d934 100644 --- a/src/components/CURD/PageContent.vue +++ b/src/components/CURD/PageContent.vue @@ -240,7 +240,7 @@ @@ -453,7 +453,6 @@ diff --git a/src/components/Fullscreen/index.vue b/src/components/Fullscreen/index.vue index bd85b4b4..bd888fe3 100644 --- a/src/components/Fullscreen/index.vue +++ b/src/components/Fullscreen/index.vue @@ -1,6 +1,6 @@ diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue index 1c0642a4..4b624c96 100644 --- a/src/components/Hamburger/index.vue +++ b/src/components/Hamburger/index.vue @@ -1,10 +1,6 @@ - @@ -25,13 +21,25 @@ function toggleClick() { diff --git a/src/components/IconSelect/index.vue b/src/components/IconSelect/index.vue index 006158a1..b96e93e4 100644 --- a/src/components/IconSelect/index.vue +++ b/src/components/IconSelect/index.vue @@ -11,7 +11,7 @@