政企WPS
This commit is contained in:
@ -157,16 +157,17 @@ public class WpsController {
|
||||
|
||||
if (cookie.isPresent()) {
|
||||
log.info(String.valueOf(request.getRequestURL()));
|
||||
String host = request.getHeader("Host");
|
||||
String host2 = request.getRemoteHost();
|
||||
String host3 = request.getHeader("Referer");
|
||||
log.info("getWpsUrlBy1:"+host);
|
||||
log.info("getWpsUrlBy2:"+host2);
|
||||
log.info("getWpsUrlBy3:"+host3);
|
||||
String referer = request.getHeader("Referer");
|
||||
String r1 = referer.substring(0,referer.indexOf("//")+2);
|
||||
String r11 = referer.substring(r1.length(),referer.length());
|
||||
String r2 = r11.substring(0,r11.indexOf("/")>=0?r11.indexOf("/"):r11.length());
|
||||
String host = r1+r2;
|
||||
log.info("getWpsUrlBy host:"+host);
|
||||
|
||||
String authToken = cookie.get().getValue();
|
||||
WpsClientInVo in = this.wpsService.getKSWpsUrlDecrypt(key,fileName);
|
||||
in.setUserToken(authToken);
|
||||
in.setHost(host);
|
||||
String str = this.wpsService.getKSWpsUrl(in);
|
||||
try {
|
||||
response.setContentType("text/html;charset=utf-8");
|
||||
|
@ -585,7 +585,7 @@ public class WpsServiceImpl implements WpsService {
|
||||
|
||||
//HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
||||
|
||||
vo.setHost(kswhost);
|
||||
vo.setHost(in.getHost());
|
||||
vo.setLastModifiedTime(time);
|
||||
|
||||
dataJson = JSON.toJSONString(vo);
|
||||
@ -595,7 +595,7 @@ public class WpsServiceImpl implements WpsService {
|
||||
|
||||
KingSoftWpsPreviewVo vo = new KingSoftWpsPreviewVo();
|
||||
vo.setSrcId(7);
|
||||
vo.setSrcWpsNgProxy(kswhost);
|
||||
vo.setSrcWpsNgProxy(in.getHost());
|
||||
vo.setStaffCode("ebtp");
|
||||
vo.setFileKey(in.getFileId());
|
||||
vo.setFileName(in.getFileName());
|
||||
@ -789,9 +789,9 @@ public class WpsServiceImpl implements WpsService {
|
||||
//String jm = RSA.encrypt("1538803364727304192_20231219095538_0_doc_客户端测试子项目1-XY926020101-服务费通知书-杭州安恒信息技术股份有限公司",wpsService.kswpublicKey);
|
||||
|
||||
//System.out.println(jm);
|
||||
String jm = "FmwOetVUoBs0M9rjHUpWhkSu3HWI+fujD5fh+Gwv/XQo3h5JpMghBMHdLpcgVtRYSxfvOROWyi4sUiooEm8yNU5GYmxR7LE/wvecp4fFMXeEtOgHnX4dNzITBorcqWjqS286a7LGCKAmC33CO7gP/lQewPPHiu9qzueWESLGsxM=";
|
||||
String jem = RSA.decrypt(jm,wpsService.kswprivateKey);
|
||||
System.out.println(jem);
|
||||
// String jm = "FmwOetVUoBs0M9rjHUpWhkSu3HWI+fujD5fh+Gwv/XQo3h5JpMghBMHdLpcgVtRYSxfvOROWyi4sUiooEm8yNU5GYmxR7LE/wvecp4fFMXeEtOgHnX4dNzITBorcqWjqS286a7LGCKAmC33CO7gP/lQewPPHiu9qzueWESLGsxM=";
|
||||
// String jem = RSA.decrypt(jm,wpsService.kswprivateKey);
|
||||
// System.out.println(jem);
|
||||
|
||||
//String key = wpsService.getDownloadEncrypt("1679764839191080961","3a1f5aae-3cd2-4599-87b0-712e40625c7c");
|
||||
//加解密
|
||||
@ -825,13 +825,20 @@ public class WpsServiceImpl implements WpsService {
|
||||
// vo.setSrcId(1);
|
||||
// vo.setModifier("2222");
|
||||
// System.out.println(JSON.toJSONString(vo));
|
||||
|
||||
String referer = "http://10.242.31.158:18022";//ProjectLayout/Calibration/ProjectManager/ResultNotice?roomType=2
|
||||
String r1 = referer.substring(0,referer.indexOf("//")+2);
|
||||
String r11 = referer.substring(r1.length(),referer.length());
|
||||
System.out.println(r11);
|
||||
String r2 = r11.substring(0,r11.indexOf("/")>=0?r11.indexOf("/"):r11.length());
|
||||
System.out.println(r2);
|
||||
String host = r1+r2;
|
||||
System.out.println(host);
|
||||
|
||||
//System.out.println(URLEncoder.encode("hVLFkQhQkXI8w4RFE25zvCP9TKRZwT8Dqhxmi/PgDalGayE5SIjtyFBRpu6wuEqr7HvAIHm2Kc8+ahIUF7l8sc1PHYeCuEmgYEwzeosl1pT1yDyQ+KV6Q8REiufarAbZ1W9LEx70SBrtTXPKnEPi82njSv+CVrYqZCf6XZ/BINU=","utf-8"));
|
||||
URL crt = test.class.getClassLoader().getResource("text.doc");
|
||||
File file = new File(crt.getPath());
|
||||
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
|
||||
byte[] result = IOUtils.toByteArray(bis);
|
||||
System.out.println(result.length);
|
||||
// URL crt = test.class.getClassLoader().getResource("text.doc");
|
||||
// File file = new File(crt.getPath());
|
||||
// BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
|
||||
// byte[] result = IOUtils.toByteArray(bis);
|
||||
// System.out.println(result.length);
|
||||
}
|
||||
}
|
||||
|
@ -35,4 +35,8 @@ public class WpsClientInVo {
|
||||
* 文件后缀 初次编辑需要传 doc docx xls ...
|
||||
*/
|
||||
private String fileExtension;
|
||||
/**
|
||||
* 前端 host
|
||||
*/
|
||||
private String host;
|
||||
}
|
||||
|
Reference in New Issue
Block a user