Browse Source

refactor: 清空缓存同步;删除不必要的package.json

project
wally 4 years ago
parent
commit
a6f45eda3c
  1. 3
      CHANGELOG.md
  2. 37
      src/package.json
  3. 10
      src/utils/storage.js

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 0.1.0 (2021-09-06)
# 0.1.0 (2021-09-07)
### 🌟 新功能
范围|描述|commitId
@ -225,6 +225,7 @@
- | env host修改 | a79a4a5
- | merge globals | b0957cc
- | merge wrr | 5ccc7a5
- | merge wrr lucky | 959ae05
- | mock | 51c24a5
node-sass | 替换node-sass为sass(dart-sass) | c33169d
package manifest | 去掉了摇树 | f7c1dd4

37
src/package.json

@ -1,37 +0,0 @@
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationStyle": "custom" ,
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/project/project",
"style": {
"navigationStyle": "custom" ,
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/test/test",
"style": {
"navigationBarTitleText": "测试"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "TALL",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"easycom": {
"autoscan": true,
"custom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue",
"^p-(.*)": "@/plugins/p-$1/p-$1.vue"
}
}
}

10
src/utils/storage.js

@ -92,20 +92,14 @@ export default {
});
},
/**
* 清楚全部数据 异步
*/
clearStorage() {
uni.clearStorage();
},
// 检测local Storage容量 超出容量清空数据缓存
checkCapacity() {
/* #ifdef H5 */
const capacity = JSON.stringify(localStorage).length;
let max = 1024 * 1024 * 4;
console.log('capacity: ', capacity, max);
if (capacity >= max) {
uni.$t.storage.clearStorage();
uni.clearStorageSync();
}
/* #endif */
},

Loading…
Cancel
Save