12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- export const setCache = (key, val) => {
- return new Promise((resolve, reject) => {
- uni.setStorage({
- key: key,
- data: val,
- success() {
- resolve(key, val)
- },
- fail(err) {
- reject(err)
- }
- })
- })
- }
- export const getCache = (key) => {
- return new Promise((resolve, reject) => {
- uni.getStorage({
- key: key,
- success(val) {
- resolve(val)
- },
- fail(err) {
- reject(err)
- }
- })
- })
- }
- export const clearChache = (key) => {
- return new Promise((resolve, reject) => {
- uni.clearStorage({
- key: key,
- success(val) {
- resolve(val)
- },
- fail(err) {
- reject(err)
- }
- })
- })
- }
|