防止split没有切割的变量报错 var getSocketUrl = localStorage.getItem("socketUrl"); getSocketUrl = getSocketUrl && getSocketUrl.split("//")[1];