diff --git a/common/httpRequest.js b/common/httpRequest.js index 7b40f68..9adb7c2 100644 --- a/common/httpRequest.js +++ b/common/httpRequest.js @@ -1,8 +1,13 @@ import configdata from './config' import cache from './cache' import { - cacheClearAll + cacheClearAll,cacheClear } from '@/store/cashe.js' +function successCallBack(url){ + if(url.includes('app/courseCollect/insertCourseCollect')){ + cacheClear('chasingDrama') + } +} module.exports = { config: function(name) { var info = null; @@ -151,7 +156,11 @@ module.exports = { success: function(result) { if (result.data.code == 401) { that.logout(); + }else{ + successCallBack(url) + // cacheClear('chasingDrama') } + succ.call(self, result.data) }, fail: function(e) { diff --git a/me/setting/index.vue b/me/setting/index.vue index d6d8a15..cf470e9 100644 --- a/me/setting/index.vue +++ b/me/setting/index.vue @@ -25,6 +25,10 @@ 注销账号 + 退出登录 @@ -39,6 +43,7 @@ data() { return { version: null, + cacheSize:'0M' } }, onLoad() { @@ -54,8 +59,30 @@ // console.log(widgetInfo) // this.version = widgetInfo.version // }) + const info= uni.getStorageInfoSync() + console.log(info); + const size=(info.currentSize/1024).toFixed(2) + this.cacheSize=size<1?(info.currentSize+'kb'):(size) +'M' + }, + onShow() { }, methods: { + clearCache(){ + uni.showModal({ + title:'提示', + content:`是否清除全部缓存 + `, + success(res) { + if(res.confirm){ + cacheClearAll() + const info= uni.getStorageInfoSync() + info.keys.map(v=>{ + console.log(v); + }) + } + } + }) + }, goNav(e) { uni.navigateTo({ url: e diff --git a/pages.json b/pages.json index 61639cd..ab393d9 100644 --- a/pages.json +++ b/pages.json @@ -107,8 +107,7 @@ "navigationBarTitleText": "我的", "navigationStyle": "custom" // #ifdef H5 - , - "enablePullDownRefresh": true + ,"enablePullDownRefresh": true // #endif } }, diff --git a/pages/chasingDrama/chasingDrama.vue b/pages/chasingDrama/chasingDrama.vue index 6d3c3bf..a365038 100644 --- a/pages/chasingDrama/chasingDrama.vue +++ b/pages/chasingDrama/chasingDrama.vue @@ -113,7 +113,8 @@