const TokenKey = 'App-Token'

export function getToken() {
	return uni.getStorageSync(TokenKey)
}

export function setToken(token) {
	return uni.setStorageSync(TokenKey, token)
}

export function removeToken() {
	return uni.removeStorageSync(TokenKey)
}

export function getJSONData(keyStr) {
	if (uni.getStorageSync(keyStr)) {
		return JSON.parse(uni.getStorageSync(keyStr))
	} else {
		return null;
	}
}

export function setJSONData(keyStr, dataObj) {
	return uni.setStorageSync(keyStr, JSON.stringify(dataObj))
}

export function removeJSONData(keyStr) {
	return uni.removeStorageSync(keyStr)
}

export function getStrData(keyStr) {
	return uni.getStorageSync(keyStr)
}

export function setStrData(keyStr, dataStr) {
	return uni.setStorageSync(keyStr, dataStr)
}

export function removeStrData(keyStr) {
	return uni.removeStorageSync(keyStr)
}