检查是否登录,没有登录就弹出登录框
let userId = dsf.getCookie('userId');
if (!userId) {
window.parent.openLogin();
return;
}
var userId = dsf.getCookie('userId');
if (!userId) {
console.log(' dsf.layer.openDialog');
dsf.layer.openDialog({
title: '',
area: ['440px', '430px'],
content: dsf.url.getWebPath('nc/pc/logins/views/login.html'),
dialogLoaded: function(layero, index, win) {},
});
return;
}
//多个地方需要判断时
if (!this.isLogin()) {
return;
}
//登录权限
isLogin() {
let uId = dsf.getCookie("userId");
if (!uId) {
window.parent.openLogin(function () {
dsf.layer.openDialog({
title: "",
area: ["440px", "430px"],
content: dsf.url.getWebPath("nc/pc/logins/views/login.html"),
dialogLoaded: function (layero, index, win) {},
});
});
return false;
}
return true;
}