Appearance
配置 VPN
方法名
setVpnProfile
用法
- 用法如下:js
module.setVpnProfile({ params: { key: "", ipsecCaCert:"", ipsecIdentifier:"", isMppeEnabled:false, name:"", type:1, password:"", ipsecServerCert:"", ipsecSecret:"", server:"", ipsecUserCert:"", l2tpSecret:"", username:"" }, complete: (res) => { console.log(res) } })jsmodule.setVpnProfile({ params: { key: "", ipsecCaCert:"", ipsecIdentifier:"", isMppeEnabled:false, name:"", type:1, password:"", ipsecServerCert:"", ipsecSecret:"", server:"", ipsecUserCert:"", l2tpSecret:"", username:"" }, complete: (res : LevenResult) => { console.log(res) } } as LevenOptions) - 参数说明
参数名 参数类型 是否必填 默认值 参数描述 params Object 是 无 接口请求参数 params.key String 是 无 VPN 的唯一标识 params.ipsecCaCert String 是 无 IPSec CA 证书 params.ipsecIdentifier String 是 无 IPSec 标识符 params.isMppeEnabled Boolean 是 无 是否 PPP 加密 params.name String 是 无 VPN 的名称 params.type Integer 是 无 VPN 的类型,有效范围 0-6 0:TYPE_PPTP1:TYPE_L2TP2:TYPE_L2TP_IPSEC_PSK3:TYPE_L2TP_IPSEC_RSA4:TYPE_IPSEC_XAUTH_PSK5:TYPE_IPSEC_XAUTH_RSA6:TYPE_IPSEC_HYBRID_RSAparams.password String 是 无 密码 params.ipsecServerCert String 是 无 IPSec 服务器证书 params.ipsecSecret String 是 无 IPSec 预共享密钥 params.server String 是 无 服务器名称 params.ipsecUserCert String 是 无 IPSec 用户证书 params.l2tpSecret String 是 无 L2TP 密钥 params.username String 是 无 用户名 success Function 否 无 执行成功的函数 fail Function 否 无 执行失败的函数 complete Function 否 无 执行完成的函数,不管成功还是失败都会执行
回调
- 示例json
{ "data": { "result":true }, "message": "", "code": 0 } - 回调说明:
参数名 参数类型 参数描述 message String 消息提示 data Object 数据对象 data.result Boolean true:配置成功,false:配置失败 code Integer 返回类型,0.成功,其他:失败

