Files
ecom-dmb/ecom-dmb-frontend/apps/web-antd/src/views/init/components/FingerprintDisplay.vue
T
2026-07-06 19:34:53 +08:00

57 lines
1.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { ref } from 'vue';
import { createIconifyIcon } from '@vben/icons';
import { Button, Input, message, Space, Typography } from 'ant-design-vue';
defineOptions({ name: 'FingerprintDisplay' });
const props = defineProps<{
fingerprint: string;
hostname?: string;
machineId?: string;
}>();
const CopyIcon = createIconifyIcon('lucide:copy');
const copying = ref(false);
async function copyFingerprint() {
if (!props.fingerprint) return;
copying.value = true;
try {
await navigator.clipboard.writeText(props.fingerprint);
message.success('机器指纹已复制');
} catch {
message.error('复制失败,请手动选择复制');
} finally {
copying.value = false;
}
}
</script>
<template>
<div class="rounded-lg border border-dashed border-primary/30 bg-primary/5 p-4">
<Typography.Text type="secondary" class="mb-2 block text-sm">
请将以下机器指纹发送给运营方签发 License
</Typography.Text>
<Input :value="fingerprint" readonly class="font-mono text-xs" />
<Space class="mt-3" wrap>
<Button
type="primary"
ghost
size="small"
:loading="copying"
@click="copyFingerprint"
>
<CopyIcon class="mr-1 size-4" />
复制指纹
</Button>
<Typography.Text v-if="hostname" type="secondary" class="text-xs">
主机名:{{ hostname }}
</Typography.Text>
</Space>
</div>
</template>