前端调用init()初始化未成功

Viewed 513

WebOffice文档在前端网页并未加载出来, iframe 元素未出现。看了一下没有调用https://o.wpsgo.com/office/w/71eba35aad4a42be81780f2b6e5e0b4b?_w_appid=....&_w_tokentype=1

前端初始化代码:

const initWps = usePersistFn(async () => {
        const { appId, officeType, model } = await getFileUrl()
        const Authorization = Framework.CurrentUser.get().TokenHeader.Authorization;
        const arr = Authorization.split(/[ ]+/);
        const token = arr[1];
        wps.current = WPS.init({
          mode: props.isReadOnly ? 'simple' : undefined,
          mount: document.querySelector('#container'),
          fileId: props.fileId,
          appId,
          token,
          officeType,
          customArgs: model === 'read' ? { readonly: true } : undefined
      }) as IWps;
    })
3 Answers

您好,您可以先在控制台的回调配置检查上校验确认回调接口正确~