Skip to content

Commit

Permalink
Feat: remove current movie
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyCreeper committed Nov 5, 2023
1 parent 12b5894 commit 962704c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/views/Cinema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,12 @@ const clearMovieList = async (id: number) => {
await reqClearMovieListApi({
headers: { Authorization: roomToken }
});
await changeCurrentMovie("", false);
ElNotification({
title: "已清空",
type: "success"
});
msgList.value.push("PLAYER:视频已清空");
} catch (err: any) {
console.error(err);
ElNotification({
Expand Down Expand Up @@ -413,7 +415,7 @@ const swapMovie = async () => {
// 设置当前正在播放的影片
const { execute: reqChangeCurrentMovieApi } = changeCurrentMovieApi();
const changeCurrentMovie = async (id: string) => {
const changeCurrentMovie = async (id: string, showMsg = true) => {
try {
await reqChangeCurrentMovieApi({
data: {
Expand All @@ -422,18 +424,20 @@ const changeCurrentMovie = async (id: string) => {
headers: { Authorization: roomToken }
});
ElNotification({
title: "设置成功",
type: "success"
});
showMsg &&
ElNotification({
title: "设置成功",
type: "success"
});
resetChatAreaHeight();
} catch (err: any) {
console.error(err);
ElNotification({
title: "设置失败",
message: err.response.data.error || err.message,
type: "error"
});
showMsg &&
ElNotification({
title: "设置失败",
message: err.response.data.error || err.message,
type: "error"
});
}
};
Expand Down

0 comments on commit 962704c

Please sign in to comment.