You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
export default {
|
|
// 获取本地存储对应key
|
|
getStorage(key){
|
|
return uni.getStorageSync( key );
|
|
},
|
|
// 设置本地存储对应key
|
|
setStorage(key,value){
|
|
return uni.setStorageSync( key,value );
|
|
},
|
|
// 清除全部本地存储
|
|
clearStorage (){
|
|
let overPackageRecordPointParams = ''
|
|
if( uni.getStorageSync('overPackageRecordPointParams')){
|
|
overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams')
|
|
}
|
|
let overPackageJobDetailPointParams = ''
|
|
if( uni.getStorageSync('overPackageJobDetailPointParams')){
|
|
overPackageJobDetailPointParams = uni.getStorageSync('overPackageJobDetailPointParams')
|
|
}
|
|
uni.clearStorageSync();
|
|
if(overPackageRecordPointParams){
|
|
uni.setStorageSync('overPackageRecordPointParams',overPackageRecordPointParams)
|
|
}
|
|
if(overPackageJobDetailPointParams){
|
|
uni.setStorageSync('overPackageJobDetailPointParams',overPackageJobDetailPointParams)
|
|
}
|
|
|
|
},
|
|
// 清除指定key本地存储
|
|
removeStorage ( key ){
|
|
uni.removeStorageSync( key );
|
|
},
|
|
// 关闭当前页面,返回上一页面或多级页面
|
|
constant:{
|
|
id:"id",
|
|
token:"token",
|
|
avatar: 'avatar',
|
|
name: 'name',
|
|
roles: 'roles',
|
|
permissions: 'permissions'
|
|
}
|
|
}
|
|
|