Appearance
设置cookie
方法名
setCookie
用法
示例
js
this.$refs.refLevenUtsWebview.setCookie({
//名称,必须
name: this.form.name,
//值,必须
value: this.form.value,
//域名,必须
domain: this.form.domain,
//存活时间,单位:秒,默认:86400
maxAge: this.form.maxAge,
//路径,默认:/
path: this.form.path
}, res => {
console.log("设置cookie:" + JSON.stringify(res))
})参数说明
| 参数名 | 参数类型 | 是否必填 | 默认值 | 参数描述 |
|---|---|---|---|---|
| name | String | 是 | 无 | cookie名称 |
| value | String | 是 | 无 | cookie的值 |
| domain | String | 是 | 无 | 域名 |
| maxAge | Integer | 否 | 86400 | cookie存活时间,单位:秒 |
| path | String | 否 | / | 域名路径 |
回调
示例
json
{
"message": "",
"code": 0,
"data": {}
}回调说明
| 参数名 | 参数类型 | 参数描述 |
|---|---|---|
| message | String | 消息提示 |
| data | Object | 数据对象 |
| code | Integer | 返回类型,0.成功,其他:失败 |
