Commit 4aa0f635 authored by 贾慧斌's avatar 贾慧斌

feat: 改写sessionStorage 方法

parent 2a508a8f
export const sStorage = {
setItem(key, value) {
uni.setStorageSync(key, value);
},
getItem(key) {
return uni.getStorageSync(key);
},
removeItem(key) {
uni.removeStorageSync(key);
},
clear() {
uni.clearStorageSync();
},
/**
* @function 判断类型
* @param {any} para 必须参数,判断的值
*/
getType(para) {
const type = typeof para;
if (type === "number" && isNaN(para)) return "NaN";
if (type !== "object") return type;
return Object.prototype.toString
.call(para)
.replace(/[\[\]]/g, '') // eslint-disable-line
.split(" ")[1]
.toLowerCase();
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment