Add files via upload

This commit is contained in:
niubility000 2021-10-25 11:19:26 +08:00 committed by GitHub
parent cd0a32afc5
commit 5d86774e19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -305,14 +305,14 @@ export default {
for (let j = i - 1; j >= 0; j--) { for (let j = i - 1; j >= 0; j--) {
if (mediaTypes.includes(this.listing[j].type)) { if (mediaTypes.includes(this.listing[j].type)) {
this.previousLink = this.listing[j].url; this.previousLink = this.listing[j].url;
this.previousRaw=`${this.prefetchUrl(this.listing[j],this.previousLink)}&inline=true`; this.previousRaw=`${this.prefetchUrl(this.listing[j], this.previousLink)}&inline=true`;
break; break;
} }
} }
for (let j = i + 1; j < this.listing.length; j++) { for (let j = i + 1; j < this.listing.length; j++) {
if (mediaTypes.includes(this.listing[j].type)) { if (mediaTypes.includes(this.listing[j].type)) {
this.nextLink = this.listing[j].url; this.nextLink = this.listing[j].url;
this.nextRaw=`${this.prefetchUrl(this.listing[j],this.nextLink)}&inline=true`; this.nextRaw=`${this.prefetchUrl(this.listing[j], this.nextLink)}&inline=true`;
break; break;
} }
} }
@ -320,13 +320,15 @@ export default {
return; return;
} }
}, },
prefetchUrl: function(item,link) { prefetchUrl: function(item, routePath) {
const key = Date.parse(item.modified); const key = Date.parse(item.modified);
if (item.type === "image" && !this.fullSize) { if (item.type === "image" && !this.fullSize) {
return `${baseURL}/api/preview/big${link.slice(6)}?k=${key}`; return `${baseURL}/api/preview/big${routePath.slice(6)}?k=${key}`;
} else { } else if (item.type === "image"){
return `${baseURL}/api/raw${link.slice(6)}?k=${key}`; return `${baseURL}/api/raw${routePath.slice(6)}?k=${key}`;
} } else{
return "";
}
}, },
openMore() { openMore() {
this.$store.commit("showHover", "more"); this.$store.commit("showHover", "more");