Explorar o código

分享链接接口联调

zhangsq hai 8 meses
pai
achega
9094fdbc85

+ 6 - 4
src/views/resourceDetails/components/ShareDialog.vue

@@ -7,8 +7,9 @@
 			</div>
 
 			<div style="display: flex; align-items: center; width: 100%; justify-content: space-between">
-				<span>{{ thisUrl }}</span> <a-button type="primary" @click="copyLink()">复制链接</a-button>
+				<p>{{ thisUrl }}</p>
 			</div>
+			<a-button type="primary" @click="copyLink()">复制链接</a-button>
 		</div>
 	</a-modal>
 </template>
@@ -19,6 +20,7 @@
 	import EventBus from '@/utils/EventBus'
 	import { Modal, message, notification } from 'ant-design-vue'
 	import tool from '@/utils/tool'
+	import sysConfig from '@/config/index'
 	const emit = defineEmits(['selectTab'])
 
 	// id: 1,
@@ -61,11 +63,11 @@
 		visible.value = false
 		// listUnpublishedView.value.setData(tableData.value)
 	}
-	const open = (data) => {
-		console.log('要 打开分享弹窗')
+	const open = (shareLink) => {
+		console.log('要 打开分享弹窗', shareLink)
 		visible.value = true
 		// itemData.value = data
-		thisUrl.value = window.location.href
+		thisUrl.value = sysConfig.API_URL + shareLink
 	}
 	const copyLink = () => {
 		tool.writeText(thisUrl.value)

+ 1 - 1
src/views/resourceDetails/components/VideoDetails.vue

@@ -217,7 +217,7 @@
 		getShareLink({ id: route.query.id })
 			.then((res) => {
 				if (res.code == 200) {
-					ShareDialogRef.value.open()
+					ShareDialogRef.value.open(res.data.shareLink)
 				}
 			})
 			.catch((err) => {})