伙伴匹配系统 bug
bug 解决
前后端分离跨域问题
1 |
或者添加配置类
1 | import org.springframework.context.annotation.Configuration; |
跨域请求不支持 cookie 操作
1.添加依赖
1 | <dependency> |
添加配置类
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31package com.yupi.yupao.config;
import org.springframework.boot.autoconfigure.session.DefaultCookieSerializerCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.MapSessionRepository;
import org.springframework.session.SessionRepository;
import org.springframework.session.config.annotation.web.http.EnableSpringHttpSession;
import org.springframework.session.web.http.DefaultCookieSerializer;
import java.util.concurrent.ConcurrentHashMap;
public class SessionConfig {
public SessionRepository sessionRepository() {
return new MapSessionRepository(new ConcurrentHashMap<>());
}
DefaultCookieSerializerCustomizer cookieSerializerCustomizer() {
return new DefaultCookieSerializerCustomizer() {
public void customize(DefaultCookieSerializer cookieSerializer) {
cookieSerializer.setSameSite("None");
cookieSerializer.setUseSecureCookie(true); // 此项必须,否则set-cookie会被chrome浏览器阻拦
}
};
}
}
加入加密队伍时,密码没正确验证
修改 TeamServiceimpl 中 JoinTeam()
1 | String password = team.getPassword(); |
JSON.parse
==SyntaxError: JSON.parse: unexpected character at line 1 colimn 2 of the JSON==
JSON.parse 标准格式为单引号包裹双引号的格式 如 [“男”, “大一”], 而 ==[‘南宁’, ‘本地’]== 则会报错
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 墨枫个人博客!
评论