迁移版本
This commit is contained in:
9
utils/cache.js
Normal file
9
utils/cache.js
Normal file
@@ -0,0 +1,9 @@
|
||||
// 写入某个key到缓存
|
||||
export function setCache(key, value) {
|
||||
uni.setStorageSync(key, value)
|
||||
}
|
||||
|
||||
// 获取某个key的缓存
|
||||
export function getCache(key) {
|
||||
return uni.getStorageSync(key)
|
||||
}
|
||||
10
utils/utils.js
Normal file
10
utils/utils.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import {Base64} from "js-base64";
|
||||
|
||||
export function urlSafeBase64Encode(str) {
|
||||
|
||||
const base64 = Base64.encode(str);
|
||||
return base64
|
||||
.replace(/\+/g, '-')
|
||||
.replace(/\//g, '_')
|
||||
.replace(/=+$/, '');
|
||||
}
|
||||
Reference in New Issue
Block a user