You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Priority WebSDK无法连接服务器:公有云服务URL正确性咨询

解决Priority Web SDK连接公有云服务的问题

公有云服务URL正确性说明

https://p.priority-connect.online/wcf/service.svc不是当前Priority公有云服务的有效地址。旧的WCF端点(/wcf/service.svc)已被废弃,当前公有云标准API端点格式为:
https://<region>.priority-connect.online/api
其中<region>需替换为你的租户所在区域代码,比如il(以色列)、eu(欧洲)、us(美国)等,具体区域代码可联系Priority管理员确认。

代码修正方案

  1. 更新服务URL:替换为符合当前标准的API地址,例如欧洲区域租户使用https://eu.priority-connect.online/api。
  2. 移除冗余的window模拟:Priority Web SDK在Node.js环境下无需手动模拟window对象,该代码可能引发异常。
  3. 匹配实际租户参数:demo仅为官方演示环境的公司代码,若使用自有公有云租户,需替换为实际的公司代码;同时确保tabulaini参数与租户配置一致。

修正后的示例代码:

const priority = require('priority-web-sdk');

const configuration = {
    username: '你的用户名',
    password: '你的密码',
    url: 'https://<你的区域代码>.priority-connect.online/api',
    tabulaini: 'tabula.ini',
    language: 3,
    company: '你的公司代码'
};

priority.login(configuration)
  .then(() => priority.formStart('CUSTOMERS', null, null, configuration.company, 1))
  .then(form => form.getRows(1))
  .then(rows => console.log('客户数据:', rows))
  .catch(err => {
      console.error('错误:', err);
      if (err.response) {
          console.error('响应详情:', err.response.data);
      } else if (err.request) {
          console.error('请求详情:', err.request);
      } else {
          console.error('错误描述:', err.message);
      }
  });

额外排查要点

  • 确认区域代码:登录Priority Web界面,地址栏中的前缀即为区域代码;或联系管理员获取。
  • 检查网络连通性:确保运行环境可访问目标API端点,无防火墙、代理拦截。
  • 验证账号权限:确认所用账号具备API访问权限,且能正常访问CUSTOMERS表单。

内容的提问来源于stack exchange,提问作者Leon Shmueli

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 02:18:22