通过 gRPC-web 与后端服务交互,并使用 Authenticate 类进行身份验证和签名验证
构造函数
包含代理地址和区块地址信息的配置选项
const providerOption = { proxy: 'http://proxy.example.com', blockAddress: { identifier: 'example-did', privateKey: 'example-private-key' } }const supportProvider = new SupportProvider(providerOption) Copy
const providerOption = { proxy: 'http://proxy.example.com', blockAddress: { identifier: 'example-did', privateKey: 'example-private-key' } }const supportProvider = new SupportProvider(providerOption)
创建 FAQ 元数据,签名并发送请求到后端服务
问题类型
用户邮箱
问题描述
返回收集 FAQ 的响应体
supportProvider.collectFaq('type', 'user@example.com', 'This is a question') .then(response => console.log(response)) .catch(err => console.error(err)) Copy
supportProvider.collectFaq('type', 'user@example.com', 'This is a question') .then(response => console.log(response)) .catch(err => console.error(err))
通过 gRPC-web 与后端服务交互,并使用 Authenticate 类进行身份验证和签名验证