运行demo时出错

Viewed 294

我配置了单阶段提交模式,然后在运行给的demo时出错,提示InvalidArguement:

errno: 10000
msg: ""
reason: "InvalidArgument"
responseHeaders: "access-control-allow-credentials: true\r\naccess-control-allow-headers: accept, content-type, x-user-query, x-device-id, x-requested-with, x-csrftoken, accept-encoding, accept-language, x-csrf-rand, x-server-id, x-endpoint-id, x-app-id, EagleEye-TraceID, EagleEye-SessionID, EagleEye-pAppName, x-user-token, x-app-id, x-app-token\r\naccess-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS\r\naccess-control-allow-origin: https://o.wpsgo.com\r\naccess-control-expose-headers: accept, content-type, x-user-query, x-device-id, x-requested-with, x-csrftoken, accept-encoding, accept-language, x-csrf-rand, x-server-id, x-endpoint-id, x-app-id, EagleEye-TraceID, EagleEye-SessionID, EagleEye-pAppName, x-user-token, x-app-id, x-app-token\r\ncontent-length: 63\r\ncontent-type: text/plain; charset=utf-8\r\ndate: Wed, 22 Mar 2023 13:15:25 GMT\r\nserver: elb\r\nx-klb: 2\r\nx-region: wq\r\nx-request-id: 6c9240c25426480f725bc57c83f77989\r\n"
result: "InvalidArgument"
subReason: ""
_url: "/api/v3/office/session/1/word?first"

image.png

当我关闭单阶段提交模式后在运行又会显示新的报错

errno: 10000
msg: "返回权限值update=1,需实现回调接口:文档保存相关"
reason: "ProviderError"
responseHeaders: "access-control-allow-credentials: true\r\naccess-control-allow-headers: accept, content-type, x-user-query, x-device-id, x-requested-with, x-csrftoken, accept-encoding, accept-language, x-csrf-rand, x-server-id, x-endpoint-id, x-app-id, EagleEye-TraceID, EagleEye-SessionID, EagleEye-pAppName, x-user-token, x-app-id, x-app-token\r\naccess-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS\r\naccess-control-allow-origin: https://o.wpsgo.com\r\naccess-control-expose-headers: accept, content-type, x-user-query, x-device-id, x-requested-with, x-csrftoken, accept-encoding, accept-language, x-csrf-rand, x-server-id, x-endpoint-id, x-app-id, EagleEye-TraceID, EagleEye-SessionID, EagleEye-pAppName, x-user-token, x-app-id, x-app-token\r\ncontent-length: 125\r\ncontent-type: application/json; charset=utf-8\r\ndate: Wed, 22 Mar 2023 13:16:41 GMT\r\nserver: elb\r\nx-klb: 2\r\nx-region: wq\r\nx-request-id: 46ef9bcdc18544b27f0336d3b51f172e\r\n"
result: "ProviderError"
_url: "/api/v3/office/file/1/open/word"

image.png

前端使用的是 quickstart 给的代码,后端运行的是 gitee 上给的 weboffice-provider-demo-java 项目,已经部署到服务器上,在回调配置页面进行测试的时候也可以正常收到200

可以看看是哪里出问题了吗

1 Answers

您好。您贴的第一个问题,跟您是否使用一阶段保存没有关系。有点怀疑是您的 file id 为 1 的文件,可能不是一个文字文档。

后边一个错误的意思是,因为 demo 返回的用户权限中,有保存的权限 update = 1 但是由于您关闭了单阶段报错的接口,同时没有打开三阶段保存的接口,所以会报错。

是的,看了一下id为1的确实不是word文档,我检查了一下日志,id为2的文档是个word文档,改成2后似乎还是不可以,仍然是同样的报错

第一个报错最后面那个first是什么意思呀

能贴一下您打开文件时的完整路径吗?我们看一下。