当前位置: 首页 > news >正文

智能小e-集成配置

前言

  • 集成配置
  • 同步
  • 单点
  • 外联系统
  • 智能办公
  • 智能问答
  • 智能体

本文主要讲解,第三方如何集成智能小e,集成常见问题和解决方案;

1、泛微OA产品集成

  • e9集成,访问地址
  • e10集成,访问地址

2、第三方如何集成

2.1、集成地址

集成地址,分为两个部分:

  • 域名地址,如:https://cloud.qianliling.com/main
    • pc端: https://cloud.qianliling.com/main/app-chat
    • 移动端: https://cloud.qianliling.com/mobile-chat/#/index
    • 移动端隐藏语音
      https://cloud.qianliling.com/mobile-chat/#/index?disableVoice=true
    • pc端插件地址
      https://cloud.qianliling.com/main/app-chat/chat-em
    • 采知连地址
      https://cloud.qianliling.com/main/app-chat?czl=1
  • 参数clientSourceuserToken

下面是集成登录的示例:

  • pc端访问 https://cloud.qianliling.com/main/app-chat?clientSource=ecology&userToken=${userToken}
    在这里插入图片描述
  • pc端插件地址访问 https://cloud.qianliling.com/main/app-chat/chat-em?clientSource=ecology&userToken=${userToken}

在这里插入图片描述

  • 手机端访问 https://cloud.qianliling.com/mobile-chat/#/index?clientSource=ecology&userToken=${userToken}
    在这里插入图片描述

2.2、获取密钥

字段说明
appKey集成千里聆API调用信息,API秘钥中的SecretId,参考下图
secretKey集成千里聆API调用信息,API秘钥中的SecretIdKey,参考下图

在这里插入图片描述

2.3、如何生成签名sign

加密生成sign参数需要四个参数生成,分别是:appKeysecretKeyparamstimestamp

字段说明
appKey集成千里聆API调用信息,API秘钥中的SecretId
secretKey集成千里聆API调用信息,API秘钥中的SecretIdKey
params自选参数,json格式的对象,key-value都是字符串。 示例值: {“appKey”: “dsfs”}
timestamp当前时间戳(毫秒数)。示例值:1627983230687

说明
关于sign生成规则,生成方式:Md5(appKey + secretKey + params + timestamp).toUpperCase()
关于md5加密参数使用的是第三方jar包:commons-codec-1.13.jar,自己实现时,参考上述依赖包标准即可。

参数params说明
单点登录时,关于参数params不能为空,其中必填字段,如下

字段说明
appKey集成千里聆API调用信息,API秘钥中的SecretId,参考上图
clientSourceString, 登录客户端类型值为:e9, e10 , e-teams , e-office , qiyuesuo , 默认ecology
ecUserId用户id,这里是ecology人员id
ecUserName用户姓名
appSkip登录后直接跳转的页面地址

参考示例代码:

public class SingleParam {// 千里聆给客户分配的AK--例如:mD0XRABCprivate String appKey;// 千里聆给客户分配的SK--例如:sdfssafdsafdasfdasf32423423private String secretKey;// 登录客户端类型 登录客户端类型值为:`e9`, `e10` , `e-teams` , `e-office` , `qiyuesuo` , `ecology`默认private String clientSource;//  第三方人员唯一标识private String ecUserId;// 用户姓名private String ecUserName;// 单点登录后访问的页面地址private String appSkip;/*** 构造 加密参数 用于点单登录*/public Map<String, String> getParams(){Map<String, String> params = new HashMap<>();params.put("appKey", URLEncoder.encode(appKey, "utf-8"));params.put("clientSource", URLEncoder.encode(clientSource, "utf-8"));params.put("ecUserId", URLEncoder.encode(ecUserId, "utf-8"));params.put("ecUserName", URLEncoder.encode(ecUserName, "utf-8"));params.put("appSkip", URLEncoder.encode(appSkip, "utf-8"));return params;}
}

2.4、如何生成userToken

  • 接口地址(URI):https://cloud.qianliling.com/rpa/auth/app/user/generateUserToken
  • 接口请求类型:POST
  • 接口内容类型:Content-Type: application/json

接口参数
参数示例:

{"appKey": "fafa43234","sign": "fsd68fsaf823fsdfafas","timestamp": "16669000200","params": {"appKey": "wwrwer","clientSource": "ecology","ecUserId": "1234","ecUserName": "zhangsan","appSkip": ""}
}

