Add hotlink viewer page at /h/:id/:secret.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<main class="flex min-h-screen items-center justify-center p-4">
|
||||
<img v-if="imageSrc" :src="imageSrc" class="max-h-[80vh] max-w-full object-contain" />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { buildHotlinkImagePath } from '@/utils/share/buildHotlinkImagePath';
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const imageSrc = computed((): string | null => {
|
||||
const uploadId = route.params.id;
|
||||
const secret = route.params.secret;
|
||||
|
||||
if (typeof uploadId !== 'string' || typeof secret !== 'string' || !uploadId || !secret) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return buildHotlinkImagePath(uploadId, secret);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user