From 63e1f0d81fba7215bc67962f49db828e5c3fd3e0 Mon Sep 17 00:00:00 2001 From: wally <18603454788@163.com> Date: Tue, 17 Aug 2021 17:19:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BC=93=E5=AD=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +- src/apis/tall.js | 2 +- src/main.js | 4 +-- src/pages/index/index.vue | 16 ++++++----- src/pages/test/test.vue | 13 +++++---- src/utils/cache.js | 53 ++++++++++++++++++++++++++++-------- src/utils/cacheAndRequest.js | 42 ++++++++++++++++++++-------- src/utils/indexedDB.js | 2 +- src/utils/request.js | 5 ++-- src/utils/storage.js | 2 +- src/utils/tall.js | 8 +++--- 11 files changed, 102 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d481ff..9dbd3e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.1.0 (2021-08-16) +# 0.1.0 (2021-08-17) ### 🌟 新功能 范围|描述|commitId @@ -55,6 +55,7 @@ 范围|描述|commitId --|--|-- - | calendar注释 | a2ec112 + - | indexedDB.js格式整理 | b0d3a36 - | 代码审查 | d75134c - | 代码格式细节调整 | cb2532b - | 任务快捷方式图标增加 | 4aba872 diff --git a/src/apis/tall.js b/src/apis/tall.js index 121373b..a0dd8ba 100644 --- a/src/apis/tall.js +++ b/src/apis/tall.js @@ -1,5 +1,5 @@ const apiUrl = process.env.VUE_APP_API_URL; -const tall = `${apiUrl}/tall3/v3.0`; +export const tall = `${apiUrl}/tall3/v3.0`; const install = (Vue, vm) => { vm.$u.api = { ...vm.$u.api } || {}; diff --git a/src/main.js b/src/main.js index 178ac27..0e38fcc 100644 --- a/src/main.js +++ b/src/main.js @@ -12,8 +12,8 @@ import AlloyFinger from 'alloyfinger'; import AlloyFingerPlugin from 'alloyfinger/vue/alloy_finger_vue'; Vue.use(AlloyFingerPlugin, { AlloyFinger }); // indexedDB -import indexedDB from '@/utils/indexedDB'; -Vue.use(indexedDB); +// import indexedDB from '@/utils/indexedDB'; +// Vue.use(indexedDB); //#endif Vue.config.productionTip = false; diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 74dcc1f..8b89ded 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -52,13 +52,15 @@ export default { ...mapMutations('project', ['setProjects', 'setDotList']), // 获取项目列表 - async getProjects(start = this.$moment().startOf('day').valueOf(), end = this.$moment().endOf('day').valueOf()) { - try { - const data = await this.$u.api.getProjects(start, end); - this.setProjects(data); - } catch (error) { - console.error('error: ', error); - } + getProjects(start = this.$moment().startOf('day').valueOf(), end = this.$moment().endOf('day').valueOf()) { + // const data = await this.$u.api.getProjects(start, end); + this.$t.$q.getProjects(start, end, (err, data) => { + if (err) { + console.error('error: ', error); + } else { + this.setProjects(data); + } + }); }, /** diff --git a/src/pages/test/test.vue b/src/pages/test/test.vue index 8f52f0c..0c2ed13 100644 --- a/src/pages/test/test.vue +++ b/src/pages/test/test.vue @@ -12,15 +12,16 @@