为什么这个简单的例子不再起作用了?

时间:2018-11-02 20:08:49

标签: autodesk-forge

从今天开始,该示例不起作用:

let app;

const options = {
    env: 'AutodeskProduction',
    accessToken: 'eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJjbGllbnRfaWQiOiJ1OXc4b2NYc3Y3dm96Rm9PQWVjakhGckZwRmN6cmZBbiIsImV4cCI6MTU0MTE5MTk2NSwic2NvcGUiOlsiZGF0YTpyZWFkIiwiZGF0YTp3cml0ZSIsImJ1Y2tldDpjcmVhdGUiLCJidWNrZXQ6cmVhZCIsImRhdGE6Y3JlYXRlIiwiYWNjb3VudDpyZWFkIiwiYWNjb3VudDp3cml0ZSJdLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiJTeDBQN3BINFluQ01mZnVOUnJYYTR0SHRXa3dka2VqZm9EMWxFNkdiODB2NEpmNVZvd2RLeGVPNXc2V3laSXpwIn0.R8hURNQ1XHaZF0tFmf8e58lDeWUp6s_fw4Ry3Q3rT6k'
};
const urn = 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z2FsYV9idWNrZXQvZHdnMS5kd2c=';

Autodesk.Viewing.Initializer(options, () => {
    app = new Autodesk.Viewing.ViewingApplication('viewer');
    app.registerViewer(app.k3D, Autodesk.Viewing.Private.GuiViewer3D);

    function onDocumentLoadSuccess() {
    const viewables = app.bubble.search({ 'type': 'geometry' });
    app.selectItem(viewables[0].data);
  }
  function onDocumentLoadFailure() {}
  app.loadDocument('urn:' + urn, onDocumentLoadSuccess, onDocumentLoadFailure);
});

过去几天一直在工作,但现在却出现404错误(未找到)。请问为什么它不起作用?

1 个答案:

答案 0 :(得分:0)

在我这边尝试过相同的代码,其功能如下图所示,请您确保您的令牌有效并再次检查吗?谢谢。 enter image description here