|
@@ -245,6 +245,12 @@
|
|
|
>
|
|
>
|
|
|
<i class="el-icon-service"></i> 查看小程序链接
|
|
<i class="el-icon-service"></i> 查看小程序链接
|
|
|
</el-dropdown-item>
|
|
</el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
|
+ @click.native="handleCreateAppLink(scope.row)"
|
|
|
|
|
+ v-hasPermi="['live:live:createAppLink']"
|
|
|
|
|
+ >
|
|
|
|
|
+ <i class="el-icon-link"></i> 复制通用链接
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
<el-dropdown-item
|
|
<el-dropdown-item
|
|
|
v-if="scope.row.liveCodeUrl == null"
|
|
v-if="scope.row.liveCodeUrl == null"
|
|
|
@click.native="handleGenerateCode(scope.row)"
|
|
@click.native="handleGenerateCode(scope.row)"
|
|
@@ -410,6 +416,7 @@
|
|
|
<el-button type="primary" @click="rtmpUrlVisible = false">确 定</el-button>
|
|
<el-button type="primary" @click="rtmpUrlVisible = false">确 定</el-button>
|
|
|
</span>
|
|
</span>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -425,7 +432,7 @@ import {
|
|
|
handleShelfOrUn,
|
|
handleShelfOrUn,
|
|
|
handleDeleteSelected,
|
|
handleDeleteSelected,
|
|
|
finishLive,
|
|
finishLive,
|
|
|
- startLive, copyLive,generateCode
|
|
|
|
|
|
|
+ startLive, copyLive, generateCode, createAppLink
|
|
|
} from "@/api/live/live";
|
|
} from "@/api/live/live";
|
|
|
import Editor from '@/components/Editor/wang';
|
|
import Editor from '@/components/Editor/wang';
|
|
|
import user from '@/store/modules/user';
|
|
import user from '@/store/modules/user';
|
|
@@ -575,6 +582,52 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
+ handleCreateAppLink(row) {
|
|
|
|
|
+ if (!row.liveId) {
|
|
|
|
|
+ this.$message.error('获取直播间id失败');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ createAppLink({ liveId: row.liveId }).then(response => {
|
|
|
|
|
+ if (response.code === 200 && response.realLink) {
|
|
|
|
|
+ this.copyLink(response.realLink);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(response.msg || '生成通用链接失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ copyLink(link) {
|
|
|
|
|
+ if (navigator.clipboard && window.isSecureContext) {
|
|
|
|
|
+ navigator.clipboard.writeText(link).then(() => {
|
|
|
|
|
+ this.$message.success('通用链接已复制到剪贴板');
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message.error('复制失败,请手动复制');
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const input = document.createElement('input');
|
|
|
|
|
+ input.style.position = 'fixed';
|
|
|
|
|
+ input.style.top = '-10000px';
|
|
|
|
|
+ input.style.zIndex = '-999';
|
|
|
|
|
+ document.body.appendChild(input);
|
|
|
|
|
+ input.value = link;
|
|
|
|
|
+ input.focus();
|
|
|
|
|
+ input.select();
|
|
|
|
|
+ try {
|
|
|
|
|
+ const result = document.execCommand('copy');
|
|
|
|
|
+ document.body.removeChild(input);
|
|
|
|
|
+ if (!result || result === 'unsuccessful') {
|
|
|
|
|
+ this.$message.error('复制失败,请手动复制');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.success('通用链接已复制到剪贴板');
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ document.body.removeChild(input);
|
|
|
|
|
+ this.$message.error('当前浏览器不支持复制功能,请手动复制');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
handleLink(row){
|
|
handleLink(row){
|
|
|
if (!row.liveId) {
|
|
if (!row.liveId) {
|
|
|
this.$message.error('获取直播间id失败');
|
|
this.$message.error('获取直播间id失败');
|