1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2026-06-10 00:34:08 +08:00

chore: update deps and lint fix

This commit is contained in:
zclzone
2026-06-01 08:40:42 +08:00
parent 6d5a67b9d3
commit c55d16a951
7 changed files with 2070 additions and 1354 deletions

View File

@@ -44,7 +44,7 @@ export function createPermissionGuard(router) {
}
const routes = router.getRoutes()
if (routes.find(route => route.name === to.name))
if (routes.some(route => route.name === to.name))
return true
// 判断是无权限还是404

View File

@@ -71,7 +71,7 @@ export const useTabStore = defineStore('tab', {
const curIndex = this.tabs.findIndex(item => item.path === curPath)
const filterTabs = this.tabs.filter((item, index) => index >= curIndex)
this.setTabs(filterTabs)
if (!filterTabs.find(item => item.path === this.activeTab)) {
if (!filterTabs.some(item => item.path === this.activeTab)) {
useRouterStore().router?.push(filterTabs[filterTabs.length - 1].path)
}
},
@@ -79,7 +79,7 @@ export const useTabStore = defineStore('tab', {
const curIndex = this.tabs.findIndex(item => item.path === curPath)
const filterTabs = this.tabs.filter((item, index) => index <= curIndex)
this.setTabs(filterTabs)
if (!filterTabs.find(item => item.path === this.activeTab.value)) {
if (!filterTabs.some(item => item.path === this.activeTab.value)) {
useRouterStore().router?.push(filterTabs[filterTabs.length - 1].path)
}
},

View File

@@ -34,7 +34,7 @@ export function throttle(fn, wait) {
let previous = 0
return function (...argArr) {
const now = +new Date()
const now = Date.now()
context = this
args = argArr
if (now - previous > wait) {

View File

@@ -23,7 +23,7 @@ class Storage {
const stringData = JSON.stringify({
value,
time: Date.now(),
expire: !isNullOrUndef(expire) ? new Date().getTime() + expire * 1000 : null,
expire: !isNullOrUndef(expire) ? Date.now() + expire * 1000 : null,
})
this.storage.setItem(this.getKey(key), stringData)
}
@@ -40,7 +40,7 @@ class Storage {
try {
const data = JSON.parse(val)
const { value, time, expire } = data
if (isNullOrUndef(expire) || expire > new Date().getTime()) {
if (isNullOrUndef(expire) || expire > Date.now()) {
return { value, time }
}
this.remove(key)