参数说明

参数名称类型描述
appKeyString集成千里聆API调用信息,API秘钥中的SecretId,参考2.2、获取密钥
signString签名,按照appKey、secretKey、params、timestamp的顺序进行拼接生成的16进制大写的MD5字符串,参考2.3、如何生成签名sign
timestampString当前时间戳(毫秒数)。示例值:1627983230687
paramsObject自选参数,json格式的对象, 参考:SingleParam

接口返回结果

{"code": "0000","msg": "请求成功","data": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwZXJtaXNzaWc..."
}
返回字段类型描述
codeString0000-表示成功,否则失败
msgString失败信息
dataStringuserToken的值

参考示例代码:

说明
关于sign生成规则,需要使用params ,这里使用HashMap实现,无法保证顺序,所有json序列化时,为了保证一致,请使用gson


public class Demo {private String url = "https://cloud.qianliling.com/rpa/auth/app/user/generateUserToken";public String getToken() {String appKey = "";String secretKey = "";SingleParam singleParam = new SingleParam();// 注意这里使用HashMap,无法保证顺序,所有json序列化时,为了保证一致,请使用gsonMap<String, String> params = singleParam.getParams();long timestamp = System.currentTimeMillis();String str = appKey + secretKey + params + timestamp;String sign = DigestUtils.md5Hex(str.getBytes()).toUpperCase();Map<String, Object> body = new HashMap<>();body.put("appKey", appKey);body.put("params", params);body.put("timestamp", timestamp);body.put("sign", sign);String userToken = null;// 执行 httpClient 调用, 请参考:生成userToken 接口文档CloseableHttpClient httpClient = HttpClients.createDefault();CloseableHttpResponse httpResponse = null;try {HttpPost httpPost = new HttpPost(url);httpPost.setHeader("Content-Type", "application/json;charset=UTF-8");// 创建 HttpPost 参数Gson gson = new Gson();StringEntity stringEntity = new StringEntity(gson.toJson(body), "UTF-8");httpPost.setEntity(stringEntity);httpResponse = httpClient.execute(httpPost);String content = EntityUtils.toString(httpResponse.getEntity(), StandardCharsets.UTF_8);Map<String, String> resMap = gson.fromJson(content, new TypeToken<Map<String, String>>() {}.getType());// 获取 userToken 并返回userToken = resMap.get("data");} catch (Exception e) {} finally {try {if (httpResponse != null) {httpResponse.close();}} catch (IOException e) {e.printStackTrace();}try {if (httpClient != null) {httpClient.close();}} catch (IOException e) {e.printStackTrace();}}return userToken;}
}

3、常见问题和解决方案

  • e9集成,访问地址
  • e10集成,访问地址
http://www.dtcms.com/a/294933.html

相关文章:

  • Nestjs框架: 基于Prisma的多租户功能集成和优化
  • 使用抓取 API 可靠高效地提取亚马逊 (Amazon)数据
  • CCD工业相机系统设计——基于FPGA设计
  • SQL执行顺序
  • LLM 隐藏层特征增强技术
  • 同步型降压转换器的“同步”是什么意思?
  • Vite 7.0 引入的几个重要新 API 详解
  • 三极管与场效应管的对比
  • Python脚本服务器迁移至K8S集群部署
  • k8s中的configmap存储
  • JavaWeb-Servlet
  • 内外网互传文件 安全、可控、便捷的跨网数据交换
  • 服务器版本信息泄露-iis返回包暴露服务器版本信息
  • Node.js 倒计时图片服务部署与 Nginx 反向代理实战总结
  • RCE随笔-奇技淫巧(2)
  • Android热修复实现方案深度分析
  • AI面试如何提升物流行业招聘效率?实战案例解析
  • ESP32-S3学习笔记<5>:SPI的应用
  • JDK 介绍与使用指南
  • CMake进阶:检查头文件存在性(check_include_file 和 check_include_fileCXX)
  • uniapp拦截返回事件
  • 应该切换到 NVMe 吗?
  • 学习 Pandas 库:Series 与 DataFrame 核心操作指南
  • c语言:预处理详解
  • CRMEB 单商户PRO多商户通用去版权教程
  • 二叉树解析
  • 51c大模型~合集158
  • RockyLinux 9.6 解决删除home后无法开机问题
  • 视觉BPE统一多模态理解-北大
  • Python+大模型 day03