Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-20 10:59:21 +08:00

chore: pnpm eslint . --fix

This commit is contained in:
pany 2024-11-19 10:42:02 +08:00
parent 7f02e18d37
commit 28ed4c0977
7 changed files with 8 additions and 15 deletions

View File

@ -28,7 +28,7 @@ export default antfu(
"node/prefer-global/process": "off",
// style
"style/comma-dangle": ["error", "never"],
"style/brace-style": "off",
"style/brace-style": ["error", "1tbs"],
// regexp
"regexp/no-unused-capturing-group": "off",
// other

View File

@ -135,8 +135,7 @@ function handleEnter() {
}
try {
router.push({ name })
}
catch {
} catch {
ElMessage.error("该菜单有必填的动态参数,无法通过搜索进入")
return
}

View File

@ -28,8 +28,7 @@ export const useFullscreenLoading: UseFullscreenLoading = (fn, options = {}) =>
try {
loadingInstance = ElLoading.service({ ...defaultOptions, ...options })
return await fn(...args)
}
finally {
} finally {
loadingInstance?.close()
}
}

View File

@ -124,12 +124,10 @@ export function useWatermark(parentEl: Ref<HTMLElement | null> = bodyEl) {
// 移除水印元素
try {
parentEl.value.removeChild(watermarkEl)
}
catch {
} catch {
// 比如在无防御情况下,用户打开控制台删除了这个元素
console.warn("水印元素已不存在,请重新创建")
}
finally {
} finally {
watermarkEl = null
}
}

View File

@ -304,8 +304,7 @@ export function resetRouter() {
router.hasRoute(name) && router.removeRoute(name)
}
})
}
catch {
} catch {
// 强制刷新浏览器也行,只是交互体验不是很好
window.location.reload()
}

View File

@ -44,8 +44,7 @@ router.beforeEach(async (to, _from, next) => {
permissionStore.addRoutes.forEach(route => router.addRoute(route))
// 设置 replace: true, 因此导航将不会留下历史记录
next({ ...to, replace: true })
}
catch (error) {
} catch (error) {
// 过程中发生任何错误,都直接重置 Token并重定向到登录页面
userStore.resetToken()
ElMessage.error((error as Error).message || "路由守卫过程发生错误")

View File

@ -32,8 +32,7 @@ async function querySuccess() {
async function queryError() {
try {
await useFullscreenLoading(getErrorApi, options)()
}
catch (error) {
} catch (error) {
ElMessage.error((error as Error).message)
}
}