From 45555455628ed60ed5b99106a91acfc8a2b9ccdf Mon Sep 17 00:00:00 2001 From: liweijie0812 <674416404@qq.com> Date: Thu, 1 Jun 2023 14:12:23 +0800 Subject: [PATCH 01/14] feat: upgrade vite4 (#533) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 升级vite4 * docs: 项目简介 修改 * fix: 打包后预览提示TypeError * chore: @vitejs/plugin-vue,@vitejs/plugin-vue-jsx升级 * docs: 项目简介 修改 --- README-zh_CN.md | 2 +- README.md | 2 +- package.json | 6 +++--- src/pages/dashboard/base/components/MiddleChart.vue | 2 -- src/pages/dashboard/base/components/OutputOverview.vue | 7 +------ 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/README-zh_CN.md b/README-zh_CN.md index 0a41c9c..63b71ae 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -19,7 +19,7 @@ ### 项目简介 -TDesign Vue Next Starter 是一个基于 TDesign,使用 `Vue3`、`Vite2`、`Pinia`、`TypeScript` 开发,可进行个性化主题配置,旨在提供项目开箱即用的、配置式的中后台项目。 +TDesign Vue Next Starter 是一个基于 TDesign,使用 `Vue3`、`Vite`、`Pinia`、`TypeScript` 开发,可进行个性化主题配置,旨在提供项目开箱即用的、配置式的中后台项目。

在线预览 diff --git a/README.md b/README.md index 75dedab..823d502 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ English | [简体中文](./README-zh_CN.md) ### Introduction -TDesign Vue Next Starter is a TDesign-based developed with `Vue 3`, `Vite 3+`, `Pinia`, `TypeScript`. It can be customized theme configuration, and aims to provide project out-of-the-box, configuration-style middle and background projects. +TDesign Vue Next Starter is a TDesign-based developed with `Vue 3`, `Vite`, `Pinia`, `TypeScript`. It can be customized theme configuration, and aims to provide project out-of-the-box, configuration-style middle and background projects.

Live Preview diff --git a/package.json b/package.json index 04786a9..8c980e9 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,8 @@ "@types/qs": "^6.9.7", "@typescript-eslint/eslint-plugin": "^5.47.1", "@typescript-eslint/parser": "^5.47.1", - "@vitejs/plugin-vue": "^3.2.0", - "@vitejs/plugin-vue-jsx": "^1.3.10", + "@vitejs/plugin-vue": "^4.2.3 ", + "@vitejs/plugin-vue-jsx": "^3.0.1 ", "@vue/compiler-sfc": "^3.2.47", "@vue/eslint-config-typescript": "^11.0.2", "commitizen": "^4.2.4", @@ -70,7 +70,7 @@ "stylelint-less": "1.0.6", "stylelint-order": "~6.0.1", "typescript": "~4.9.5", - "vite": "^3.2.5", + "vite": "^4.3.9", "vite-plugin-mock": "^2.9.6", "vite-svg-loader": "^4.0.0", "vue-tsc": "^1.2.0" diff --git a/src/pages/dashboard/base/components/MiddleChart.vue b/src/pages/dashboard/base/components/MiddleChart.vue index 32cbec9..26ec54f 100644 --- a/src/pages/dashboard/base/components/MiddleChart.vue +++ b/src/pages/dashboard/base/components/MiddleChart.vue @@ -15,7 +15,6 @@

@@ -25,7 +24,6 @@
diff --git a/src/pages/dashboard/base/components/OutputOverview.vue b/src/pages/dashboard/base/components/OutputOverview.vue index a71dac0..3f045f7 100644 --- a/src/pages/dashboard/base/components/OutputOverview.vue +++ b/src/pages/dashboard/base/components/OutputOverview.vue @@ -17,12 +17,7 @@ @change="onStokeDataChange" /> -
+
From 83939b7517fe63bfc7d61d0053ec8717ecd3153f Mon Sep 17 00:00:00 2001 From: liweijie0812 <674416404@qq.com> Date: Fri, 2 Jun 2023 16:03:02 +0800 Subject: [PATCH 02/14] =?UTF-8?q?fix:=20204=E6=97=A0=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=BF=94=E5=9B=9E=E5=88=A4=E6=96=AD=20(#539)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/request/index.ts b/src/utils/request/index.ts index e2da3cc..386d67a 100644 --- a/src/utils/request/index.ts +++ b/src/utils/request/index.ts @@ -23,7 +23,7 @@ const transform: AxiosTransform = { // 如果204无内容直接返回 const method = res.config.method?.toLowerCase(); - if (res.status === 204 || method === 'put' || method === 'patch') { + if (res.status === 204 && ['put', 'patch', 'delete'].includes(method)) { return res; } From 9d8bf86059dfee689eb132c6f12e2bdb4dd4f93d Mon Sep 17 00:00:00 2001 From: ngyyuusora Date: Mon, 19 Jun 2023 19:38:44 +0800 Subject: [PATCH 03/14] feat(axios util): support params stringify (#544) --- src/utils/request/Axios.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/utils/request/Axios.ts b/src/utils/request/Axios.ts index fdb5c9c..5ad0b8e 100644 --- a/src/utils/request/Axios.ts +++ b/src/utils/request/Axios.ts @@ -118,6 +118,21 @@ export class VAxios { }; } + // 支持params数组参数格式化 + supportParamsStringify(config: AxiosRequestConfig) { + const headers = config.headers || this.options.headers; + const contentType = headers?.['Content-Type'] || headers?.['content-type']; + + if (contentType === ContentTypeEnum.FormURLEncoded || !Reflect.has(config, 'params')) { + return config; + } + + return { + ...config, + paramsSerializer: (params: any) => stringify(params, { arrayFormat: 'brackets' }), + }; + } + get(config: AxiosRequestConfig, options?: RequestOptions): Promise { return this.request({ ...config, method: 'GET' }, options); } @@ -154,6 +169,8 @@ export class VAxios { conf.requestOptions = opt; conf = this.supportFormData(conf); + // 支持params数组参数格式化,因axios默认的toFormData即为brackets方式,无需配置paramsSerializer为qs,有需要可解除注释,参数参考qs文档 + // conf = this.supportParamsStringify(conf); return new Promise((resolve, reject) => { this.instance From 8194b3d2533ec5e23d6115231a2331fb86ceb7be Mon Sep 17 00:00:00 2001 From: ngyyuusora Date: Tue, 20 Jun 2023 23:33:11 +0800 Subject: [PATCH 04/14] fix(permission store): clear routes when logout (#545) fix #541 --- src/store/modules/permission.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 94892f6..b0e81b3 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -37,9 +37,13 @@ export const usePermissionStore = defineStore('permission', { } }, async restoreRoutes() { - this.removeRoutes.forEach((item: RouteRecordRaw) => { - router.addRoute(item); + // 不需要在此额外调用initRoutes更新侧边导肮内容,在登录后asyncRoutes为空会调用 + this.asyncRoutes.forEach((item: RouteRecordRaw) => { + if (item.name) { + router.removeRoute(item.name); + } }); + this.asyncRoutes = []; }, }, }); From 5b1e9a4d77d889dd28eceb29b043dd32bf5dfe63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=82=A0=E9=9D=99=E8=90=9D=E8=8E=89?= Date: Tue, 27 Jun 2023 11:03:07 +0800 Subject: [PATCH 05/14] chore: release 0.7.7 (#548) * chore: release 0.7.7 * chore: dump tdesign version --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 8c980e9..e2df45e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tencent/tdesign-vue-next-starter", - "version": "0.7.6", + "version": "0.7.7", "scripts": { "dev:mock": "vite --open --mode mock", "dev": "vite --open --mode development", @@ -19,8 +19,8 @@ "test:coverage": "echo \"no test:coverage specified,work in process\"" }, "dependencies": { - "axios": "^1.3.4", - "dayjs": "^1.11.7", + "axios": "^1.4.0", + "dayjs": "^1.11.8", "echarts": "5.1.2", "lodash": "^4.17.21", "nprogress": "^0.2.0", @@ -29,11 +29,11 @@ "qrcode.vue": "^3.3.4", "qs": "^6.11.1", "tdesign-icons-vue-next": "^0.1.11", - "tdesign-vue-next": "^1.3.4", + "tdesign-vue-next": "^1.3.8", "tvision-color": "^1.6.0", - "vue": "^3.2.47", + "vue": "^3.3.4", "vue-clipboard3": "^2.0.0", - "vue-router": "~4.1.6" + "vue-router": "~4.2.2" }, "devDependencies": { "@commitlint/cli": "^17.3.0", @@ -73,7 +73,7 @@ "vite": "^4.3.9", "vite-plugin-mock": "^2.9.6", "vite-svg-loader": "^4.0.0", - "vue-tsc": "^1.2.0" + "vue-tsc": "^1.8.2" }, "config": { "commitizen": { From d4ffc9967e8560bfde08f6aa6159f043c85295d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 15:24:26 +0800 Subject: [PATCH 06/14] build(deps-dev): bump typescript from 4.9.5 to 5.1.6 (#551) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.9.5 to 5.1.6. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/commits) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e2df45e..3d1b009 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "stylelint-config-prettier": "~9.0.4", "stylelint-less": "1.0.6", "stylelint-order": "~6.0.1", - "typescript": "~4.9.5", + "typescript": "~5.1.6", "vite": "^4.3.9", "vite-plugin-mock": "^2.9.6", "vite-svg-loader": "^4.0.0", From 78595657c687f95b19d9a3d68a221d3f70ac407e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=A8=E9=B1=BC=E8=BE=A3=E6=A4=92?= <82007768+tanhh326@users.noreply.github.com> Date: Thu, 6 Jul 2023 12:00:37 +0800 Subject: [PATCH 07/14] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A2=91?= =?UTF-8?q?=E7=B9=81=E5=88=87=E6=8D=A2=E8=B7=AF=E7=94=B1=E6=97=B6=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=A4=B4=E6=BB=9E=E7=95=99=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#550)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🌩 --- src/layouts/components/Content.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/components/Content.vue b/src/layouts/components/Content.vue index 4d4780c..e7ef8a2 100644 --- a/src/layouts/components/Content.vue +++ b/src/layouts/components/Content.vue @@ -1,6 +1,6 @@