解决页面级缓存问题,继续优化性能
This commit is contained in:
parent
84690b2e6e
commit
05bf9d6aaa
@ -2,9 +2,13 @@ module.exports = [
|
|||||||
{ name: 'vue', library: 'Vue', js: 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js', css: '' },
|
{ name: 'vue', library: 'Vue', js: 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js', css: '' },
|
||||||
{ name: 'vue-i18n', library: 'VueI18n', js: 'https://cdn.jsdelivr.net/npm/vue-i18n@8.17.3/dist/vue-i18n.min.js', css: '' },
|
{ name: 'vue-i18n', library: 'VueI18n', js: 'https://cdn.jsdelivr.net/npm/vue-i18n@8.17.3/dist/vue-i18n.min.js', css: '' },
|
||||||
{ name: 'vue-router', library: 'VueRouter', js: 'https://cdn.jsdelivr.net/npm/vue-router@3.1.6/dist/vue-router.min.js', css: '' },
|
{ name: 'vue-router', library: 'VueRouter', js: 'https://cdn.jsdelivr.net/npm/vue-router@3.1.6/dist/vue-router.min.js', css: '' },
|
||||||
|
{ name: 'vuex', library: 'Vuex', js: 'https://cdn.jsdelivr.net/npm/vuex@3.4.0/dist/vuex.js', css: '' },
|
||||||
{ name: 'axios', library: 'axios', js: 'https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js', css: '' },
|
{ name: 'axios', library: 'axios', js: 'https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js', css: '' },
|
||||||
{ name: 'element-ui', library: 'ELEMENT', js: 'https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js', css: 'https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css' },
|
{ name: 'element-ui', library: 'ELEMENT', js: 'https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js', css: 'https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css' },
|
||||||
|
{ name: 'lodash', library: '_', js: 'https://cdn.jsdelivr.net/npm/lodash@4.17.15/lodash.min.js', css: '' },
|
||||||
{ name: 'js-cookie', library: 'Cookies', js: 'https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js', css: '' },
|
{ name: 'js-cookie', library: 'Cookies', js: 'https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js', css: '' },
|
||||||
|
{ name: 'lowdb', library: 'low', js: 'https://cdn.jsdelivr.net/npm/lowdb@1.0.0/dist/low.min.js', css: '' },
|
||||||
|
{ name: 'lowdb/adapters/LocalStorage', library: 'LocalStorage', js: 'https://cdn.jsdelivr.net/npm/lowdb@1.0.0/dist/LocalStorage.min.js', css: '' },
|
||||||
// { name: 'brace', library: 'ace', js: 'https://cdn.jsdelivr.net/npm/brace@0.11.1/index.min.js', css: '' },
|
// { name: 'brace', library: 'ace', js: 'https://cdn.jsdelivr.net/npm/brace@0.11.1/index.min.js', css: '' },
|
||||||
// { name: 'brace/ext/language_tools', library: 'language_tools', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/ext/language_tools.js', css: '' },
|
// { name: 'brace/ext/language_tools', library: 'language_tools', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/ext/language_tools.js', css: '' },
|
||||||
// { name: 'brace/mode/html', library: 'html', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/html.js', css: '' },
|
// { name: 'brace/mode/html', library: 'html', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/html.js', css: '' },
|
||||||
@ -14,6 +18,7 @@ module.exports = [
|
|||||||
// { name: 'brace/snippets/javascript', library: 'javascript', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/snippets/javascript.js', css: '' },
|
// { name: 'brace/snippets/javascript', library: 'javascript', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/snippets/javascript.js', css: '' },
|
||||||
// { name: 'vue2-ace-editor', library: 'Vue2ACEEditor', js: 'https://cdn.jsdelivr.net/npm/vue2-ace-editor@0.0.15/index.min.js', css: '' },
|
// { name: 'vue2-ace-editor', library: 'Vue2ACEEditor', js: 'https://cdn.jsdelivr.net/npm/vue2-ace-editor@0.0.15/index.min.js', css: '' },
|
||||||
{ name: 'markdown-it', library: 'markdownit', js: 'https://cdn.jsdelivr.net/npm/markdown-it@10.0.0/dist/markdown-it.min.js', css: '' },
|
{ name: 'markdown-it', library: 'markdownit', js: 'https://cdn.jsdelivr.net/npm/markdown-it@10.0.0/dist/markdown-it.min.js', css: '' },
|
||||||
|
{ name: '', library: '', js: 'https://at.alicdn.com/t/font_1760192_zf96psu0uo.js', css: '' },
|
||||||
{ name: '', library: '', js: '', css: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css' },
|
{ name: '', library: '', js: '', css: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css' },
|
||||||
{ name: '', library: '', js: '', css: 'https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css' },
|
{ name: '', library: '', js: '', css: 'https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css' },
|
||||||
{ name: '', library: '', js: '', css: 'https://cdn.jsdelivr.net/npm/font-awesome-animation@0.2.1/dist/font-awesome-animation.min.css' },
|
{ name: '', library: '', js: '', css: 'https://cdn.jsdelivr.net/npm/font-awesome-animation@0.2.1/dist/font-awesome-animation.min.css' },
|
||||||
|
288
package-lock.json
generated
288
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "go2index-theme-acrou",
|
"name": "go2index-theme-acrou",
|
||||||
"version": "0.1.0",
|
"version": "1.1.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -934,6 +934,22 @@
|
|||||||
"regenerator-runtime": "^0.13.4"
|
"regenerator-runtime": "^0.13.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@babel/runtime-corejs2": {
|
||||||
|
"version": "7.9.6",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/@babel/runtime-corejs2/download/@babel/runtime-corejs2-7.9.6.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fruntime-corejs2%2Fdownload%2F%40babel%2Fruntime-corejs2-7.9.6.tgz",
|
||||||
|
"integrity": "sha1-rNXWNROEzCgo3CEapUJqkEdr9Kg=",
|
||||||
|
"requires": {
|
||||||
|
"core-js": "^2.6.5",
|
||||||
|
"regenerator-runtime": "^0.13.4"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"core-js": {
|
||||||
|
"version": "2.6.11",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/core-js/download/core-js-2.6.11.tgz?cache=0&sync_timestamp=1586450269267&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.11.tgz",
|
||||||
|
"integrity": "sha1-OIMUafmSK97Y7iHJ3EaYXgOZMIw="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@babel/template": {
|
"@babel/template": {
|
||||||
"version": "7.8.6",
|
"version": "7.8.6",
|
||||||
"resolved": "https://registry.npm.taobao.org/@babel/template/download/@babel/template-7.8.6.tgz",
|
"resolved": "https://registry.npm.taobao.org/@babel/template/download/@babel/template-7.8.6.tgz",
|
||||||
@ -3382,6 +3398,195 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"compression-webpack-plugin": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/compression-webpack-plugin/download/compression-webpack-plugin-4.0.0.tgz?cache=0&sync_timestamp=1589291140068&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcompression-webpack-plugin%2Fdownload%2Fcompression-webpack-plugin-4.0.0.tgz",
|
||||||
|
"integrity": "sha1-dZn1kgUAAqSc060+4YrnNx4ma8o=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"cacache": "^15.0.3",
|
||||||
|
"find-cache-dir": "^3.3.1",
|
||||||
|
"schema-utils": "^2.6.6",
|
||||||
|
"serialize-javascript": "^3.0.0",
|
||||||
|
"webpack-sources": "^1.4.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"cacache": {
|
||||||
|
"version": "15.0.3",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/cacache/download/cacache-15.0.3.tgz",
|
||||||
|
"integrity": "sha1-IiXC0d2OhyM5lQ1qOcBR4OkzQ5I=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"chownr": "^2.0.0",
|
||||||
|
"fs-minipass": "^2.0.0",
|
||||||
|
"glob": "^7.1.4",
|
||||||
|
"infer-owner": "^1.0.4",
|
||||||
|
"lru-cache": "^5.1.1",
|
||||||
|
"minipass": "^3.1.1",
|
||||||
|
"minipass-collect": "^1.0.2",
|
||||||
|
"minipass-flush": "^1.0.5",
|
||||||
|
"minipass-pipeline": "^1.2.2",
|
||||||
|
"mkdirp": "^1.0.3",
|
||||||
|
"move-file": "^2.0.0",
|
||||||
|
"p-map": "^4.0.0",
|
||||||
|
"promise-inflight": "^1.0.1",
|
||||||
|
"rimraf": "^3.0.2",
|
||||||
|
"ssri": "^8.0.0",
|
||||||
|
"tar": "^6.0.2",
|
||||||
|
"unique-filename": "^1.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"chownr": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/chownr/download/chownr-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-Fb++U9LqtM9w8YqM1o6+Wzyx3s4=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"find-cache-dir": {
|
||||||
|
"version": "3.3.1",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-3.3.1.tgz",
|
||||||
|
"integrity": "sha1-ibM/rUpGcNqpT4Vff74x1thP6IA=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"commondir": "^1.0.1",
|
||||||
|
"make-dir": "^3.0.2",
|
||||||
|
"pkg-dir": "^4.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"find-up": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz",
|
||||||
|
"integrity": "sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"locate-path": "^5.0.0",
|
||||||
|
"path-exists": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"locate-path": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz",
|
||||||
|
"integrity": "sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"p-locate": "^4.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"make-dir": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-3.1.0.tgz?cache=0&sync_timestamp=1587567576732&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmake-dir%2Fdownload%2Fmake-dir-3.1.0.tgz",
|
||||||
|
"integrity": "sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"semver": "^6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mkdirp": {
|
||||||
|
"version": "1.0.4",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz",
|
||||||
|
"integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"p-limit": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.3.0.tgz",
|
||||||
|
"integrity": "sha1-PdM8ZHohT9//2DWTPrCG2g3CHbE=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"p-try": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"p-locate": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz",
|
||||||
|
"integrity": "sha1-o0KLtwiLOmApL2aRkni3wpetTwc=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"p-limit": "^2.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"p-map": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/p-map/download/p-map-4.0.0.tgz",
|
||||||
|
"integrity": "sha1-uy+Vpe2i7BaOySdOBqdHw+KQTSs=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"aggregate-error": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"p-try": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz",
|
||||||
|
"integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"path-exists": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz",
|
||||||
|
"integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"pkg-dir": {
|
||||||
|
"version": "4.2.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz",
|
||||||
|
"integrity": "sha1-8JkTPfft5CLoHR2ESCcO6z5CYfM=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"find-up": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rimraf": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz?cache=0&sync_timestamp=1581257110269&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-3.0.2.tgz",
|
||||||
|
"integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"glob": "^7.1.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"semver": {
|
||||||
|
"version": "6.3.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz?cache=0&sync_timestamp=1586886267748&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-6.3.0.tgz",
|
||||||
|
"integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"serialize-javascript": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/serialize-javascript/download/serialize-javascript-3.0.0.tgz?cache=0&sync_timestamp=1581887711256&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fserialize-javascript%2Fdownload%2Fserialize-javascript-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-SS5Imi13t7gErTkaX12XhwlSVI4=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"ssri": {
|
||||||
|
"version": "8.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/ssri/download/ssri-8.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fssri%2Fdownload%2Fssri-8.0.0.tgz",
|
||||||
|
"integrity": "sha1-ecp04h+M6u3fy0uQFDxFi42YiAg=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"minipass": "^3.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tar": {
|
||||||
|
"version": "6.0.2",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/tar/download/tar-6.0.2.tgz?cache=0&sync_timestamp=1588021389848&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftar%2Fdownload%2Ftar-6.0.2.tgz",
|
||||||
|
"integrity": "sha1-XfF4E0aKYmT/FPdmiGxiK4SuLzk=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"chownr": "^2.0.0",
|
||||||
|
"fs-minipass": "^2.0.0",
|
||||||
|
"minipass": "^3.0.0",
|
||||||
|
"minizlib": "^2.1.0",
|
||||||
|
"mkdirp": "^1.0.3",
|
||||||
|
"yallist": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"yallist": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/yallist/download/yallist-4.0.0.tgz",
|
||||||
|
"integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "http://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz",
|
"resolved": "http://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz",
|
||||||
@ -5113,6 +5318,14 @@
|
|||||||
"websocket-driver": ">=0.5.1"
|
"websocket-driver": ">=0.5.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"feb-alive": {
|
||||||
|
"version": "1.0.9",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/feb-alive/download/feb-alive-1.0.9.tgz",
|
||||||
|
"integrity": "sha1-MhgTZxhevs/uSuCg6ekkf9CEYS8=",
|
||||||
|
"requires": {
|
||||||
|
"@babel/runtime-corejs2": "^7.4.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"figgy-pudding": {
|
"figgy-pudding": {
|
||||||
"version": "3.5.2",
|
"version": "3.5.2",
|
||||||
"resolved": "https://registry.npm.taobao.org/figgy-pudding/download/figgy-pudding-3.5.2.tgz",
|
"resolved": "https://registry.npm.taobao.org/figgy-pudding/download/figgy-pudding-3.5.2.tgz",
|
||||||
@ -7072,8 +7285,7 @@
|
|||||||
"is-promise": {
|
"is-promise": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "http://registry.npm.taobao.org/is-promise/download/is-promise-2.1.0.tgz",
|
"resolved": "http://registry.npm.taobao.org/is-promise/download/is-promise-2.1.0.tgz",
|
||||||
"integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
|
"integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"is-regex": {
|
"is-regex": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
@ -7575,6 +7787,25 @@
|
|||||||
"signal-exit": "^3.0.0"
|
"signal-exit": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"lowdb": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/lowdb/download/lowdb-1.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flowdb%2Fdownload%2Flowdb-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-UkO+ayJ4bMzjDlDJoz6sNrIMgGQ=",
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "^4.1.3",
|
||||||
|
"is-promise": "^2.1.0",
|
||||||
|
"lodash": "4",
|
||||||
|
"pify": "^3.0.0",
|
||||||
|
"steno": "^0.4.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"pify": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/pify/download/pify-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"lower-case": {
|
"lower-case": {
|
||||||
"version": "1.1.4",
|
"version": "1.1.4",
|
||||||
"resolved": "https://registry.npm.taobao.org/lower-case/download/lower-case-1.1.4.tgz",
|
"resolved": "https://registry.npm.taobao.org/lower-case/download/lower-case-1.1.4.tgz",
|
||||||
@ -7918,6 +8149,24 @@
|
|||||||
"minipass": "^3.0.0"
|
"minipass": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"minizlib": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/minizlib/download/minizlib-2.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fminizlib%2Fdownload%2Fminizlib-2.1.0.tgz",
|
||||||
|
"integrity": "sha1-/VLGRTAe8JpjosIJaXwpTGzgLPM=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"minipass": "^3.0.0",
|
||||||
|
"yallist": "^4.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"yallist": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/yallist/download/yallist-4.0.0.tgz",
|
||||||
|
"integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"mississippi": {
|
"mississippi": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npm.taobao.org/mississippi/download/mississippi-3.0.0.tgz",
|
"resolved": "https://registry.npm.taobao.org/mississippi/download/mississippi-3.0.0.tgz",
|
||||||
@ -7979,6 +8228,23 @@
|
|||||||
"run-queue": "^1.0.3"
|
"run-queue": "^1.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"move-file": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/move-file/download/move-file-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-g/+jCbXX9p1RiyjhMz4v+t8zHj4=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"path-exists": "^4.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"path-exists": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz",
|
||||||
|
"integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz",
|
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz",
|
||||||
@ -9882,8 +10148,7 @@
|
|||||||
"regenerator-runtime": {
|
"regenerator-runtime": {
|
||||||
"version": "0.13.5",
|
"version": "0.13.5",
|
||||||
"resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.13.5.tgz?cache=0&sync_timestamp=1584052392667&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.13.5.tgz",
|
"resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.13.5.tgz?cache=0&sync_timestamp=1584052392667&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.13.5.tgz",
|
||||||
"integrity": "sha1-2Hih0JS0MG0QuQlkhLM+vVXiZpc=",
|
"integrity": "sha1-2Hih0JS0MG0QuQlkhLM+vVXiZpc="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"regenerator-transform": {
|
"regenerator-transform": {
|
||||||
"version": "0.14.4",
|
"version": "0.14.4",
|
||||||
@ -11095,6 +11360,14 @@
|
|||||||
"integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=",
|
"integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"steno": {
|
||||||
|
"version": "0.4.4",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/steno/download/steno-0.4.4.tgz",
|
||||||
|
"integrity": "sha1-BxEFvfwobmYVwEA8J+nXtdy4Vcs=",
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "^4.1.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"stream-browserify": {
|
"stream-browserify": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npm.taobao.org/stream-browserify/download/stream-browserify-2.0.2.tgz?cache=0&sync_timestamp=1587041545531&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstream-browserify%2Fdownload%2Fstream-browserify-2.0.2.tgz",
|
"resolved": "https://registry.npm.taobao.org/stream-browserify/download/stream-browserify-2.0.2.tgz?cache=0&sync_timestamp=1587041545531&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstream-browserify%2Fdownload%2Fstream-browserify-2.0.2.tgz",
|
||||||
@ -12293,6 +12566,11 @@
|
|||||||
"brace": "^0.11.0"
|
"brace": "^0.11.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"vuex": {
|
||||||
|
"version": "3.4.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/vuex/download/vuex-3.4.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvuex%2Fdownload%2Fvuex-3.4.0.tgz",
|
||||||
|
"integrity": "sha1-IMwIYGLXUHafzh/rs05/zurr3kU="
|
||||||
|
},
|
||||||
"watchpack": {
|
"watchpack": {
|
||||||
"version": "1.6.1",
|
"version": "1.6.1",
|
||||||
"resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.6.1.tgz",
|
"resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.6.1.tgz",
|
||||||
|
11
package.json
11
package.json
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "go2index-theme-acrou",
|
"name": "go2index-theme-acrou",
|
||||||
"version": "0.1.0",
|
"version": "1.1.0",
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
@ -15,8 +14,11 @@
|
|||||||
"bulma-pageloader": "^0.3.0",
|
"bulma-pageloader": "^0.3.0",
|
||||||
"core-js": "^3.6.4",
|
"core-js": "^3.6.4",
|
||||||
"element-ui": "^2.13.1",
|
"element-ui": "^2.13.1",
|
||||||
|
"feb-alive": "^1.0.9",
|
||||||
"js-base64": "^2.5.2",
|
"js-base64": "^2.5.2",
|
||||||
"js-cookie": "^2.2.1",
|
"js-cookie": "^2.2.1",
|
||||||
|
"lodash": "^4.17.15",
|
||||||
|
"lowdb": "^1.0.0",
|
||||||
"markdown-it": "^10.0.0",
|
"markdown-it": "^10.0.0",
|
||||||
"node-sass": "^4.14.0",
|
"node-sass": "^4.14.0",
|
||||||
"sass-loader": "^8.0.2",
|
"sass-loader": "^8.0.2",
|
||||||
@ -25,15 +27,18 @@
|
|||||||
"vue-clipboard2": "^0.3.1",
|
"vue-clipboard2": "^0.3.1",
|
||||||
"vue-i18n": "^8.17.3",
|
"vue-i18n": "^8.17.3",
|
||||||
"vue-router": "^3.1.6",
|
"vue-router": "^3.1.6",
|
||||||
"vue2-ace-editor": "0.0.15"
|
"vue2-ace-editor": "0.0.15",
|
||||||
|
"vuex": "^3.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@intlify/vue-i18n-loader": "^1.0.0",
|
"@intlify/vue-i18n-loader": "^1.0.0",
|
||||||
"@vue/cli-plugin-babel": "~4.3.0",
|
"@vue/cli-plugin-babel": "~4.3.0",
|
||||||
"@vue/cli-plugin-eslint": "~4.3.0",
|
"@vue/cli-plugin-eslint": "~4.3.0",
|
||||||
|
"@vue/cli-plugin-vuex": "^4.3.1",
|
||||||
"@vue/cli-service": "~4.3.0",
|
"@vue/cli-service": "~4.3.0",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"babel-plugin-component": "^1.1.1",
|
"babel-plugin-component": "^1.1.1",
|
||||||
|
"compression-webpack-plugin": "^4.0.0",
|
||||||
"eslint": "^6.7.2",
|
"eslint": "^6.7.2",
|
||||||
"eslint-plugin-vue": "^6.2.2",
|
"eslint-plugin-vue": "^6.2.2",
|
||||||
"fs": "0.0.1-security",
|
"fs": "0.0.1-security",
|
||||||
|
43
src/App.vue
43
src/App.vue
@ -5,49 +5,28 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import util from '@/libs/util'
|
import util from "@/libs/util";
|
||||||
import Layout from "./views/Layout";
|
import Layout from "./views/Layout";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
components: {
|
components: {
|
||||||
Layout
|
Layout,
|
||||||
},
|
},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {};
|
||||||
config: {
|
|
||||||
siteName: "",
|
|
||||||
title: "",
|
|
||||||
path: ""
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$i18n.locale': 'i18nHandle'
|
"$i18n.locale": "i18nHandle",
|
||||||
},
|
},
|
||||||
created () {
|
created() {
|
||||||
this.i18nHandle(this.$i18n.locale)
|
this.i18nHandle(this.$i18n.locale);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
i18nHandle (val, oldVal) {
|
i18nHandle(val) {
|
||||||
util.cookies.set('lang', val)
|
util.cookies.set("lang", val);
|
||||||
document.querySelector('html').setAttribute('lang', val)
|
document.querySelector("html").setAttribute("lang", val);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
let scripts = ["https://at.alicdn.com/t/font_1760192_zf96psu0uo.js"];
|
|
||||||
scripts.map(item => {
|
|
||||||
let script = document.createElement("script");
|
|
||||||
script.type = "text/javascript";
|
|
||||||
script.src = item;
|
|
||||||
document.getElementsByTagName("head")[0].appendChild(script);
|
|
||||||
});
|
|
||||||
|
|
||||||
let path = window.location.pathname;
|
|
||||||
this.config.path = path;
|
|
||||||
this.config.siteName = document.getElementsByTagName("title")[0].innerText;
|
|
||||||
this.config.title = this.siteName + "-" + decodeURI(path);
|
|
||||||
// this.$refs.layout.render(this.config);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -91,6 +91,9 @@ body {
|
|||||||
min-height: 240px;
|
min-height: 240px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
.el-loading-mask {
|
||||||
|
z-index: initial;
|
||||||
|
}
|
||||||
.pageloader:not(.is-bottom-to-top) {
|
.pageloader:not(.is-bottom-to-top) {
|
||||||
-webkit-transform: initial;
|
-webkit-transform: initial;
|
||||||
transform: initial;
|
transform: initial;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@charset "utf-8";
|
||||||
@import 'bulma';
|
@import 'bulma';
|
||||||
// @import 'bulma-pageloader';
|
// @import 'bulma-pageloader';
|
||||||
@import '~@/assets/style/theme/acrou/index.scss';
|
@import '~@/assets/style/theme/acrou/index.scss';
|
@ -1,45 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-color-picker
|
|
||||||
class="btn-text can-hover"
|
|
||||||
value="#363636"
|
|
||||||
:predefine="predefine"
|
|
||||||
size="mini"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// import { mapState, mapActions } from 'vuex'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'd2-header-color',
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
predefine: [
|
|
||||||
'#ff4500',
|
|
||||||
'#ff8c00',
|
|
||||||
'#ffd700',
|
|
||||||
'#90ee90',
|
|
||||||
'#00ced1',
|
|
||||||
'#1e90ff',
|
|
||||||
'#c71585',
|
|
||||||
'#363636'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// computed: {
|
|
||||||
// ...mapState('d2admin/color', [
|
|
||||||
// 'value'
|
|
||||||
// ])
|
|
||||||
// },
|
|
||||||
watch: {
|
|
||||||
value (value) {
|
|
||||||
this.set(value)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// methods: {
|
|
||||||
// ...mapActions('d2admin/color', [
|
|
||||||
// 'set'
|
|
||||||
// ])
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,15 +0,0 @@
|
|||||||
<template>
|
|
||||||
<a class="navbar-item" @click="handleClick">
|
|
||||||
<i class="fa fa-search"></i>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
methods: {
|
|
||||||
handleClick () {
|
|
||||||
this.$emit('click')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
32
src/layout/header-aside/components/header-setting/index.vue
Normal file
32
src/layout/header-aside/components/header-setting/index.vue
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<template>
|
||||||
|
<div class="navbar-item has-dropdown is-hoverable">
|
||||||
|
<a class="navbar-link is-arrowless" title="Setting">
|
||||||
|
<i class="fa fa-cog" aria-hidden="true"></i>
|
||||||
|
</a>
|
||||||
|
<div class="navbar-dropdown is-left">
|
||||||
|
<a class="navbar-item" @click="cleanCache">
|
||||||
|
<span class="icon">
|
||||||
|
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
{{ $t("setting.clear.text") }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
cleanCache() {
|
||||||
|
this.$notify({
|
||||||
|
title: this.$t("notify.title"),
|
||||||
|
message: this.$t("setting.clear.success"),
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
@ -13,7 +13,7 @@ cookies.set = function (name = 'default', value = '', cookieSetting = {}) {
|
|||||||
expires: 1
|
expires: 1
|
||||||
}
|
}
|
||||||
Object.assign(currentCookieSetting, cookieSetting)
|
Object.assign(currentCookieSetting, cookieSetting)
|
||||||
Cookies.set(`d2admin-${process.env.VUE_APP_VERSION}-${name}`, value, currentCookieSetting)
|
Cookies.set(`go2index-${process.env.APP_VERSION}-${name}`, value, currentCookieSetting)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,7 +21,7 @@ cookies.set = function (name = 'default', value = '', cookieSetting = {}) {
|
|||||||
* @param {String} name cookie name
|
* @param {String} name cookie name
|
||||||
*/
|
*/
|
||||||
cookies.get = function (name = 'default') {
|
cookies.get = function (name = 'default') {
|
||||||
return Cookies.get(`d2admin-${process.env.VUE_APP_VERSION}-${name}`)
|
return Cookies.get(`go2index-${process.env.APP_VERSION}-${name}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,7 +36,7 @@ cookies.getAll = function () {
|
|||||||
* @param {String} name cookie name
|
* @param {String} name cookie name
|
||||||
*/
|
*/
|
||||||
cookies.remove = function (name = 'default') {
|
cookies.remove = function (name = 'default') {
|
||||||
return Cookies.remove(`d2admin-${process.env.VUE_APP_VERSION}-${name}`)
|
return Cookies.remove(`go2index-${process.env.APP_VERSION}-${name}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default cookies
|
export default cookies
|
||||||
|
106
src/libs/util.db.js
Normal file
106
src/libs/util.db.js
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
import low from 'lowdb'
|
||||||
|
import LocalStorage from 'lowdb/adapters/LocalStorage'
|
||||||
|
import util from '@/libs/util'
|
||||||
|
import { cloneDeep } from 'lodash'
|
||||||
|
|
||||||
|
const adapter = new LocalStorage(`go2index-${process.env.APP_VERSION}`)
|
||||||
|
const db = low(adapter)
|
||||||
|
|
||||||
|
db
|
||||||
|
.defaults({
|
||||||
|
sys: {},
|
||||||
|
database: {}
|
||||||
|
})
|
||||||
|
.write()
|
||||||
|
|
||||||
|
export default db
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 检查路径是否存在 不存在的话初始化
|
||||||
|
* @param {Object} payload dbName {String} 数据库名称
|
||||||
|
* @param {Object} payload path {String} 路径
|
||||||
|
* @param {Object} payload user {Boolean} 区分用户
|
||||||
|
* @param {Object} payload validator {Function} 数据校验钩子 返回 true 表示验证通过
|
||||||
|
* @param {Object} payload defaultValue {*} 初始化默认值
|
||||||
|
* @returns {String} 可以直接使用的路径
|
||||||
|
*/
|
||||||
|
export function pathInit ({
|
||||||
|
dbName = 'database',
|
||||||
|
path = '',
|
||||||
|
user = true,
|
||||||
|
validator = () => true,
|
||||||
|
defaultValue = ''
|
||||||
|
}) {
|
||||||
|
const uuid = util.cookies.get('uuid') || 'ghost-uuid'
|
||||||
|
const currentPath = `${dbName}.${user ? `user.${uuid}` : 'public'}${path ? `.${path}` : ''}`
|
||||||
|
const value = db.get(currentPath).value()
|
||||||
|
if (!(value !== undefined && validator(value))) {
|
||||||
|
db
|
||||||
|
.set(currentPath, defaultValue)
|
||||||
|
.write()
|
||||||
|
}
|
||||||
|
return currentPath
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 将数据存储到指定位置 | 路径不存在会自动初始化
|
||||||
|
* @description 效果类似于取值 dbName.path = value
|
||||||
|
* @param {Object} payload dbName {String} 数据库名称
|
||||||
|
* @param {Object} payload path {String} 存储路径
|
||||||
|
* @param {Object} payload value {*} 需要存储的值
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
export function dbSet ({
|
||||||
|
dbName = 'database',
|
||||||
|
path = '',
|
||||||
|
value = '',
|
||||||
|
user = false
|
||||||
|
}) {
|
||||||
|
db.set(pathInit({
|
||||||
|
dbName,
|
||||||
|
path,
|
||||||
|
user
|
||||||
|
}), value).write()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 获取数据
|
||||||
|
* @description 效果类似于取值 dbName.path || defaultValue
|
||||||
|
* @param {Object} payload dbName {String} 数据库名称
|
||||||
|
* @param {Object} payload path {String} 存储路径
|
||||||
|
* @param {Object} payload defaultValue {*} 取值失败的默认值
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
export function dbGet ({
|
||||||
|
dbName = 'database',
|
||||||
|
path = '',
|
||||||
|
defaultValue = '',
|
||||||
|
user = false
|
||||||
|
}) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
resolve(cloneDeep(db.get(pathInit({
|
||||||
|
dbName,
|
||||||
|
path,
|
||||||
|
user,
|
||||||
|
defaultValue
|
||||||
|
})).value()))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 获取存储数据库对象
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
export function database ({
|
||||||
|
dbName = 'database',
|
||||||
|
path = '',
|
||||||
|
user = false,
|
||||||
|
validator = () => true,
|
||||||
|
defaultValue = ''
|
||||||
|
} = {}) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
resolve(db.get(pathInit({
|
||||||
|
dbName, path, user, validator, defaultValue
|
||||||
|
})))
|
||||||
|
})
|
||||||
|
}
|
@ -1,10 +1,10 @@
|
|||||||
import cookies from './util.cookies'
|
import cookies from './util.cookies'
|
||||||
// import db from './util.db'
|
import db from './util.db'
|
||||||
// import log from './util.log'
|
// import log from './util.log'
|
||||||
|
|
||||||
const util = {
|
const util = {
|
||||||
cookies,
|
cookies,
|
||||||
// db,
|
db,
|
||||||
// log
|
// log
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ const util = {
|
|||||||
* @param {String} title 标题
|
* @param {String} title 标题
|
||||||
*/
|
*/
|
||||||
util.title = function (titleText) {
|
util.title = function (titleText) {
|
||||||
const processTitle = process.env.VUE_APP_TITLE || 'D2Admin'
|
const processTitle = process.env.VUE_APP_TITLE || 'GoIndex'
|
||||||
window.document.title = `${processTitle}${titleText ? ` | ${titleText}` : ''}`
|
window.document.title = `${processTitle}${titleText ? ` | ${titleText}` : ''}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"_name": "English",
|
"_name": "🇬🇧English",
|
||||||
"languages": "Languages",
|
"languages": "Languages",
|
||||||
"index": "Index",
|
"index": "Index",
|
||||||
"folder": "Folder",
|
"folder": "Folder",
|
||||||
@ -37,5 +37,11 @@
|
|||||||
"text": {
|
"text": {
|
||||||
"loading": "Loading..."
|
"loading": "Loading..."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"setting": {
|
||||||
|
"clear": {
|
||||||
|
"text": "Clean cache",
|
||||||
|
"success": "Cache cleanup successful"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,41 +1,47 @@
|
|||||||
{
|
{
|
||||||
"_name": "简体中文",
|
"_name": "🇨🇳简体中文",
|
||||||
"languages": "选择语言",
|
"languages": "选择语言",
|
||||||
"index": "首页",
|
"index": "首页",
|
||||||
"folder": "文件夹",
|
"folder": "文件夹",
|
||||||
"notify": {
|
"notify": {
|
||||||
"title": "提示"
|
"title": "提示"
|
||||||
|
},
|
||||||
|
"copy": {
|
||||||
|
"success": "复制成功",
|
||||||
|
"error": "复制失败"
|
||||||
|
},
|
||||||
|
"list": {
|
||||||
|
"auth": "目录加密,请输入密码",
|
||||||
|
"title": {
|
||||||
|
"file": "文件",
|
||||||
|
"moditime": "修改时间",
|
||||||
|
"size": "大小",
|
||||||
|
"operation": "操作"
|
||||||
},
|
},
|
||||||
"copy": {
|
"loading": "加载中...",
|
||||||
"success": "复制成功",
|
"opt": {
|
||||||
"error": "复制失败"
|
"copy": "复制链接",
|
||||||
},
|
"newTab": "打开新的标签页",
|
||||||
"list": {
|
"download": "下载"
|
||||||
"auth": "目录加密,请输入密码",
|
|
||||||
"title": {
|
|
||||||
"file": "文件",
|
|
||||||
"moditime": "修改时间",
|
|
||||||
"size": "大小",
|
|
||||||
"operation": "操作"
|
|
||||||
},
|
|
||||||
"loading": "加载中...",
|
|
||||||
"opt": {
|
|
||||||
"copy": "复制链接",
|
|
||||||
"newTab": "打开新的标签页",
|
|
||||||
"download": "下载"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"search": {
|
|
||||||
"placeholder": "搜索..."
|
|
||||||
},
|
|
||||||
"page": {
|
|
||||||
"video": {
|
|
||||||
"play": "播放",
|
|
||||||
"download": "下载",
|
|
||||||
"link": "下载地址"
|
|
||||||
},
|
|
||||||
"text": {
|
|
||||||
"loading": "加载中..."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"search": {
|
||||||
|
"placeholder": "搜索..."
|
||||||
|
},
|
||||||
|
"page": {
|
||||||
|
"video": {
|
||||||
|
"play": "播放",
|
||||||
|
"download": "下载",
|
||||||
|
"link": "下载地址"
|
||||||
|
},
|
||||||
|
"text": {
|
||||||
|
"loading": "加载中..."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"setting": {
|
||||||
|
"clear": {
|
||||||
|
"text": "清理缓存",
|
||||||
|
"success": "缓存清理成功"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,41 +1,47 @@
|
|||||||
{
|
{
|
||||||
"_name": "繁体中文",
|
"_name": "🇨🇳繁体中文",
|
||||||
"languages": "選擇語言",
|
"languages": "選擇語言",
|
||||||
"index": "首頁",
|
"index": "首頁",
|
||||||
"folder": "文件夾",
|
"folder": "文件夾",
|
||||||
"notify": {
|
"notify": {
|
||||||
"title": "提示"
|
"title": "提示"
|
||||||
|
},
|
||||||
|
"copy": {
|
||||||
|
"success": "復制成功",
|
||||||
|
"error": "復制失敗"
|
||||||
|
},
|
||||||
|
"list": {
|
||||||
|
"auth": "目錄加密,請輸入密碼",
|
||||||
|
"title": {
|
||||||
|
"file": "文件",
|
||||||
|
"moditime": "修改時間",
|
||||||
|
"size": "大小",
|
||||||
|
"operation": "操作"
|
||||||
},
|
},
|
||||||
"copy": {
|
"loading": "加載中...",
|
||||||
"success": "復制成功",
|
"opt": {
|
||||||
"error": "復制失敗"
|
"copy": "復制鏈接",
|
||||||
},
|
"newTab": "打開新的標簽頁",
|
||||||
"list": {
|
"download": "下載"
|
||||||
"auth": "目錄加密,請輸入密碼",
|
|
||||||
"title": {
|
|
||||||
"file": "文件",
|
|
||||||
"moditime": "修改時間",
|
|
||||||
"size": "大小",
|
|
||||||
"operation": "操作"
|
|
||||||
},
|
|
||||||
"loading": "加載中...",
|
|
||||||
"opt": {
|
|
||||||
"copy": "復制鏈接",
|
|
||||||
"newTab": "打開新的標簽頁",
|
|
||||||
"download": "下載"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"search": {
|
|
||||||
"placeholder": "搜索..."
|
|
||||||
},
|
|
||||||
"page": {
|
|
||||||
"video": {
|
|
||||||
"play": "播放",
|
|
||||||
"download": "下載",
|
|
||||||
"link": "下載地址"
|
|
||||||
},
|
|
||||||
"text": {
|
|
||||||
"loading": "加載中..."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"search": {
|
||||||
|
"placeholder": "搜索..."
|
||||||
|
},
|
||||||
|
"page": {
|
||||||
|
"video": {
|
||||||
|
"play": "播放",
|
||||||
|
"download": "下載",
|
||||||
|
"link": "下載地址"
|
||||||
|
},
|
||||||
|
"text": {
|
||||||
|
"loading": "加載中..."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"setting": {
|
||||||
|
"clear": {
|
||||||
|
"text": "清理緩存",
|
||||||
|
"success": "緩存清理成功"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import ElementUI from 'element-ui'
|
import ElementUI from 'element-ui'
|
||||||
import 'element-ui/lib/theme-chalk/color-picker.css'
|
import 'element-ui/lib/theme-chalk/icon.css'
|
||||||
import 'element-ui/lib/theme-chalk/base.css'
|
|
||||||
import 'element-ui/lib/theme-chalk/button.css'
|
|
||||||
import 'element-ui/lib/theme-chalk/notification.css'
|
import 'element-ui/lib/theme-chalk/notification.css'
|
||||||
import 'element-ui/lib/theme-chalk/loading.css'
|
import 'element-ui/lib/theme-chalk/loading.css'
|
||||||
import axios from '@utils/axios'
|
import axios from '@utils/axios'
|
||||||
import VueAxios from 'vue-axios'
|
import VueAxios from 'vue-axios'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
import i18n from './i18n'
|
import i18n from './i18n'
|
||||||
|
// store
|
||||||
|
import store from '@/store/index'
|
||||||
import VueClipboard from 'vue-clipboard2'
|
import VueClipboard from 'vue-clipboard2'
|
||||||
import "@/assets/style/theme/register.scss"
|
import "@/assets/style/theme/register.scss"
|
||||||
|
|
||||||
@ -20,6 +20,7 @@ Vue.use(VueClipboard)
|
|||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
router,
|
router,
|
||||||
|
store,
|
||||||
i18n,
|
i18n,
|
||||||
render: h => h(App)
|
render: h => h(App)
|
||||||
}).$mount('#app')
|
}).$mount('#app')
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
|
import febAlive from "feb-alive";
|
||||||
import VueRouter from "vue-router";
|
import VueRouter from "vue-router";
|
||||||
// 路由数据
|
// 路由数据
|
||||||
import routes from "./routes";
|
import routes from "./routes";
|
||||||
|
|
||||||
|
// 在router实例化之前重写history
|
||||||
|
febAlive.resetHistory();
|
||||||
|
|
||||||
// fix vue-router NavigationDuplicated
|
// fix vue-router NavigationDuplicated
|
||||||
const VueRouterPush = VueRouter.prototype.push;
|
const VueRouterPush = VueRouter.prototype.push;
|
||||||
VueRouter.prototype.push = function push(location) {
|
VueRouter.prototype.push = function push(location) {
|
||||||
@ -19,11 +23,20 @@ Vue.use(VueRouter);
|
|||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
mode: "history",
|
mode: "history",
|
||||||
scrollBehavior(to, from, savePosition) {
|
scrollBehavior(to, from, savePosition) {
|
||||||
return { x: 0, y: 0 };
|
if (savePosition) {
|
||||||
|
return savePosition;
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
},
|
},
|
||||||
routes,
|
routes,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Vue.use(febAlive, { router });
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由拦截
|
* 路由拦截
|
||||||
* 权限验证
|
* 权限验证
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
const _import = require("@/libs/util.import." + process.env.NODE_ENV);
|
const _import = require("@/libs/util.import." + process.env.NODE_ENV);
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
keepAlive: true
|
// keepAlive: true
|
||||||
|
disableCache: false
|
||||||
}
|
}
|
||||||
|
|
||||||
const frameIn = [{
|
const frameIn = [{
|
||||||
|
12
src/store/index.js
Normal file
12
src/store/index.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import Vuex from 'vuex'
|
||||||
|
|
||||||
|
import acrou from './modules/acrou'
|
||||||
|
|
||||||
|
Vue.use(Vuex)
|
||||||
|
|
||||||
|
export default new Vuex.Store({
|
||||||
|
modules: {
|
||||||
|
acrou
|
||||||
|
}
|
||||||
|
})
|
16
src/store/modules/acrou/index.js
Normal file
16
src/store/modules/acrou/index.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* The file enables `@/store/index.js` to import all vuex modules
|
||||||
|
* in a one-shot manner. There should not be any reason to edit this file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const files = require.context('./modules', false, /\.js$/)
|
||||||
|
const modules = {}
|
||||||
|
|
||||||
|
files.keys().forEach(key => {
|
||||||
|
modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default
|
||||||
|
})
|
||||||
|
|
||||||
|
export default {
|
||||||
|
namespaced: true,
|
||||||
|
modules
|
||||||
|
}
|
157
src/store/modules/acrou/modules/db.js
Normal file
157
src/store/modules/acrou/modules/db.js
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
import router from '@/router'
|
||||||
|
import { cloneDeep } from 'lodash'
|
||||||
|
import { database as getDatabase, dbGet, dbSet } from '@/libs/util.db'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
namespaced: true,
|
||||||
|
actions: {
|
||||||
|
/**
|
||||||
|
* @description 将数据存储到指定位置 | 路径不存在会自动初始化
|
||||||
|
* @description 效果类似于取值 dbName.path = value
|
||||||
|
* @param {Object} context
|
||||||
|
* @param {Object} payload dbName {String} 数据库名称
|
||||||
|
* @param {Object} payload path {String} 存储路径
|
||||||
|
* @param {Object} payload value {*} 需要存储的值
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
set (context, {
|
||||||
|
dbName = 'database',
|
||||||
|
path = '',
|
||||||
|
value = '',
|
||||||
|
user = false
|
||||||
|
}) {
|
||||||
|
dbSet({ dbName, path, value, user })
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 获取数据
|
||||||
|
* @description 效果类似于取值 dbName.path || defaultValue
|
||||||
|
* @param {Object} context
|
||||||
|
* @param {Object} payload dbName {String} 数据库名称
|
||||||
|
* @param {Object} payload path {String} 存储路径
|
||||||
|
* @param {Object} payload defaultValue {*} 取值失败的默认值
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
get (context, {
|
||||||
|
dbName = 'database',
|
||||||
|
path = '',
|
||||||
|
defaultValue = '',
|
||||||
|
user = false
|
||||||
|
}) {
|
||||||
|
return dbGet({ dbName, path, defaultValue, user })
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 获取存储数据库对象
|
||||||
|
* @param {Object} context
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
database (context, {
|
||||||
|
user = false
|
||||||
|
} = {}) {
|
||||||
|
return getDatabase({
|
||||||
|
user,
|
||||||
|
defaultValue: {}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 清空存储数据库对象
|
||||||
|
* @param {Object} context
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
databaseClear (context, {
|
||||||
|
user = false
|
||||||
|
} = {}) {
|
||||||
|
return getDatabase({
|
||||||
|
user,
|
||||||
|
validator: () => false,
|
||||||
|
defaultValue: {}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 获取存储数据库对象 [ 区分页面 ]
|
||||||
|
* @param {Object} context
|
||||||
|
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
databasePage (context, {
|
||||||
|
basis = 'fullPath',
|
||||||
|
user = false
|
||||||
|
} = {}) {
|
||||||
|
return getDatabase({
|
||||||
|
path: `$page.${router.app.$route[basis]}`,
|
||||||
|
user,
|
||||||
|
defaultValue: {}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 清空存储数据库对象 [ 区分页面 ]
|
||||||
|
* @param {Object} context
|
||||||
|
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
databasePageClear (context, {
|
||||||
|
basis = 'fullPath',
|
||||||
|
user = false
|
||||||
|
} = {}) {
|
||||||
|
return getDatabase({
|
||||||
|
path: `$page.${router.app.$route[basis]}`,
|
||||||
|
user,
|
||||||
|
validator: () => false,
|
||||||
|
defaultValue: {}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 快速将页面当前的数据 ( $data ) 持久化
|
||||||
|
* @param {Object} context
|
||||||
|
* @param {Object} payload instance {Object} vue 实例
|
||||||
|
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
pageSet (context, {
|
||||||
|
instance,
|
||||||
|
basis = 'fullPath',
|
||||||
|
user = false
|
||||||
|
}) {
|
||||||
|
return getDatabase({
|
||||||
|
path: `$page.${router.app.$route[basis]}.$data`,
|
||||||
|
user,
|
||||||
|
validator: () => false,
|
||||||
|
defaultValue: cloneDeep(instance.$data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 快速获取页面快速持久化的数据
|
||||||
|
* @param {Object} context
|
||||||
|
* @param {Object} payload instance {Object} vue 实例
|
||||||
|
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
pageGet (context, {
|
||||||
|
instance,
|
||||||
|
basis = 'fullPath',
|
||||||
|
user = false
|
||||||
|
}) {
|
||||||
|
return dbGet({
|
||||||
|
path: `$page.${router.app.$route[basis]}.$data`,
|
||||||
|
user,
|
||||||
|
defaultValue: cloneDeep(instance.$data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 清空页面快照
|
||||||
|
* @param {Object} context
|
||||||
|
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
|
||||||
|
* @param {Object} payload user {Boolean} 是否区分用户
|
||||||
|
*/
|
||||||
|
pageClear (context, {
|
||||||
|
basis = 'fullPath',
|
||||||
|
user = false
|
||||||
|
}) {
|
||||||
|
return getDatabase({
|
||||||
|
path: `$page.${router.app.$route[basis]}.$data`,
|
||||||
|
user,
|
||||||
|
validator: () => false,
|
||||||
|
defaultValue: {}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,27 +1,27 @@
|
|||||||
import axios from "@utils/axios";
|
import axios from "@utils/axios";
|
||||||
let Base64 = require("js-base64").Base64;
|
let Base64 = require("js-base64").Base64;
|
||||||
|
|
||||||
const exts = [
|
// const exts = [
|
||||||
"html",
|
// "html",
|
||||||
"php",
|
// "php",
|
||||||
"css",
|
// "css",
|
||||||
"go",
|
// "go",
|
||||||
"java",
|
// "java",
|
||||||
"js",
|
// "js",
|
||||||
"json",
|
// "json",
|
||||||
"py",
|
// "py",
|
||||||
"txt",
|
// "txt",
|
||||||
"sh",
|
// "sh",
|
||||||
"md",
|
// "md",
|
||||||
"mp4",
|
// "mp4",
|
||||||
"webm",
|
// "webm",
|
||||||
"mkv",
|
// "mkv",
|
||||||
"bmp",
|
// "bmp",
|
||||||
"jpg",
|
// "jpg",
|
||||||
"jpeg",
|
// "jpeg",
|
||||||
"png",
|
// "png",
|
||||||
"gif",
|
// "gif",
|
||||||
];
|
// ];
|
||||||
|
|
||||||
export const checkoutPath = (path, file) => {
|
export const checkoutPath = (path, file) => {
|
||||||
if (file.mimeType === "application/vnd.google-apps.folder") {
|
if (file.mimeType === "application/vnd.google-apps.folder") {
|
||||||
@ -38,7 +38,6 @@ export const checkView = (path) => {
|
|||||||
.split(".")
|
.split(".")
|
||||||
.pop()
|
.pop()
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
console.log(path)
|
|
||||||
let base64Path = encode64(path);
|
let base64Path = encode64(path);
|
||||||
if ("|html|php|css|go|java|js|json|txt|sh|md|".indexOf(`|${ext}|`) >= 0) {
|
if ("|html|php|css|go|java|js|json|txt|sh|md|".indexOf(`|${ext}|`) >= 0) {
|
||||||
path = path.replace(/\/(\d+:)\/.*/, (p1, p2) => {
|
path = path.replace(/\/(\d+:)\/.*/, (p1, p2) => {
|
||||||
@ -101,7 +100,6 @@ export function get_file(option, callback) {
|
|||||||
var modifiedTime = option.file.modifiedTime;
|
var modifiedTime = option.file.modifiedTime;
|
||||||
var key = "file_path_" + path + modifiedTime;
|
var key = "file_path_" + path + modifiedTime;
|
||||||
var data = localStorage.getItem(key);
|
var data = localStorage.getItem(key);
|
||||||
data = "";
|
|
||||||
if (data) {
|
if (data) {
|
||||||
return callback(data);
|
return callback(data);
|
||||||
} else {
|
} else {
|
||||||
|
@ -4,9 +4,11 @@
|
|||||||
<section class="section">
|
<section class="section">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<bread-crumb ref="breadcrumb"></bread-crumb>
|
<bread-crumb ref="breadcrumb"></bread-crumb>
|
||||||
<keep-alive>
|
<!-- <keep-alive> -->
|
||||||
|
<feb-alive>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</keep-alive>
|
</feb-alive>
|
||||||
|
<!-- </keep-alive> -->
|
||||||
<Footer></Footer>
|
<Footer></Footer>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -14,11 +16,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Head from "./common/Head"
|
import Head from "./common/Head";
|
||||||
import BreadCrumb from "./common/BreadCrumb";
|
import BreadCrumb from "./common/BreadCrumb";
|
||||||
import Footer from "./common/Footer"
|
import Footer from "./common/Footer";
|
||||||
export default {
|
export default {
|
||||||
data: function () {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
path: "",
|
path: "",
|
||||||
show: "list",
|
show: "list",
|
||||||
@ -33,12 +35,12 @@ export default {
|
|||||||
Footer: Footer,
|
Footer: Footer,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setHeadmd (val) {
|
setHeadmd(val) {
|
||||||
this.headmd = val;
|
this.headmd = val;
|
||||||
},
|
},
|
||||||
setReadmemd (val) {
|
setReadmemd(val) {
|
||||||
this.readmemd = val;
|
this.readmemd = val;
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -58,11 +58,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <header-search /> -->
|
|
||||||
<header-locales />
|
<header-locales />
|
||||||
<div class="navbar-item">
|
|
||||||
<header-color />
|
|
||||||
</div>
|
|
||||||
<a
|
<a
|
||||||
class="navbar-item"
|
class="navbar-item"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -72,6 +68,7 @@
|
|||||||
>
|
>
|
||||||
<i class="fab fa-github"></i>
|
<i class="fab fa-github"></i>
|
||||||
</a>
|
</a>
|
||||||
|
<header-setting />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -79,14 +76,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import headerSearch from "@/layout/header-aside/components/header-search";
|
|
||||||
import headerLocales from "@/layout/header-aside/components/header-locales";
|
import headerLocales from "@/layout/header-aside/components/header-locales";
|
||||||
import headerColor from "@/layout/header-aside/components/header-color";
|
import headerSetting from "@/layout/header-aside/components/header-setting";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
headerSearch,
|
|
||||||
headerLocales,
|
headerLocales,
|
||||||
headerColor,
|
headerSetting,
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.siteName = document.getElementsByTagName("title")[0].innerText;
|
this.siteName = document.getElementsByTagName("title")[0].innerText;
|
||||||
|
@ -236,7 +236,7 @@ export default {
|
|||||||
},
|
},
|
||||||
copy(path) {
|
copy(path) {
|
||||||
let origin = window.location.origin;
|
let origin = window.location.origin;
|
||||||
path = origin + path;
|
path = origin + encodeURI(path);
|
||||||
this.$copyText(path)
|
this.$copyText(path)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
@ -333,19 +333,5 @@ export default {
|
|||||||
return "#" + (this.icon[type] ? this.icon[type] : "icon-weizhi");
|
return "#" + (this.icon[type] ? this.icon[type] : "icon-weizhi");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
$route(to, from) {
|
|
||||||
// 后退设置page_token为空
|
|
||||||
if (to.path.length < from.path.length) {
|
|
||||||
this.page.page_token = null;
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
to.path.indexOf(":search") > 0 ||
|
|
||||||
(to.path.substr(-1) === "/" && from.meta.view === "list")
|
|
||||||
) {
|
|
||||||
this.render();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label">{{$t('page.video.link')}}</label>
|
<label class="label">{{$t('page.video.link')}}</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input class="input" type="text" :value="decodeURIComponent(videourl)" />
|
<input class="input" type="text" :value="videourl" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="columns is-mobile is-multiline has-text-centered">
|
<div class="columns is-mobile is-multiline has-text-centered">
|
||||||
@ -97,7 +97,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
render () {
|
render () {
|
||||||
// 便于开发环境调试
|
// 便于开发环境调试
|
||||||
this.videourl = window.location.origin + this.url;
|
this.videourl = window.location.origin + encodeURI(this.url);
|
||||||
this.apiurl =
|
this.apiurl =
|
||||||
"https://api.jsonpop.cn/demo/blplyaer/?url=" + this.videourl;
|
"https://api.jsonpop.cn/demo/blplyaer/?url=" + this.videourl;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const cdnDependencies = require("./dependencies-cdn");
|
const cdnDependencies = require("./dependencies-cdn");
|
||||||
const BuildAppJSPlugin = require("./buildAppJSPlugin");
|
const BuildAppJSPlugin = require("./buildAppJSPlugin");
|
||||||
|
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||||
|
|
||||||
function resolve(dir) {
|
function resolve(dir) {
|
||||||
return path.join(__dirname, dir);
|
return path.join(__dirname, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 增加环境变量
|
||||||
|
process.env.APP_VERSION = require('./package.json').version
|
||||||
|
|
||||||
// 基础路径 注意发布之前要先修改这里
|
// 基础路径 注意发布之前要先修改这里
|
||||||
let publicPath = process.env.VUE_APP_PUBLIC_PATH || "/";
|
let publicPath = process.env.VUE_APP_PUBLIC_PATH || "/";
|
||||||
|
|
||||||
@ -25,11 +29,21 @@ module.exports = {
|
|||||||
lintOnSave: true,
|
lintOnSave: true,
|
||||||
|
|
||||||
configureWebpack: (config) => {
|
configureWebpack: (config) => {
|
||||||
const configNew = {};
|
const configNew = {}
|
||||||
if (process.env.NODE_ENV === "production") {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
configNew.externals = externals;
|
configNew.externals = externals
|
||||||
|
configNew.plugins = [
|
||||||
|
// gzip
|
||||||
|
new CompressionWebpackPlugin({
|
||||||
|
filename: '[path].gz[query]',
|
||||||
|
test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'),
|
||||||
|
threshold: 10240,
|
||||||
|
minRatio: 0.8,
|
||||||
|
deleteOriginalAssets: false
|
||||||
|
})
|
||||||
|
]
|
||||||
}
|
}
|
||||||
return configNew;
|
return configNew
|
||||||
},
|
},
|
||||||
|
|
||||||
chainWebpack: (config) => {
|
chainWebpack: (config) => {
|
||||||
@ -42,12 +56,16 @@ module.exports = {
|
|||||||
args[0].cdn = cdn;
|
args[0].cdn = cdn;
|
||||||
} else {
|
} else {
|
||||||
args[0].cdn = {
|
args[0].cdn = {
|
||||||
|
js: cdnDependencies.filter((e) => e.name === "").map((e) => e.js),
|
||||||
css: cdnDependencies.filter((e) => e.name === "").map((e) => e.css),
|
css: cdnDependencies.filter((e) => e.name === "").map((e) => e.css),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
args[0].inject = false
|
args[0].inject = false
|
||||||
return args;
|
return args;
|
||||||
});
|
});
|
||||||
|
// 解决 cli3 热更新失效 https://github.com/vuejs/vue-cli/issues/1559
|
||||||
|
config.resolve
|
||||||
|
.symlinks(true)
|
||||||
config.resolve.alias
|
config.resolve.alias
|
||||||
.set("@", resolve("src"))
|
.set("@", resolve("src"))
|
||||||
.set("@assets", resolve("src/assets"))
|
.set("@assets", resolve("src/assets"))
|
||||||
|
Loading…
Reference in New Issue
Block a user