fix: 文件二维码在前端拼接结果好像错误

This commit is contained in:
lan
2024-04-29 22:37:10 +08:00
parent af919332f4
commit 72898dd929
17 changed files with 20 additions and 19 deletions
+3 -2
View File
@@ -60,8 +60,9 @@ md.use(markdownItKatex, { blockClass: 'katexmath-block rounded-md p-[10px]', err
function renderMarkdown(message: string) {
return md.render(message);
}
function getQrCodeUrl(code:string) {
return window.location.origin + '/#/?code=' + code;
return code.startsWith('http') ? code : window.location.origin + code;
}
</script>
@@ -96,7 +97,7 @@ function getQrCodeUrl(code:string) {
</template>
<div style="width: 200px;">
<div style="display: flex;justify-content: space-between">
<qrcode-vue v-if="value.name!=='文本分享'" :value="value.text" :size="100"></qrcode-vue>
<qrcode-vue v-if="value.name!=='文本分享'" :value="getQrCodeUrl(value.text)" :size="100"></qrcode-vue>
<div v-else style="width: 100px;height: 100px;flex-wrap: wrap;overflow-y:scroll ">{{value.text}}</div>
<div style="display: flex;flex-direction: column;justify-content: space-around">
<el-tag size="large" style="cursor: pointer" @click="copyText(value.code)">{{ value.code }}</el-tag>