mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-14 02:55:07 +08:00
feat: add cache key
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import type { App } from 'vue'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
@ -8,7 +8,7 @@ export function hasPermi(app: App<Element>) {
|
||||
const { wsCache } = useCache()
|
||||
const { value } = binding
|
||||
const all_permission = '*:*:*'
|
||||
const permissions = wsCache.get('user').permissions
|
||||
const permissions = wsCache.get(CACHE_KEY.USER).permissions
|
||||
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const permissionFlag = value
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { App } from 'vue'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
@ -8,7 +8,7 @@ export function hasRole(app: App<Element>) {
|
||||
const { wsCache } = useCache()
|
||||
const { value } = binding
|
||||
const super_admin = 'admin'
|
||||
const roles = wsCache.get('user').roles
|
||||
const roles = wsCache.get(CACHE_KEY.USER).roles
|
||||
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const roleFlag = value
|
||||
|
Reference in New Issue
Block a user