-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
55 lines (55 loc) · 1010 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
export default {
getStorage: function (e) {
return new Promise(function (r) {
wx.getStorage({
key: e,
success: function (e) {
r(e.data);
},
fail: function () {
r(!1);
}
});
});
},
setStorage: function (e, r) {
return new Promise(function (t) {
wx.setStorage({
key: e,
data: r,
success: t,
fail: t
});
});
},
removeStorage: function (e) {
return new Promise(function (r) {
wx.removeStorage({
key: e,
success: r,
fail: r
});
});
},
getStorageSync: function (e) {
try {
return wx.getStorageSync(e);
} catch (e) {
console.error(e);
}
},
setStorageSync: function (e, r) {
try {
wx.setStorageSync(e, r);
} catch (e) {
console.error(e);
}
},
removeStorageSync: function (e) {
try {
wx.removeStorageSync(e);
} catch (e) {
console.error(e);
}
},
}