# encryptRequestParams
加密请求参数
# 调用方式
encryptRequestParams(params = {})
1
返回 Promise,使用 then/catch 或 await 处理结果。 可省略参数对象,此时传入空对象;不额外接收位置形式的成功/失败回调。
# 请求参数
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| password | String | Y | - | 待加密的明文密码字符串 |
| loginId | String | Y | - | 登录人的id |
# 接口调用示例
const input = 'example-input'
const params = { password: input, loginId: 'example-id' }
this.$bridge.encryptRequestParams(params)
.then(res => {
console.log(res)
})
.catch(error => {
console.error(error)
})
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
# 返回参数
返回 Promise;原生返回数据的字段由宿主决定,当前 JS 封装未限定完整结构。
# 注意事项
采用旧 msmartlifeModule 文档的 password/loginId 参数约定。另一份旧文档使用 text/isLogin 加密用户 ID;当前 JS 仅转发参数,无法证明两组字段可互换,需由宿主原生确认后使用。