mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2026-01-23 08:00:22 +08:00
init
This commit is contained in:
30
src/utils/storage/index.js
Normal file
30
src/utils/storage/index.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/**********************************
|
||||
* @FilePath: index.js
|
||||
* @Author: Ronnie Zhang
|
||||
* @LastEditor: Ronnie Zhang
|
||||
* @LastEditTime: 2023/12/04 22:46:07
|
||||
* @Email: zclzone@outlook.com
|
||||
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
|
||||
**********************************/
|
||||
|
||||
import { createStorage } from './storage'
|
||||
|
||||
const prefixKey = 'vue-naive-admin_'
|
||||
|
||||
export const createLocalStorage = function (option = {}) {
|
||||
return createStorage({
|
||||
prefixKey: option.prefixKey || '',
|
||||
storage: localStorage,
|
||||
})
|
||||
}
|
||||
|
||||
export const createSessionStorage = function (option = {}) {
|
||||
return createStorage({
|
||||
prefixKey: option.prefixKey || '',
|
||||
storage: sessionStorage,
|
||||
})
|
||||
}
|
||||
|
||||
export const lStorage = createLocalStorage({ prefixKey })
|
||||
|
||||
export const sStorage = createSessionStorage({ prefixKey })
|
||||
Reference in New Issue
Block a user