50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
import { XTOKEN_KEY, USERINFO_KEY, BLUETOOTH_KEY, LOGININFO_KEY, SYSTEM_INFO_KEY } from "./key"
|
|
|
|
export const setSessionXToken = (val = '')=> {
|
|
uni.setStorageSync(XTOKEN_KEY, val)
|
|
}
|
|
|
|
export const getSessionXToken = ()=> {
|
|
return uni.getStorageSync(XTOKEN_KEY) || ''
|
|
}
|
|
|
|
export const setSessionUserInfo = (val = {})=> {
|
|
uni.setStorageSync(USERINFO_KEY, val)
|
|
}
|
|
|
|
export const getSessionUserInfo = ()=> {
|
|
return uni.getStorageSync(USERINFO_KEY) || {}
|
|
}
|
|
|
|
|
|
export const setSessionBluetoothInfo = (val = {})=> {
|
|
uni.setStorageSync(BLUETOOTH_KEY, val)
|
|
}
|
|
|
|
export const getSessionBluetoothInfo = ()=> {
|
|
return uni.getStorageSync(BLUETOOTH_KEY) || {}
|
|
}
|
|
|
|
export const setSessionLoginInfo = (val = {})=> {
|
|
uni.setStorageSync(LOGININFO_KEY, val)
|
|
}
|
|
|
|
export const getSessionLoginInfo = ()=> {
|
|
return uni.getStorageSync(LOGININFO_KEY) || {
|
|
remberPassport: []
|
|
}
|
|
}
|
|
|
|
export const setSessionSystemInfo = (val = {})=> {
|
|
let oldVal = getSessionSystemInfo()
|
|
// {
|
|
// postQueryHistory: [], // 快递查询历史
|
|
// }
|
|
uni.setStorageSync(SYSTEM_INFO_KEY, { ...oldVal, ...val})
|
|
}
|
|
|
|
export const getSessionSystemInfo = ()=> {
|
|
return uni.getStorageSync(SYSTEM_INFO_KEY) || {
|
|
postQueryHistory: []
|
|
}
|
|
} |