add basic QR functionality (#126)
This commit is contained in:
parent
ed0ea34161
commit
4e15b82896
|
@ -4419,6 +4419,26 @@
|
||||||
"flat-cache": "^2.0.1"
|
"flat-cache": "^2.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flat-cache": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"chardet": "^0.7.0",
|
||||||
|
"iconv-lite": "^0.4.24",
|
||||||
|
"tmp": "^0.0.33"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"file-entry-cache": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"flat-cache": "^2.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flat-cache": {
|
"flat-cache": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
|
||||||
|
@ -8976,6 +8996,11 @@
|
||||||
"integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
|
"integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"qrcode.vue": {
|
||||||
|
"version": "1.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/qrcode.vue/-/qrcode.vue-1.6.1.tgz",
|
||||||
|
"integrity": "sha512-Qo0zpAQVTdRZsmquppZShMQOaxg/JhzTsoQtlIxTTgwHr2oVg4mhCah41MtBYi67O00D342dzgU4YyECSK04FA=="
|
||||||
|
},
|
||||||
"qs": {
|
"qs": {
|
||||||
"version": "6.5.2",
|
"version": "6.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
"moment": "^2.24.0",
|
"moment": "^2.24.0",
|
||||||
"normalize.css": "^8.0.1",
|
"normalize.css": "^8.0.1",
|
||||||
"noty": "^3.2.0-beta",
|
"noty": "^3.2.0-beta",
|
||||||
|
"qrcode.vue": "^1.6.1",
|
||||||
"vue": "^2.6.9",
|
"vue": "^2.6.9",
|
||||||
"vue-i18n": "^8.9.0",
|
"vue-i18n": "^8.9.0",
|
||||||
"vue-router": "^3.0.2",
|
"vue-router": "^3.0.2",
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
<path d="M0 0h24v24H0z" fill="none"/>
|
<path d="M0 0h24v24H0z" fill="none"/>
|
||||||
</svg>
|
</svg>
|
||||||
<h1 class="share__box__title">{{ file.name }}</h1>
|
<h1 class="share__box__title">{{ file.name }}</h1>
|
||||||
|
<qrcode-vue :value="fullLink" size="200" level="M"></qrcode-vue>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -23,9 +24,13 @@
|
||||||
<script>
|
<script>
|
||||||
import { share as api } from '@/api'
|
import { share as api } from '@/api'
|
||||||
import { baseURL } from '@/utils/constants'
|
import { baseURL } from '@/utils/constants'
|
||||||
|
import QrcodeVue from 'qrcode.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'share',
|
name: 'share',
|
||||||
|
components: {
|
||||||
|
QrcodeVue
|
||||||
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
loaded: false,
|
loaded: false,
|
||||||
notFound: false,
|
notFound: false,
|
||||||
|
@ -44,6 +49,9 @@ export default {
|
||||||
link: function () {
|
link: function () {
|
||||||
return `${baseURL}/api/public/dl/${this.hash}`
|
return `${baseURL}/api/public/dl/${this.hash}`
|
||||||
},
|
},
|
||||||
|
fullLink: function () {
|
||||||
|
return window.location.origin + this.link
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchData: async function () {
|
fetchData: async function () {
|
||||||
|
|
Loading…
Reference in New Issue