Skip to content

Commit d69cc3b

Browse files
timi137137liweijie0812ngyyuusora
authored
chore: sync main for develop (#549)
* feat: upgrade vite4 (#533) * chore: 升级vite4 * docs: 项目简介 修改 * fix: 打包后预览提示TypeError * chore: @vitejs/plugin-vue,@vitejs/plugin-vue-jsx升级 * docs: 项目简介 修改 * fix: 204无内容直接返回判断 (#539) * feat(axios util): support params stringify (#544) * fix(permission store): clear routes when logout (#545) fix #541 * chore: release 0.7.7 (#548) * chore: release 0.7.7 * chore: dump tdesign version --------- Co-authored-by: liweijie0812 <674416404@qq.com> Co-authored-by: ngyyuusora <jiliangsoft@live.com>
1 parent 95039ea commit d69cc3b

File tree

8 files changed

+37
-23
lines changed

8 files changed

+37
-23
lines changed

README-zh_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
### 项目简介
2121

22-
TDesign Vue Next Starter 是一个基于 TDesign,使用 `Vue3``Vite2``Pinia``TypeScript` 开发,可进行个性化主题配置,旨在提供项目开箱即用的、配置式的中后台项目。
22+
TDesign Vue Next Starter 是一个基于 TDesign,使用 `Vue3``Vite``Pinia``TypeScript` 开发,可进行个性化主题配置,旨在提供项目开箱即用的、配置式的中后台项目。
2323

2424
<p>
2525
<a href="http://tdesign.tencent.com/starter/vue-next/">在线预览</a>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
English | [简体中文](./README-zh_CN.md)
1818
### Introduction
1919

20-
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.
20+
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.
2121

2222
<p>
2323
<a href="http://tdesign.tencent.com/starter/vue-next/">Live Preview</a>

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tencent/tdesign-vue-next-starter",
3-
"version": "0.7.6",
3+
"version": "0.7.7",
44
"scripts": {
55
"dev:mock": "vite --open --mode mock",
66
"dev": "vite --open --mode development",
@@ -19,8 +19,8 @@
1919
"test:coverage": "echo \"no test:coverage specified,work in process\""
2020
},
2121
"dependencies": {
22-
"axios": "^1.3.4",
23-
"dayjs": "^1.11.7",
22+
"axios": "^1.4.0",
23+
"dayjs": "^1.11.8",
2424
"echarts": "5.1.2",
2525
"lodash": "^4.17.21",
2626
"nprogress": "^0.2.0",
@@ -29,11 +29,11 @@
2929
"qrcode.vue": "^3.3.4",
3030
"qs": "^6.11.1",
3131
"tdesign-icons-vue-next": "^0.1.11",
32-
"tdesign-vue-next": "^1.3.4",
32+
"tdesign-vue-next": "^1.3.8",
3333
"tvision-color": "^1.6.0",
34-
"vue": "^3.2.47",
34+
"vue": "^3.3.4",
3535
"vue-clipboard3": "^2.0.0",
36-
"vue-router": "~4.1.6"
36+
"vue-router": "~4.2.2"
3737
},
3838
"devDependencies": {
3939
"@commitlint/cli": "^17.3.0",
@@ -44,8 +44,8 @@
4444
"@types/qs": "^6.9.7",
4545
"@typescript-eslint/eslint-plugin": "^5.47.1",
4646
"@typescript-eslint/parser": "^5.47.1",
47-
"@vitejs/plugin-vue": "^3.2.0",
48-
"@vitejs/plugin-vue-jsx": "^1.3.10",
47+
"@vitejs/plugin-vue": "^4.2.3 ",
48+
"@vitejs/plugin-vue-jsx": "^3.0.1 ",
4949
"@vue/compiler-sfc": "^3.2.47",
5050
"@vue/eslint-config-typescript": "^11.0.2",
5151
"commitizen": "^4.2.4",
@@ -70,10 +70,10 @@
7070
"stylelint-less": "1.0.6",
7171
"stylelint-order": "~6.0.1",
7272
"typescript": "~4.9.5",
73-
"vite": "^3.2.5",
73+
"vite": "^4.3.9",
7474
"vite-plugin-mock": "^2.9.6",
7575
"vite-svg-loader": "^4.0.0",
76-
"vue-tsc": "^1.2.0"
76+
"vue-tsc": "^1.8.2"
7777
},
7878
"config": {
7979
"commitizen": {

src/pages/dashboard/base/components/MiddleChart.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
</template>
1616
<div
1717
id="monitorContainer"
18-
ref="monitorContainer"
1918
class="dashboard-chart-container"
2019
:style="{ width: '100%', height: `${resizeTime * 326}px` }"
2120
/>
@@ -25,7 +24,6 @@
2524
<t-card title="销售渠道" :subtitle="currentMonth" class="dashboard-chart-card" :bordered="false">
2625
<div
2726
id="countContainer"
28-
ref="countContainer"
2927
:style="{ width: `${resizeTime * 326}px`, height: `${resizeTime * 326}px`, margin: '0 auto' }"
3028
class="dashboard-chart-container"
3129
/>

src/pages/dashboard/base/components/OutputOverview.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@
1717
@change="onStokeDataChange"
1818
/>
1919
</template>
20-
<div
21-
id="stokeContainer"
22-
ref="stokeContainer"
23-
style="width: 100%; height: 351px"
24-
class="dashboard-chart-container"
25-
></div>
20+
<div id="stokeContainer" style="width: 100%; height: 351px" class="dashboard-chart-container"></div>
2621
</t-card>
2722
</t-col>
2823
<t-col :xs="12" :xl="3">

src/store/modules/permission.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@ export const usePermissionStore = defineStore('permission', {
3737
}
3838
},
3939
async restoreRoutes() {
40-
this.removeRoutes.forEach((item: RouteRecordRaw) => {
41-
router.addRoute(item);
40+
// 不需要在此额外调用initRoutes更新侧边导肮内容,在登录后asyncRoutes为空会调用
41+
this.asyncRoutes.forEach((item: RouteRecordRaw) => {
42+
if (item.name) {
43+
router.removeRoute(item.name);
44+
}
4245
});
46+
this.asyncRoutes = [];
4347
},
4448
},
4549
});

src/utils/request/Axios.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,21 @@ export class VAxios {
118118
};
119119
}
120120

121+
// 支持params数组参数格式化
122+
supportParamsStringify(config: AxiosRequestConfig) {
123+
const headers = config.headers || this.options.headers;
124+
const contentType = headers?.['Content-Type'] || headers?.['content-type'];
125+
126+
if (contentType === ContentTypeEnum.FormURLEncoded || !Reflect.has(config, 'params')) {
127+
return config;
128+
}
129+
130+
return {
131+
...config,
132+
paramsSerializer: (params: any) => stringify(params, { arrayFormat: 'brackets' }),
133+
};
134+
}
135+
121136
get<T = any>(config: AxiosRequestConfig, options?: RequestOptions): Promise<T> {
122137
return this.request({ ...config, method: 'GET' }, options);
123138
}
@@ -154,6 +169,8 @@ export class VAxios {
154169
conf.requestOptions = opt;
155170

156171
conf = this.supportFormData(conf);
172+
// 支持params数组参数格式化,因axios默认的toFormData即为brackets方式,无需配置paramsSerializer为qs,有需要可解除注释,参数参考qs文档
173+
// conf = this.supportParamsStringify(conf);
157174

158175
return new Promise((resolve, reject) => {
159176
this.instance

src/utils/request/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const transform: AxiosTransform = {
2323

2424
// 如果204无内容直接返回
2525
const method = res.config.method?.toLowerCase();
26-
if (res.status === 204 || method === 'put' || method === 'patch') {
26+
if (res.status === 204 && ['put', 'patch', 'delete'].includes(method)) {
2727
return res;
2828
}
2929

0 commit comments

Comments
 (0)