Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

搜索不出来,一搜索就显示下图 #285

Open
SakuraFate opened this issue Apr 16, 2024 · 2 comments
Open

搜索不出来,一搜索就显示下图 #285

SakuraFate opened this issue Apr 16, 2024 · 2 comments

Comments

@SakuraFate
Copy link

TNEEOU`MJJ3N@M_V@)V1Y

@nanshaws
Copy link
Collaborator

nanshaws commented May 6, 2024

截图_20240506112329
截图_20240506112352
可能是管理端没有添加到数据库

@ALk330
Copy link

ALk330 commented Sep 5, 2024

前端没判空导致的,SearchSong.vue中,result.data为null

if (!result.data.length) {
  currentSongList.value = [];
  (proxy as any).$message({
    message: "暂时没有相关歌曲",
    type: "warning",
  });
} else {
  currentSongList.value = result.data;
}

后端在没查到音乐时,返回的是return R.error("添加失败,没有找到该歌,无法加入该歌单");,导致data为null

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));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants