如果用户的id没有获取到,跳转到登录页面

This commit is contained in:
qiankunpingtai
2019-03-20 16:48:33 +08:00
parent ebfd470558
commit 2dd654b3b3

View File

@@ -15,6 +15,16 @@ HROS.app = (function(){
},
get : function(){
var userId = sessionStorage.getItem("userId");
/**
* create by: qiankunpingtai
* create time: 2019/3/20 16:26
* description:
*如果用户的id没有获取到跳转到登录页面
*/
if(userId==undefined||userId==null){
top.location.href = "http://" + location.host + "/login.html";
return;
}
$.getJSON('../../app/findAppByUserId?userId=' + userId, function (sc) {
HROS.VAR.dock = sc['dock'];
HROS.VAR.desk = sc['desk'];