From 5459f4f2467d77de814cd9c0f3dca32357d7c3f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 10:39:49 +0800 Subject: [PATCH 1/3] build(deps-dev): update swoole/ide-helper requirement from ^5.0 to ^6.0 (#519) Updates the requirements on [swoole/ide-helper](https://github.com/swoole/ide-helper) to permit the latest version. - [Release notes](https://github.com/swoole/ide-helper/releases) - [Commits](https://github.com/swoole/ide-helper/compare/5.0.0...6.0.0) --- updated-dependencies: - dependency-name: swoole/ide-helper dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b5d0c5ce..b93b1b14 100644 --- a/composer.json +++ b/composer.json @@ -75,7 +75,7 @@ "hyperf/watcher": "3.1.*", "mockery/mockery": "^1.0", "phpstan/phpstan": "^1.10", - "swoole/ide-helper": "^5.0", + "swoole/ide-helper": "^6.0", "zircote/swagger-php": "4.10.6" }, "suggest": { From dfa5c65de47e12704fe1fcfad7201483ecbc4511 Mon Sep 17 00:00:00 2001 From: MissZhou12345 <517013774@qq.com> Date: Wed, 8 Jan 2025 15:45:25 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BC=98=E5=8C=96v-copy=E5=9C=A8http?= =?UTF-8?q?=E4=B8=8B=E4=B8=8D=E8=83=BD=E5=A4=8D=E5=88=B6=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#517)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复顶级菜单无法被添加的问题 * optimize: v-copy的优化处理 --------- Co-authored-by: Mz --- web/src/directives/copy/index.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/web/src/directives/copy/index.ts b/web/src/directives/copy/index.ts index 0312258b..4f7b1ac7 100644 --- a/web/src/directives/copy/index.ts +++ b/web/src/directives/copy/index.ts @@ -14,13 +14,20 @@ import Message from 'vue-m-message' export interface CopyElement extends HTMLElement { copyValue: string } - +/** + * eg. + * 1、 v-copy="'copyContent'" // 默认是dblclick,localhost及https复制才会生效 + * 2、 v-copy:dblclick.legacy="'copyContent'" // 兼容模式,所有浏览器都生效 + */ export const copy = { mounted(el: CopyElement, binding: DirectiveBinding) { - const { isSupported, copy } = useClipboard() - if (!isSupported.value) { + const legacy = binding.modifiers?.legacy === true + const { isSupported } = useClipboard() + const { copy } = useClipboard({ legacy }) + if (!isSupported.value && !legacy) { throw new Error('[Directive: copy]: Your browser does not support Clipboard API') } + const { value } = binding if (value) { el.copyValue = value From e3981ef9e5575f631476d64ae4e5900a41a33c4e Mon Sep 17 00:00:00 2001 From: ljk123 <303147190@qq.com> Date: Wed, 8 Jan 2025 15:47:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?chore(http.ts):=20=E4=BC=98=E5=8C=96401?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E9=80=80=E5=87=BA=E4=B8=8D=E7=94=A8=E7=AD=89?= =?UTF-8?q?=E6=BB=A13=E7=A7=92=E6=98=BE=E5=BE=97=E5=BE=88=E5=8D=A1=20(#514?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/utils/http.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web/src/utils/http.ts b/web/src/utils/http.ts index f81dbea2..7f8596a5 100644 --- a/web/src/utils/http.ts +++ b/web/src/utils/http.ts @@ -52,6 +52,8 @@ http.interceptors.request.use( }, ) +let isLogout = false + http.interceptors.response.use( async (response: AxiosResponse): Promise => { isLoading.value = false @@ -72,14 +74,14 @@ http.interceptors.response.use( else { switch (response?.data?.code) { case ResultCode.UNAUTHORIZED: { - const logout = useDebounceFn( - async () => { + const logout = async () => { + if (isLogout === false) { + isLogout = true + setTimeout(() => isLogout = false, 5000) Message.error('登录状态已过期,需要重新登录', { zIndex: 9999 }) await useUserStore().logout() - }, - 3000, - { maxWait: 5000 }, - ) + } + } // 检查token是否需要刷新 if (userStore.isLogin && !isRefreshToken.value) { isRefreshToken.value = true