This commit is contained in:
parent
1c08d318ac
commit
75fbd894cc
|
|
@ -12,19 +12,19 @@ export function setupInterceptor(service) {
|
||||||
if (isWithoutToken(config)) {
|
if (isWithoutToken(config)) {
|
||||||
return config
|
return config
|
||||||
} else {
|
} else {
|
||||||
// const userInfo = await getUserInfo()
|
const userInfo = await getUserInfo()
|
||||||
// if (userInfo) {
|
if (userInfo) {
|
||||||
// const { token_type, access_token } = userInfo
|
const { token_type, access_token } = userInfo
|
||||||
// // config.headers.Authorization = `${token_type} ${access_token}`
|
config.headers.Authorization = `${token_type} ${access_token}`
|
||||||
// config.headers.Authorization = '5d45f171-18fd-4e5e-9aac-f0936ac62e01'
|
// config.headers.Authorization = '5d45f171-18fd-4e5e-9aac-f0936ac62e01'
|
||||||
config.headers.Authorization = '94e7d65e-1852-4fff-99de-dfe6bef52428'
|
// config.headers.Authorization = '94e7d65e-1852-4fff-99de-dfe6bef52428'
|
||||||
// const { VITE_CLIENT_ID } = import.meta.env
|
const { VITE_CLIENT_ID } = import.meta.env
|
||||||
// config.headers['Client-Id'] = VITE_CLIENT_ID
|
config.headers['Client-Id'] = VITE_CLIENT_ID
|
||||||
return config
|
return config
|
||||||
// } else {
|
} else {
|
||||||
// signoutRedirect()
|
signoutRedirect()
|
||||||
// return Promise.reject({ response: { status: 401, message: '未登录' }})
|
return Promise.reject({ response: { status: 401, message: '未登录' }})
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(error) => Promise.reject(error)
|
(error) => Promise.reject(error)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
<template>
|
||||||
|
<n-drawer v-bind="getDrawerOptions" @update:show="updateVisible">
|
||||||
|
<n-drawer-content closable title="直播">
|
||||||
|
<div class="video-container">
|
||||||
|
<div class="video-item">
|
||||||
|
<VideoPlayer ref="videoRef" :options="getVideoOptions" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="detail-btns">
|
||||||
|
<n-button
|
||||||
|
type="error"
|
||||||
|
@click="updateVisible(false)"
|
||||||
|
>关闭</n-button>
|
||||||
|
</div>
|
||||||
|
</n-drawer-content>
|
||||||
|
</n-drawer>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import VideoPlayer from '@/components/VideoPlayer/index.vue'
|
||||||
|
import { reactive, computed, toRefs, watch, ref } from 'vue'
|
||||||
|
export default {
|
||||||
|
name: 'TaskLive',
|
||||||
|
components: { VideoPlayer },
|
||||||
|
props: {
|
||||||
|
/* 可见 */
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
/* 选中的数据 */
|
||||||
|
data: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
emits: {
|
||||||
|
'update:visible': null
|
||||||
|
},
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const data = reactive({
|
||||||
|
aipull_url: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
/* 获取抽屉的信息 */
|
||||||
|
const getDrawerOptions = computed(() => {
|
||||||
|
return {
|
||||||
|
show: props.visible,
|
||||||
|
width: '100%',
|
||||||
|
placement: 'right'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const videoRef = ref(null)
|
||||||
|
const getVideoOptions = computed(() => {
|
||||||
|
return {
|
||||||
|
id: 'video_ai',
|
||||||
|
width: '100%',
|
||||||
|
height: '600px',
|
||||||
|
source: props.data.aipullUrl,
|
||||||
|
isLive: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(() => props.visible, (value) => {
|
||||||
|
if (!value) {
|
||||||
|
videoRef.value.disposeVideo()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const updateVisible = function() {
|
||||||
|
emit('update:visible', false)
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
getDrawerOptions,
|
||||||
|
...toRefs(data),
|
||||||
|
videoRef,
|
||||||
|
getVideoOptions,
|
||||||
|
updateVisible
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.video-container {
|
||||||
|
margin: 50px 0;
|
||||||
|
height: 65vh;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.video-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.detail-btns {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
margin-top: 50px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<data-table
|
<data-table
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableData"
|
:request="loadDataTable"
|
||||||
:row-key="(row) => row.id"
|
:row-key="(row) => row.id"
|
||||||
:scroll-x="2200"
|
:scroll-x="2200"
|
||||||
size="large"
|
size="large"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue