fix 修复 跨域未设置请求头问题(cloud版本不需要 vue版本需要)
This commit is contained in:
parent
fe40d7db32
commit
4e62054bd1
@ -76,9 +76,14 @@ public class EncryptResponseBodyWrapper extends HttpServletResponseWrapper {
|
|||||||
String encryptPassword = EncryptUtils.encryptByRsa(encryptAes, publicKey);
|
String encryptPassword = EncryptUtils.encryptByRsa(encryptAes, publicKey);
|
||||||
|
|
||||||
// 设置响应头
|
// 设置响应头
|
||||||
|
// vue版本需要设置
|
||||||
|
servletResponse.addHeader("Access-Control-Expose-Headers", headerFlag);
|
||||||
|
servletResponse.setHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
servletResponse.setHeader("Access-Control-Allow-Methods", "*");
|
||||||
servletResponse.setHeader(headerFlag, encryptPassword);
|
servletResponse.setHeader(headerFlag, encryptPassword);
|
||||||
servletResponse.setCharacterEncoding(StandardCharsets.UTF_8.toString());
|
servletResponse.setCharacterEncoding(StandardCharsets.UTF_8.toString());
|
||||||
|
|
||||||
|
|
||||||
// 获取原始内容
|
// 获取原始内容
|
||||||
String originalBody = this.getContent();
|
String originalBody = this.getContent();
|
||||||
// 对内容进行加密
|
// 对内容进行加密
|
||||||
|
Loading…
x
Reference in New Issue
Block a user