Files
airport-chengdu-web/src/app/utils/get-cookie.ts
T

14 lines
387 B
TypeScript
Raw Normal View History

2018-10-26 11:33:25 +08:00
//获取cookie
export default function (name) {
name = name + "="
var start = document.cookie.indexOf(name),
value = null;
if (start > -1) {
var end = document.cookie.indexOf(";", start);
if (end == -1) {
end = document.cookie.length;
}
value = document.cookie.substring(start + name.length, end);
}
return value;
}