fix build error

This commit is contained in:
AceDataCloud committed 2023-01-02 00:27:01 +08:00
1 parent 866331343c
commit 89461c8b1a
7 files changed
+29 -456

No files matched your search

-50
View File
@@ -1,50 +0,0 @@
<template>
<div>
<el-form ref="ruleFormRef" status-icon label-width="120px" class="demo-ruleForm">
<el-form-item label="Password">
<el-input v-model="form.content" autocomplete="off" />
</el-form-item>
<el-form-item>
<el-button @click="onCreate">Create</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { commentService } from '@/services/comment/service';
export default defineComponent({
name: 'CreateComment',
props: {
episodeId: {
type: Number,
required: true
}
},
data() {
return {
form: {
content: ''
}
};
},
computed: {
// active() {
// return this.$route.matched[0].path;
// },
// user() {
// return this.$store.getters.user;
// }
},
methods: {
onCreate() {
commentService.createForEpisode(this.episodeId, {
content: this.form.content
});
}
},
mounted() {}
});
</script>
+23 -20
View File
@@ -1,10 +1,11 @@
<template></template>
<template>
<div></div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { ElMessageBox } from 'element-plus';
import AuthService from '@/services/auth/service';
import { ITokenResponse } from '@/services/auth/types';
import { authOperator, ITokenResponse } from '@/operators';
export default defineComponent({
name: 'VerificationAlert',
@@ -16,6 +17,25 @@ export default defineComponent({
return this.$route.query.refresh;
}
},
async mounted() {
if (this.refresh) {
authOperator
.refreshToken({
refresh: this.$store.getters.refreshToken
})
.then(async ({ data: data }: { data: ITokenResponse }) => {
await this.$store.dispatch('setAccessToken', data.access);
await this.$store.dispatch('getMe');
this.$router.push({
...this.$route,
query: {}
});
this.checkAndShowVerificationAlert();
});
} else {
this.checkAndShowVerificationAlert();
}
},
methods: {
checkAndShowVerificationAlert() {
if (this.verified) {
@@ -37,23 +57,6 @@ export default defineComponent({
})
.catch(() => {});
}
},
async mounted() {
if (this.refresh) {
AuthService.refreshToken({
refresh: this.$store.getters.refreshToken
}).then(async ({ data: data }: { data: ITokenResponse }) => {
await this.$store.dispatch('setAccessToken', data.access);
await this.$store.dispatch('getMe');
this.$router.push({
...this.$route,
query: {}
});
this.checkAndShowVerificationAlert();
});
} else {
this.checkAndShowVerificationAlert();
}
}
});
</script>
-111
View File
@@ -1,111 +0,0 @@
<template>
<div class="card">
<div
class="left"
@click="
$router.push({
name: 'course-detail',
params: {
id: $route.params.courseId
}
})
"
>
<img :src="course.thumbnail" class="thumbnail" />
</div>
<div class="right">
<h2
class="title"
@click="
$router.push({
name: 'course-detail',
params: {
id: $route.params.courseId
}
})
"
>
{{ course.title }}
</h2>
<div class="info">
<div class="duration">
<el-icon class="icon"> <clock /> </el-icon>
<span class="value">{{ course?.duration }}{{ $t('common.entity.minute') }}</span>
</div>
<div class="level">
<el-icon class="icon"> <magic-stick /> </el-icon>
<span class="value">{{ course?.level }}</span>
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { ICourse } from '@/services/course/types';
import { Clock, MagicStick, Collection, ArrowRight } from '@element-plus/icons-vue';
export default defineComponent({
name: 'CoursePreviewCard',
components: {
Clock,
MagicStick
},
props: {
course: {
type: Object as () => ICourse,
required: true
}
}
});
</script>
<style lang="scss" scoped>
.card {
width: 100%;
padding: 10px 30px;
height: 84px;
overflow: hidden;
.left {
width: 80px;
float: left;
.thumbnail {
text-align: center;
width: 64px;
height: 64px;
cursor: pointer;
}
}
.right {
padding: 10px 0;
color: white;
float: left;
width: calc(100% - 80px);
.title {
cursor: pointer;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.info {
color: rgb(120, 144, 156);
margin-top: 5px;
.duration,
.level {
font-size: 12px;
display: inline-block;
margin-right: 5px;
.icon {
position: relative;
top: 1px;
}
.value {
display: inline-block;
margin-left: 5px;
}
}
}
}
}
</style>
-51
View File
@@ -1,51 +0,0 @@
<template>
<div class="document">
<div class="content">
<pdf v-if="resourceUrl" :source="resourceUrl"></pdf>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import Pdf from 'vue-pdf-embed';
interface IData {
options: {};
}
export default defineComponent({
name: 'EpisodeDocument',
components: {
Pdf
},
props: {
resourceUrl: {
type: String,
required: true
}
},
data(): IData {
return {
options: {}
};
},
async unmounted() {},
mounted() {}
});
</script>
<style lang="scss" scoped>
.document {
overflow: hidden;
border-radius: 15px;
width: calc(100% - 30px);
height: 80vh;
position: relative;
top: 15px;
left: 15px;
.content {
overflow: scroll;
}
}
</style>
-80
View File
@@ -1,80 +0,0 @@
<template>
<div class="player">
<vue-plyr ref="plyr" :options="options">
<video ref="video" controls playsinline :data-poster="preview"></video>
</vue-plyr>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import VuePlyr from 'vue-plyr';
import 'vue-plyr/dist/vue-plyr.css';
// @ts-ignore
import TcAdapter from 'tcadapter';
interface IData {
options: {};
player?: typeof VuePlyr;
}
export default defineComponent({
components: {
VuePlyr
},
props: {
fileId: {
type: String,
required: true
},
sign: {
type: String,
required: true
},
preview: {
type: String,
default: undefined
}
},
data(): IData {
return {
player: undefined,
options: {}
};
},
async unmounted() {
this.player?.stop();
},
mounted() {
if (!TcAdapter.isSupported()) {
throw new Error('current environment can not support TcAdapter');
}
const adapter = new TcAdapter(
this.$refs.video,
{
appID: '1500015562',
fileID: this.fileId,
psign: this.sign,
hlsConfig: {}
},
() => {
console.log('basicInfo', adapter.getVideoBasicInfo());
}
);
this.player = (this.$refs.plyr as typeof VuePlyr).player;
}
});
</script>
<style lang="scss">
.player {
width: calc(100% - 30px);
position: relative;
top: 15px;
left: 15px;
border-radius: 15px;
overflow: hidden;
}
</style>
-138
View File
@@ -1,138 +0,0 @@
<template>
<div class="wrapper">
<el-row
v-for="(episode, episodeIndex) in episodes"
:key="episodeIndex"
:class="{ item: true, active: episode.id === active }"
@click="onClick(episode)"
>
<el-col :span="5" class="left">
<span v-if="paid || episode.isFree" class="index">
{{ episodeIndex + 1 }}
</span>
<span v-else class="lock">
<el-icon class="icon"> <lock /> </el-icon>
</span>
</el-col>
<el-col :span="19" class="right">
<p class="title">
{{ episode?.title }}
</p>
<p class="info">
<span class="duration">
<el-icon class="icon">
<clock />
</el-icon>
{{ episode.duration }}
{{ $t('common.entity.minute') }}
</span>
</p>
</el-col>
</el-row>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { IEpisode } from '@/services/episode/types';
import { Clock, Lock } from '@element-plus/icons-vue';
export default defineComponent({
name: 'EpisodeSideList',
components: {
Clock,
Lock
},
props: {
episodes: {
type: Array as () => IEpisode[],
default() {
return [];
}
},
active: {
type: Number,
required: true
},
paid: {
type: Boolean,
default: false
}
},
emits: ['choose'],
mounted() {},
methods: {
onClick(episode: IEpisode) {
this.$emit('choose', episode);
}
}
});
</script>
<style lang="scss">
.wrapper {
padding: 0 10px;
.item {
cursor: pointer;
border-radius: 0.934rem;
width: 100%;
height: 60px;
padding-top: 10px;
color: white;
margin: 10px 0;
border: 1px solid #0d131d;
&.active,
&:hover {
background-color: rgba(50, 138, 241, 0.05);
border: 1px solid rgba(50, 138, 241, 0.25);
}
.left {
width: 60px;
color: inherit;
flex: inherit;
.index {
display: block;
width: 30px;
height: 30px;
text-align: center;
margin: auto;
border-radius: 50%;
font-size: 0.6em;
margin-top: 5px;
line-height: 30px;
background-image: linear-gradient(rgb(244, 72, 129), rgb(236, 69, 79));
}
.lock {
display: block;
width: 30px;
height: 30px;
text-align: center;
margin: auto;
border-radius: 50%;
font-size: 0.6em;
margin-top: 5px;
line-height: 30px;
background-image: linear-gradient(rgb(244, 72, 129), rgb(236, 69, 79));
}
}
.right {
width: calc(100% - 60px);
.title {
color: white;
font-size: 0.8em;
text-align: left;
}
.info {
.duration {
font-size: 0.6em;
.icon {
display: inline-block;
position: relative;
top: -1px;
}
}
}
}
}
}
</style>