diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..e5aaa3e --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,11 @@ +{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version": "0.0", + "configurations": [{ + "type": "uniCloud", + "default": { + "launchtype": "local" + } + } + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md index f269ac9..69b14ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ -# [0.1.0](https://gitee.com/mongos/uni-cli-template/compare/v1.1.1...v0.1.0) (2021-07-16) +# [0.1.0](https://gitee.com/mongos/uni-cli-template/compare/v1.1.1...v0.1.0) (2021-07-19) + +### 🌟 新功能 +范围|描述|commitId +--|--|-- + - | db store | [6414c4f](https://gitee.com/mongos/uni-cli-template/commits/6414c4f) + pinch | alloy finger实现图片的pinch放大缩小 | [de01343](https://gitee.com/mongos/uni-cli-template/commits/de01343) + ### 🐛 Bug 修复 范围|描述|commitId @@ -17,12 +24,6 @@ - | !2 基础模板v1.1.0 | [f5e61dd](https://gitee.com/mongos/uni-cli-template/commits/f5e61dd) -### 🌟 新功能 -范围|描述|commitId ---|--|-- - pinch | alloy finger实现图片的pinch放大缩小 | [de01343](https://gitee.com/mongos/uni-cli-template/commits/de01343) - - ### 📝 文档 范围|描述|commitId --|--|-- diff --git a/src/utils/indexedDB.js b/src/utils/indexedDB.js index 5b85f5e..a1b0d36 100644 --- a/src/utils/indexedDB.js +++ b/src/utils/indexedDB.js @@ -1,5 +1,21 @@ import { name, version } from '@/config'; +// 创建表 +const createTable = (Vue, db) => { + // projects项目表 + Vue.prototype.$db.projects = db.createObjectStore('projects', { keyPath: 'id' }); + // roles 角色表 + Vue.prototype.$db.roles = db.createObjectStore('roles', { keyPath: 'id' }); + // plan_tasks 定期任务 + Vue.prototype.$db.plan_tasks = db.createObjectStore('plan_tasks', { keyPath: 'id' }); + // fixed_tasks 固定全局任务 + Vue.prototype.$db.fixed_tasks = db.createObjectStore('fixed_tasks', { keyPath: 'id' }); + // variable_tasks 可变全局任务 + Vue.prototype.$db.variable_tasks = db.createObjectStore('variable_tasks', { keyPath: 'id' }); + // plugins 插件表 + Vue.prototype.$db.plugins = db.createObjectStore('plugins', { keyPath: 'id' }); +}; + const install = Vue => { Vue.prototype.$db.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; const request = window.indexedDB.open(name, version); // IDBRequest 对象 @@ -10,19 +26,7 @@ const install = Vue => { request.onupgradeneeded = event => { Vue.prototype.$db.db = event.target.result; // 创建表 - // user表 - - // projects项目表 - - // roles 角色表 - - // plan_tasks 定期任务 - - // fixed_tasks 固定全局任务 - - // variable_tasks 可变全局任务 - - // plugins 插件表 + createTable(Vue, Vue.prototype.$db.db); }; };