chore: pnpm eslint . --fix
This commit is contained in:
parent
7f02e18d37
commit
28ed4c0977
@ -28,7 +28,7 @@ export default antfu(
|
|||||||
"node/prefer-global/process": "off",
|
"node/prefer-global/process": "off",
|
||||||
// style
|
// style
|
||||||
"style/comma-dangle": ["error", "never"],
|
"style/comma-dangle": ["error", "never"],
|
||||||
"style/brace-style": "off",
|
"style/brace-style": ["error", "1tbs"],
|
||||||
// regexp
|
// regexp
|
||||||
"regexp/no-unused-capturing-group": "off",
|
"regexp/no-unused-capturing-group": "off",
|
||||||
// other
|
// other
|
||||||
|
@ -135,8 +135,7 @@ function handleEnter() {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
router.push({ name })
|
router.push({ name })
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
ElMessage.error("该菜单有必填的动态参数,无法通过搜索进入")
|
ElMessage.error("该菜单有必填的动态参数,无法通过搜索进入")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,7 @@ export const useFullscreenLoading: UseFullscreenLoading = (fn, options = {}) =>
|
|||||||
try {
|
try {
|
||||||
loadingInstance = ElLoading.service({ ...defaultOptions, ...options })
|
loadingInstance = ElLoading.service({ ...defaultOptions, ...options })
|
||||||
return await fn(...args)
|
return await fn(...args)
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
loadingInstance?.close()
|
loadingInstance?.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,12 +124,10 @@ export function useWatermark(parentEl: Ref<HTMLElement | null> = bodyEl) {
|
|||||||
// 移除水印元素
|
// 移除水印元素
|
||||||
try {
|
try {
|
||||||
parentEl.value.removeChild(watermarkEl)
|
parentEl.value.removeChild(watermarkEl)
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
// 比如在无防御情况下,用户打开控制台删除了这个元素
|
// 比如在无防御情况下,用户打开控制台删除了这个元素
|
||||||
console.warn("水印元素已不存在,请重新创建")
|
console.warn("水印元素已不存在,请重新创建")
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
watermarkEl = null
|
watermarkEl = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -304,8 +304,7 @@ export function resetRouter() {
|
|||||||
router.hasRoute(name) && router.removeRoute(name)
|
router.hasRoute(name) && router.removeRoute(name)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
// 强制刷新浏览器也行,只是交互体验不是很好
|
// 强制刷新浏览器也行,只是交互体验不是很好
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
}
|
}
|
||||||
|
@ -44,8 +44,7 @@ router.beforeEach(async (to, _from, next) => {
|
|||||||
permissionStore.addRoutes.forEach(route => router.addRoute(route))
|
permissionStore.addRoutes.forEach(route => router.addRoute(route))
|
||||||
// 设置 replace: true, 因此导航将不会留下历史记录
|
// 设置 replace: true, 因此导航将不会留下历史记录
|
||||||
next({ ...to, replace: true })
|
next({ ...to, replace: true })
|
||||||
}
|
} catch (error) {
|
||||||
catch (error) {
|
|
||||||
// 过程中发生任何错误,都直接重置 Token,并重定向到登录页面
|
// 过程中发生任何错误,都直接重置 Token,并重定向到登录页面
|
||||||
userStore.resetToken()
|
userStore.resetToken()
|
||||||
ElMessage.error((error as Error).message || "路由守卫过程发生错误")
|
ElMessage.error((error as Error).message || "路由守卫过程发生错误")
|
||||||
|
@ -32,8 +32,7 @@ async function querySuccess() {
|
|||||||
async function queryError() {
|
async function queryError() {
|
||||||
try {
|
try {
|
||||||
await useFullscreenLoading(getErrorApi, options)()
|
await useFullscreenLoading(getErrorApi, options)()
|
||||||
}
|
} catch (error) {
|
||||||
catch (error) {
|
|
||||||
ElMessage.error((error as Error).message)
|
ElMessage.error((error as Error).message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user