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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user