清除指定店铺在本机外壳中的本地缓存,可选同步清除 Cookie。
基本信息
Path: /clearEnvCache
Method: POST
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
storeId / id | number/string | 是 | 店铺 ID。 |
clearCookie | boolean | 否 | 是否在清除本地缓存后同时清除 Cookie,默认 false。 |
cookieOptions | object | 否 | 清除 Cookie 的附加参数,会透传给 clearStoreCookie。 |
补充说明
该能力依赖外壳提供 managerClearStoreCache,不支持时返回 managerClearStoreCache is not supported。
clearCookie=true 时,cookieOptions 会覆盖默认 Cookie 参数。
请求示例
{
"method": "clearEnvCache",
"storeId": 10001,
"clearCookie": true,
"cookieOptions": {
"urls": [],
"cookieContext": "",
"type": "extension"
}
}
成功返回示例
{
"method": "clearEnvCache",
"response": {
"code": 200,
"msg": "success",
"clearCookie": true,
"data": {
"code": 200,
"message": "success"
}
}
}
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
response.code | number | 200 表示清除成功。 |
response.clearCookie | boolean | 是否执行了 Cookie 清除。 |
response.data | any | 外壳返回的原始结果。 |
失败返回示例
{
"method": "clearEnvCache",
"status": "error",
"code": "400",
"msg": "managerClearStoreCache is not supported"
}