diff --git a/.eslintcache b/.eslintcache index 1d7e704..fdbc74b 100644 --- a/.eslintcache +++ b/.eslintcache @@ -1 +1 @@ -[{"/mnt/c/Users/Administrator/Documents/coding/ccsens/tall-mui-cli/commitlint.config.js":"1","/mnt/c/Users/Administrator/Documents/coding/ccsens/tall-mui-cli/src/main.js":"2","/mnt/c/Users/Administrator/Documents/coding/ccsens/tall-mui-cli/src/registerServiceWorker.js":"3","/mnt/c/Users/Administrator/Documents/coding/ccsens/tall-mui-cli/tailwind.config.js":"4"},{"size":85,"mtime":1623976024000,"results":"5","hashOfConfig":"6"},{"size":222,"mtime":1623976024081,"results":"7","hashOfConfig":"6"},{"size":882,"mtime":1623976024087,"results":"8","hashOfConfig":"6"},{"size":160,"mtime":1623976024089},{"filePath":"9","messages":"10","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"14qqz39",{"filePath":"11","messages":"12","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"13","messages":"14","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/mnt/c/Users/Administrator/Documents/coding/ccsens/tall-mui-cli/commitlint.config.js",[],"/mnt/c/Users/Administrator/Documents/coding/ccsens/tall-mui-cli/src/main.js",[],"/mnt/c/Users/Administrator/Documents/coding/ccsens/tall-mui-cli/src/registerServiceWorker.js",[]] \ No newline at end of file +[{"/mnt/c/Users/Administrator/Documents/coding/ccsens/demo/tall-v3.0-demo/src/main.js":"1","/mnt/c/Users/Administrator/Documents/coding/ccsens/demo/tall-v3.0-demo/src/utils/request.js":"2"},{"size":335,"mtime":1624344979998,"results":"3","hashOfConfig":"4"},{"size":1742,"mtime":1624344980012,"results":"5","hashOfConfig":"4"},{"filePath":"6","messages":"7","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"178d5hk",{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/mnt/c/Users/Administrator/Documents/coding/ccsens/demo/tall-v3.0-demo/src/main.js",[],"/mnt/c/Users/Administrator/Documents/coding/ccsens/demo/tall-v3.0-demo/src/utils/request.js",[]] \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5094e71..d35eb70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -# [0.1.0](https://gitee.com/mongos/uni-cli-template/compare/v1.0.1...v0.1.0) (2021-06-22) +# [0.1.0](https://gitee.com/mongos/uni-cli-template/compare/v1.0.1...v0.1.0) (2021-06-23) + +### chore +范围|描述|commitId +--|--|-- + - | uview-ui | [a9ea34b](https://gitee.com/mongos/uni-cli-template/commits/a9ea34b) + ## [1.0.1](https://gitee.com/mongos/uni-cli-template/compare/c0f1deb...v1.0.1) (2021-06-22) ### 🔨 代码重构 diff --git a/package.json b/package.json index 8a14645..b3045c9 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "@vue/cli-plugin-pwa": "~4.5.0", "@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-service": "~4.5.0", + "vue-cli-plugin-mock": "^1.0.3", "@vue/eslint-config-prettier": "^6.0.0", "babel-eslint": "^10.1.0", "babel-plugin-import": "^1.11.0", diff --git a/public/index.html b/public/index.html index f6975e8..755a4bc 100644 --- a/public/index.html +++ b/public/index.html @@ -23,6 +23,7 @@
+ - \ No newline at end of file + diff --git a/src/mock/rich-text.js b/src/mock/rich-text.js new file mode 100644 index 0000000..c62a460 --- /dev/null +++ b/src/mock/rich-text.js @@ -0,0 +1,33 @@ +export default [ + { + path: '/tasks', + handler: (req, res) => { + return res.json({ + code: 200, + msg: 'ok', + success: true, + data: { + plugins: [ + ``, + `a链接打开现海园区`, + `
样式继承及简单脚本
`, + `
先是modal, 函数执行
+ + + `, + ], + }, + }); + }, + }, +]; diff --git a/src/pages.json b/src/pages.json index 857b1de..2d28b19 100644 --- a/src/pages.json +++ b/src/pages.json @@ -11,6 +11,12 @@ "style": { "navigationBarTitleText": "iframe-测试" } + }, + { + "path": "pages/rich-text/rich-text", + "style": { + "navigationBarTitleText": "rich-text 测试" + } } ], "globalStyle": { diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 797dd8b..5ebaf5a 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,7 +1,8 @@ diff --git a/src/pages/plugin-test/plugin-test.vue b/src/pages/plugin-test/plugin-test.vue index ea76ac5..5acb0d1 100644 --- a/src/pages/plugin-test/plugin-test.vue +++ b/src/pages/plugin-test/plugin-test.vue @@ -1,7 +1,62 @@ diff --git a/src/pages/rich-text/rich-text.vue b/src/pages/rich-text/rich-text.vue new file mode 100644 index 0000000..916264b --- /dev/null +++ b/src/pages/rich-text/rich-text.vue @@ -0,0 +1,73 @@ + + + diff --git a/src/utils/request.js b/src/utils/request.js index be72968..6f3fa58 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,5 +1,4 @@ const install = (Vue, vm) => { - console.log(); Vue.prototype.$u.http.setConfig({ baseUrl: '', showLoading: true, // 是否显示请求中的loading @@ -14,21 +13,21 @@ const install = (Vue, vm) => { Vue.prototype.$u.http.interceptor.request = config => { // TODO: 如果在白名单里 则不需要加token - if (vm.$store.state.user.token) { - config.header.Authorization = `Bearer ${vm.$store.state.user.token}`; - } + // if (vm.$store.state.user.token) { + // config.header.Authorization = `Bearer ${vm.$store.state.user.token}`; + // } return config; }; // 响应拦截,如配置,每次请求结束都会执行本方法 Vue.prototype.$u.http.interceptor.response = res => { - if (res.code == 200) { + if (res.code === 200) { // res为服务端返回值,可能有code,result等字段 // 这里对res.result进行返回,将会在this.$u.post(url).then(res => {})的then回调中的res的到 // 如果配置了originalData为true,请留意这里的返回值 - return res.result; - } else if (res.code == 401) { + return res.data; + } else if (res.code === 401) { // 假设201为token失效,这里跳转登录 vm.$u.toast('验证失败,请重新登录'); setTimeout(() => { diff --git a/vue.config.js b/vue.config.js index 9b2c747..3d6cfca 100644 --- a/vue.config.js +++ b/vue.config.js @@ -10,4 +10,7 @@ module.exports = { // proxy: {} }, configureWebpack: { plugins: [] }, + pluginOptions: { + mock: { entry: './src/mock/rich-text.js', debug: true }, + }, }; diff --git a/yarn.lock b/yarn.lock index d720138..e5af31f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3188,7 +3188,7 @@ bn.js@^5.0.0, bn.js@^5.1.1: resolved "https://registry.npm.taobao.org/bn.js/download/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha1-NYhgZ0OWxpl3canQUfzBtX1K4AI= -body-parser@1.19.0: +body-parser@1.19.0, body-parser@^1.18.3: version "1.19.0" resolved "https://registry.npm.taobao.org/body-parser/download/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" integrity sha1-lrJwnlfJxOCab9Zqj9l5hE9p8Io= @@ -5689,6 +5689,16 @@ expect@^25.5.0: jest-message-util "^25.5.0" jest-regex-util "^25.2.6" +express-mock-restful@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/express-mock-restful/-/express-mock-restful-1.1.3.tgz#95ec62327f39d49914e7d015fc604d5c1deaab29" + integrity sha512-ghjTu9v4K8U/2GOx8j3CCo4JH6FCfeK9UvwbEPHZvdVBQvGd0NZXjkoss5p6F4npx0BuBQukftXnu1IHBTElgw== + dependencies: + body-parser "^1.18.3" + chalk "^2.4.1" + debug "^3.1.0" + path-to-regexp "^2.2.1" + express@^4.16.3, express@^4.17.1: version "4.17.1" resolved "https://registry.npm.taobao.org/express/download/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" @@ -9825,6 +9835,11 @@ path-to-regexp@^1.1.1: dependencies: isarray "0.0.1" +path-to-regexp@^2.2.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.4.0.tgz#35ce7f333d5616f1c1e1bfe266c3aba2e5b2e704" + integrity sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w== + path-type@^1.0.0: version "1.1.0" resolved "https://registry.npm.taobao.org/path-type/download/path-type-1.1.0.tgz?cache=0&sync_timestamp=1611752074264&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpath-type%2Fdownload%2Fpath-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -12891,6 +12906,14 @@ vue-cli-plugin-commitlint@~1.0.12: resolved "https://registry.npm.taobao.org/vue-cli-plugin-commitlint/download/vue-cli-plugin-commitlint-1.0.12.tgz#176819170661f552497bad0458144fa9d55dc092" integrity sha1-F2gZFwZh9VJJe60EWBRPqdVdwJI= +vue-cli-plugin-mock@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/vue-cli-plugin-mock/-/vue-cli-plugin-mock-1.0.3.tgz#5d31732c622a241239c640569f05b8bca4c660c6" + integrity sha512-SpOJKJ9JqcPT/zGJPewKNDLaLTeysVGe/QXfNIWHn9UGr72opxl/I5gXCJbpag910aFvCr5rC+qraC06tbqx9g== + dependencies: + express-mock-restful "^1.1.3" + memory-fs "^0.4.1" + vue-eslint-parser@^7.0.0: version "7.6.0" resolved "https://registry.nlark.com/vue-eslint-parser/download/vue-eslint-parser-7.6.0.tgz#01ea1a2932f581ff244336565d712801f8f72561"