完善登陆后设置当前project的逻辑

This commit is contained in:
高子兴 2024-07-14 22:34:56 +08:00
parent f3d94119a6
commit 154c723ce8

View File

@ -179,6 +179,12 @@ public class ProjectBean implements Serializable {
loadProjects(); loadProjects();
loadAllKeywords(); loadAllKeywords();
isLoggedIn = true; isLoggedIn = true;
if (projects.isEmpty()){
project = new Project("", "", "", new ArrayList<>(), "", new ArrayList<>(), "", "");
}
else{
setProject(projects.get(0));
}
return "index"; return "index";
} else { } else {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Login failed", null)); FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Login failed", null));