feat: 测试接入wps
parent
aeed25f331
commit
fff0fe3698
|
|
@ -1,6 +1,9 @@
|
||||||
package org.qinan.safetyeval.adapter.web;
|
package org.qinan.safetyeval.adapter.web;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||||
|
import com.jjb.saas.framework.utils.JwtTokenUtils;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -36,7 +39,27 @@ public class H5OpenController {
|
||||||
|
|
||||||
@ApiOperation("wps回调预览")
|
@ApiOperation("wps回调预览")
|
||||||
@GetMapping(value = "/v3/3rd/files/{file_id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
@GetMapping(value = "/v3/3rd/files/{file_id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public String getWpsInfoByFileId(@PathVariable("file_id") String file_id) {
|
public String getWpsInfoByFileId(@PathVariable("file_id") String file_id, HttpServletRequest request) {
|
||||||
|
log.info("token, {}", request.getHeader("token"));
|
||||||
|
log.info("Token, {}", request.getHeader("Token"));
|
||||||
|
String header = request.getHeader("X-Weboffice-Token");
|
||||||
|
log.info("X-Weboffice-Token, {}", request.getHeader("X-Weboffice-Token"));
|
||||||
|
|
||||||
|
String token = header;
|
||||||
|
log.info("2.5token不为空:{}", token);
|
||||||
|
token = token.replaceAll("jjb-saas-auth:oauth:", "").trim();
|
||||||
|
String json = null;
|
||||||
|
SSOUser ssoUser;
|
||||||
|
try {
|
||||||
|
json = JwtTokenUtils.parseToken(token);
|
||||||
|
} catch (Exception var41) {
|
||||||
|
}
|
||||||
|
if (null != json) {
|
||||||
|
ssoUser = (SSOUser) JSONUtil.toBean(json, SSOUser.class);
|
||||||
|
} else {
|
||||||
|
ssoUser = new SSOUser();
|
||||||
|
}
|
||||||
|
log.info("ssoUser:{}", ssoUser);
|
||||||
log.info("wps回调预览:{}", file_id);
|
log.info("wps回调预览:{}", file_id);
|
||||||
return accountMapper.getWps(1);
|
return accountMapper.getWps(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue