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

Commit

上级 32ae3ba5
...@@ -10,10 +10,10 @@ package com.pyc.campus.config; ...@@ -10,10 +10,10 @@ package com.pyc.campus.config;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration @Configuration
public class WebMVCConfig extends WebMvcConfigurerAdapter { public class WebMVCConfig implements WebMvcConfigurer {
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/"); registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
...@@ -21,8 +21,6 @@ public class WebMVCConfig extends WebMvcConfigurerAdapter { ...@@ -21,8 +21,6 @@ public class WebMVCConfig extends WebMvcConfigurerAdapter {
@Override @Override
public void addViewControllers(ViewControllerRegistry registry) { public void addViewControllers(ViewControllerRegistry registry) {
// registry.addViewController("/login").setViewName("page/Login");
// registry.addViewController("/home").setViewName("page/Home");
registry.addViewController("/aboutLearn").setViewName("page/AboutLearn"); registry.addViewController("/aboutLearn").setViewName("page/AboutLearn");
registry.addViewController("/aboutEnglish").setViewName("page/AboutEnglish"); registry.addViewController("/aboutEnglish").setViewName("page/AboutEnglish");
registry.addViewController("/aboutMath").setViewName("page/AboutMath"); registry.addViewController("/aboutMath").setViewName("page/AboutMath");
......
...@@ -32,7 +32,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -32,7 +32,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http.sessionManagement() http.sessionManagement()
.maximumSessions(1).maxSessionsPreventsLogin(true); .maximumSessions(1).expiredUrl("/login");
http.authorizeRequests() http.authorizeRequests()
.antMatchers("/campus").permitAll() .antMatchers("/campus").permitAll()
.antMatchers("/aboutLearn").permitAll() .antMatchers("/aboutLearn").permitAll()
......
...@@ -10,13 +10,13 @@ package com.pyc.campus.config; ...@@ -10,13 +10,13 @@ package com.pyc.campus.config;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry; import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
@Configuration @Configuration
@EnableWebSocketMessageBroker @EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer { public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override @Override
public void registerStompEndpoints(StompEndpointRegistry registry) { public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/endpointPublicChat").withSockJS(); registry.addEndpoint("/endpointPublicChat").withSockJS();
......
...@@ -10,7 +10,6 @@ package com.pyc.campus.controller; ...@@ -10,7 +10,6 @@ package com.pyc.campus.controller;
import com.pyc.campus.domain.PublishMessage; import com.pyc.campus.domain.PublishMessage;
import com.pyc.campus.domain.ResponseMessage; import com.pyc.campus.domain.ResponseMessage;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.messaging.handler.annotation.DestinationVariable; import org.springframework.messaging.handler.annotation.DestinationVariable;
import org.springframework.messaging.handler.annotation.MessageMapping; import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo; import org.springframework.messaging.handler.annotation.SendTo;
......
...@@ -361,7 +361,7 @@ public class WebController { ...@@ -361,7 +361,7 @@ public class WebController {
} }
//@RequestMapping("/") //@RequestMapping("/")
@RequestMapping("/campus") @RequestMapping("/campus")
public String oppo() { public String campus() {
return "page/Index"; return "page/Index";
} }
......
...@@ -9,7 +9,6 @@ package com.pyc.campus.service; ...@@ -9,7 +9,6 @@ package com.pyc.campus.service;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
...@@ -83,7 +83,6 @@ ...@@ -83,7 +83,6 @@
let str="<div class=\"right_d\"><div class=\"speech right\" ng-class=\"speech right\">"+message.body+"</div></div>"; let str="<div class=\"right_d\"><div class=\"speech right\" ng-class=\"speech right\">"+message.body+"</div></div>";
$('#output').append(str); $('#output').append(str);
console.log(str); console.log(str);
/*$('#output').append("</br><b>"+[[${toName}]]+":"+message.body+"</b></br>")*/
} }
function sendSpittle(text) { function sendSpittle(text) {
stomp.send("/chat/"+[[${toName}]],{},text); stomp.send("/chat/"+[[${toName}]],{},text);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册