Skip to content

Commit

Permalink
修改了管理页和后端小部分代码
Browse files Browse the repository at this point in the history
修复了增加歌单里面的歌的时候,失败无法关闭弹窗的bug
  • Loading branch information
nanshaws committed Mar 14, 2024
1 parent 7e861d6 commit cbc5889
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 8 additions & 2 deletions music-manage/src/views/ListSongPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="saveSong">确 定</el-button>
<el-button type="primary" @click="saveSong()">确 定</el-button>
</span>
</template>
</el-dialog>
Expand Down Expand Up @@ -107,6 +107,9 @@ export default defineComponent({
if (result.success) {
addSong(result.data[0].id);
}else{
alert(result.message);
centerDialogVisible.value = false;
}
}
async function addSong(id) {
Expand All @@ -119,7 +122,10 @@ export default defineComponent({
type: result.type,
});
if (result.success) getData();
if (result.success) {
getData();
}
centerDialogVisible.value = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public R addSong(SongRequest addSongRequest, MultipartFile lrcfile,MultipartFile
} catch (IOException e) {
throw new RuntimeException(e);
}


}
if (songMapper.insert(song) > 0) {
return R.success("上传成功", storeUrlPath);
Expand Down Expand Up @@ -170,6 +168,11 @@ public R songOfId(Integer id) {
public R songOfSingerName(String name) {
QueryWrapper<Song> queryWrapper = new QueryWrapper<>();
queryWrapper.like("name",name);
List<Song> songs = songMapper.selectList(queryWrapper);
if (songs.isEmpty()){
return R.error("添加失败,没有找到该歌,无法加入该歌单");
}

return R.success(null, songMapper.selectList(queryWrapper));
}
}

0 comments on commit cbc5889

Please sign in to comment.