From 90625782c02ba3a4dc6ab8178c352e64c417ae83 Mon Sep 17 00:00:00 2001 From: afe1 <2279948211@qq.com> Date: Thu, 8 May 2025 16:51:12 +0800 Subject: [PATCH 1/6] fix: delete useless code (#6143) --- apps/web-antd/src/router/guard.ts | 2 +- apps/web-ele/src/router/guard.ts | 2 +- apps/web-naive/src/router/guard.ts | 2 +- playground/src/router/guard.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web-antd/src/router/guard.ts b/apps/web-antd/src/router/guard.ts index e12766f9..a1ad6d88 100644 --- a/apps/web-antd/src/router/guard.ts +++ b/apps/web-antd/src/router/guard.ts @@ -18,7 +18,7 @@ function setupCommonGuard(router: Router) { // 记录已经加载的页面 const loadedPaths = new Set(); - router.beforeEach(async (to) => { + router.beforeEach((to) => { to.meta.loaded = loadedPaths.has(to.path); // 页面加载进度条 diff --git a/apps/web-ele/src/router/guard.ts b/apps/web-ele/src/router/guard.ts index e12766f9..a1ad6d88 100644 --- a/apps/web-ele/src/router/guard.ts +++ b/apps/web-ele/src/router/guard.ts @@ -18,7 +18,7 @@ function setupCommonGuard(router: Router) { // 记录已经加载的页面 const loadedPaths = new Set(); - router.beforeEach(async (to) => { + router.beforeEach((to) => { to.meta.loaded = loadedPaths.has(to.path); // 页面加载进度条 diff --git a/apps/web-naive/src/router/guard.ts b/apps/web-naive/src/router/guard.ts index 4810f13a..28d1cea7 100644 --- a/apps/web-naive/src/router/guard.ts +++ b/apps/web-naive/src/router/guard.ts @@ -18,7 +18,7 @@ function setupCommonGuard(router: Router) { // 记录已经加载的页面 const loadedPaths = new Set(); - router.beforeEach(async (to) => { + router.beforeEach((to) => { to.meta.loaded = loadedPaths.has(to.path); // 页面加载进度条 diff --git a/playground/src/router/guard.ts b/playground/src/router/guard.ts index 11ac9479..3bbe8dca 100644 --- a/playground/src/router/guard.ts +++ b/playground/src/router/guard.ts @@ -18,7 +18,7 @@ function setupCommonGuard(router: Router) { // 记录已经加载的页面 const loadedPaths = new Set(); - router.beforeEach(async (to) => { + router.beforeEach((to) => { to.meta.loaded = loadedPaths.has(to.path); // 页面加载进度条 From 9e67929ee786b204358a556119976dd2b79acbbb Mon Sep 17 00:00:00 2001 From: anyup <85225562+anyup@users.noreply.github.com> Date: Sat, 10 May 2025 22:33:31 +0800 Subject: [PATCH 2/6] feat: support to refresh the tab page by route name (#6153) Co-authored-by: anyup --- packages/effects/hooks/src/use-tabs.ts | 4 ++-- packages/stores/src/modules/tabbar.ts | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/effects/hooks/src/use-tabs.ts b/packages/effects/hooks/src/use-tabs.ts index 60f70f14..25bc4883 100644 --- a/packages/effects/hooks/src/use-tabs.ts +++ b/packages/effects/hooks/src/use-tabs.ts @@ -41,8 +41,8 @@ export function useTabs() { await tabbarStore.toggleTabPin(tab || route); } - async function refreshTab() { - await tabbarStore.refresh(router); + async function refreshTab(name?: string) { + await tabbarStore.refresh(name || router); } async function openTabInNewWindow(tab?: RouteLocationNormalized) { diff --git a/packages/stores/src/modules/tabbar.ts b/packages/stores/src/modules/tabbar.ts index ec64bdc4..234bb02f 100644 --- a/packages/stores/src/modules/tabbar.ts +++ b/packages/stores/src/modules/tabbar.ts @@ -334,7 +334,13 @@ export const useTabbarStore = defineStore('core-tabbar', { /** * 刷新标签页 */ - async refresh(router: Router) { + async refresh(router: Router | string) { + // 如果是Router路由,那么就根据当前路由刷新 + // 如果是string字符串,为路由名称,则定向刷新指定标签页,不能是当前路由名称,否则不会刷新 + if (typeof router === 'string') { + return await this.refreshByName(router); + } + const { currentRoute } = router; const { name } = currentRoute.value; @@ -349,6 +355,15 @@ export const useTabbarStore = defineStore('core-tabbar', { stopProgress(); }, + /** + * 根据路由名称刷新指定标签页 + */ + async refreshByName(name: string) { + this.excludeCachedTabs.add(name); + await new Promise((resolve) => setTimeout(resolve, 200)); + this.excludeCachedTabs.delete(name); + }, + /** * @zh_CN 重置标签页标题 */ From e89cf400c0da2f2369dfbd8963cb83ec2eb4fa29 Mon Sep 17 00:00:00 2001 From: Netfan Date: Mon, 12 May 2025 23:34:08 +0800 Subject: [PATCH 3/6] fix: refresh command of tabbar issue, fixed: #6162 (#6169) --- packages/effects/layouts/src/basic/tabbar/use-tabbar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/effects/layouts/src/basic/tabbar/use-tabbar.ts b/packages/effects/layouts/src/basic/tabbar/use-tabbar.ts index b0146ef6..f254a6d3 100644 --- a/packages/effects/layouts/src/basic/tabbar/use-tabbar.ts +++ b/packages/effects/layouts/src/basic/tabbar/use-tabbar.ts @@ -158,7 +158,7 @@ export function useTabbar() { }, { disabled: disabledRefresh, - handler: refreshTab, + handler: () => refreshTab(), icon: RotateCw, key: 'reload', text: $t('preferences.tabbar.contextMenu.reload'), From cd4706b7175d2504e9a782efbb320113b34ac415 Mon Sep 17 00:00:00 2001 From: zhangl1438 Date: Wed, 14 May 2025 11:45:43 +0800 Subject: [PATCH 4/6] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E9=BB=98=E8=AE=A4oss=20config=E5=90=8E=EF=BC=8C=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=96=87=E4=BB=B6=E6=8A=A5=E9=94=99=EF=BC=9A=E2=80=9C?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=AD=98=E5=82=A8=E6=9C=8D=E5=8A=A1=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=97=A0=E6=B3=95=E6=89=BE=E5=88=B0=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/system/oss-config/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/web-antd/src/api/system/oss-config/index.ts b/apps/web-antd/src/api/system/oss-config/index.ts index 739717be..1ba97e3c 100644 --- a/apps/web-antd/src/api/system/oss-config/index.ts +++ b/apps/web-antd/src/api/system/oss-config/index.ts @@ -40,6 +40,7 @@ export function ossConfigChangeStatus(data: any) { const requestData = { ossConfigId: data.ossConfigId, status: data.status, + configKey: data.configKey, }; return requestClient.putWithMsg(Api.ossConfigChangeStatus, requestData); } From 1f50c95c6642c6fe76791263945ea881a0140fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=93=A6=E6=98=AF=E5=90=97?= <1733179386@qq.com> Date: Thu, 15 May 2025 07:38:02 +0000 Subject: [PATCH 5/6] =?UTF-8?q?update=20apps/web-antd/src/components/uploa?= =?UTF-8?q?d/src/hook.ts.=20fix:=20=E4=B8=8A=E4=BC=A0=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=E7=BB=91=E5=AE=9A=E5=80=BC=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E6=B8=85=E7=A9=BAinnerFileList=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=A4=96=E9=83=A8=E4=BD=BF=E7=94=A8=E6=97=B6?= =?UTF-8?q?=E8=BF=98=E8=83=BD=E8=AF=BB=E5=8F=96=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 哦是吗 <1733179386@qq.com> --- apps/web-antd/src/components/upload/src/hook.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/web-antd/src/components/upload/src/hook.ts b/apps/web-antd/src/components/upload/src/hook.ts index 938114df..f7451518 100644 --- a/apps/web-antd/src/components/upload/src/hook.ts +++ b/apps/web-antd/src/components/upload/src/hook.ts @@ -322,6 +322,8 @@ export function useUpload( () => bindValue.value, async (value) => { if (value.length === 0) { + // 清空绑定值时,同时清空innerFileList,避免外部使用时还能读取到 + innerFileList.value = []; return; } From 10b8b81954b1c4414765d8177c6c8a54cd91fc10 Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Fri, 16 May 2025 10:06:51 +0800 Subject: [PATCH 6/6] docs: version update --- CHANGELOG.md | 7 +++++++ apps/web-antd/package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8259e1c5..ca32d0aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 1.3.6 + +**BUG FIX** + +- oss配置switch切换 导致报错`存储类型找不到` +- 文件上传无法正确清除(innerList) + # 1.3.5 **BUG FIX** diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index 4fb1d098..d5d0c0d7 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -1,6 +1,6 @@ { "name": "@vben/web-antd", - "version": "1.3.5", + "version": "1.3.6", "homepage": "https://vben.pro", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": {