* @private * @function WebMap.prototype.getCookie * @description 获取cookie中某个key对应的值 * @returns {string} 某个key对应的值
(key)
| 5527 | * @returns {string} 某个key对应的值 |
| 5528 | */ |
| 5529 | getCookie(key) { |
| 5530 | key = key.toLowerCase(); |
| 5531 | let value = null; |
| 5532 | let cookies = document.cookie.split(';'); |
| 5533 | cookies.forEach(function (cookie) { |
| 5534 | const arr = cookie.split('='); |
| 5535 | if (arr[0].toLowerCase().trim() === key) { |
| 5536 | value = arr[1].trim(); |
| 5537 | return; |
| 5538 | } |
| 5539 | }); |
| 5540 | return value; |
| 5541 | } |
| 5542 | /** |
| 5543 | * @private |
| 5544 | * @function WebMap.prototype.formatCookieLang |
no test coverage detected