提交 04a109f3 编写于 作者: 7 7wc98#14

Commit

上级 dbca7604
......@@ -27,5 +27,6 @@ public class WebMVCConfig implements WebMvcConfigurer {
registry.addViewController("/aboutPhilosophy").setViewName("page/AboutPhilosophy");
registry.addViewController("/publicChatRoom").setViewName("PublicChatRoom");
registry.addViewController("/chat").setViewName("page/PrivateChat");
registry.addViewController("/signError").setViewName("page/SignError");
}
}
......@@ -40,6 +40,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/aboutMath").permitAll()
.antMatchers("/aboutPhilosophy").permitAll()
.antMatchers("/sign").permitAll()
.antMatchers("/sign?**").permitAll()
.antMatchers("/toCheckFrozen").permitAll()
.antMatchers("/static/**").permitAll()
.antMatchers("/static/**/**").permitAll()
......
......@@ -17,6 +17,7 @@ import org.springframework.security.core.context.SecurityContextImpl;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -339,7 +340,9 @@ public class WebController {
@RequestParam(value = "QQ", required = false) String qq) {
Student student = studentRepository.findPasswordByStudentID(studentID);
if (student != null) {
return "page/SignError";
Msg msg = new Msg("注册结果","错误,"+studentID+",已被注册,请联系管理员进行解决","额外信息");
model.addAttribute("msg",msg);
return "page/Sign";
}
Msg msg = new Msg("注册结果","恭喜"+studentID+",你成功注册,请使用刚刚注册的学号和密码进行登录","额外信息");
Student s = new Student(username, studentID, password, weChat, qq,0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册