织梦网站后台如何做百度优化,南通网站推广,相应式手机网站建设,自己做的网站怎么删除一、说明 文档在这里#xff1a;https://api.onlyoffice.com/docs/docs-api/additional-api/command-service/ 命令服务提供有几个简单的接口封装。也提供了前端和后端同时操作文档的可能。 二、正文 命令服务地址#xff1a;https://documentserver/coauthoring/Com…一、说明 文档在这里https://api.onlyoffice.com/docs/docs-api/additional-api/command-service/ 命令服务提供有几个简单的接口封装。也提供了前端和后端同时操作文档的可能。 二、正文 命令服务地址https://documentserver/coauthoring/CommandService.ashx 其中https://documentserver是你自己部署的onlyoffice地址比如我的服务是http://47.94.91.67:10100按照上面的拼写最终得到结果
http://47.94.91.67:10100/coauthoring/CommandService.ashx 参数采用post-json传递。 三、示例
这里举一个forcesave例子 1、比如Command service - forcesave 强制保存这个服务可以在前端打开文档的同时通过后端直接触发保存操作并且双向不影响 2、此时前端文档的key为config.document.key aaa 3、并且此时前端同时应该设置autosave为config.editorConfig.customization.autosave true 4、使用post-json方式调用命令服务地址为http://47.94.91.67:10100/coauthoring/CommandService.ashx参数为 { c: forcesave, key: aaa, userdata: sample userdata } 5、请检查【4】中的【key】与【2】中的【key】必须一致 四、常见问题错误提示
0No errors.1Document key is missing or no document with such key could be found.2Callback url not correct.3Internal server error.4No changes were applied to the document before the forcesave command was received.5Command not correct.6Invalid token.
这里重点讲一下 error 1 的报错Document key is missing or no document with such key could be found. 在样例中使用到了参数传递key: aaa { c: forcesave, key: aaa, userdata: sample userdata } 这里的key必须是已经在onlyoffice服务中打开/存储过的key也就是必须使用config.document.key aaa来打开过文档这个key到底是什么请再仔细阅读下配置文档说明。 如果服务没有打开/存储过该key就会报error1。 引申 only在docker部署下如果容器重新部署key会丢失。 实际业务如果采用动态key那么需要设计好规则或者关联保证前/后端的key相同。