|
楼主 |
发表于 2016-2-17 16:44:22
|
显示全部楼层
1. 我把该action放到功能页面里去测试,提示错误信息
2. 在index.js中的代码
Model.prototype.afterLogin = function(){
var context = this.getContext();
this.customizer = new Customizer(context.data.layout, context);
this.initTheme();
var me = this, pages = this.comp('pages');
this.isDebugMode = context.isDebug();
if(this.isDebugMode){
$("#portal-reload").show();
}
$(".page-header-inner .page-logo .menu-toggler").show();
$(".page-header-inner .top-menu").show();
//初始化用户名
var userName = context.getCurrentPersonName();
$("#username").html(userName);
//初始化功能树
this.createFunctionTree();
this.openeds = {};
this.current = this.openeds[mainPageId] = {title: '首页', pid: mainPageId};
//加载主页面
this.openPage({
url: this.getURL(mainPage),
xid: mainPageId
}, {title: '首页'});
//初始当前页
var current = getParameter('current');
if(current && current.path){
var path = current.path;
delete current.path;
this.openPage(path, current);
}else if(current){
this.openPage(current);
}
//初始化代理
var agentList = context.data.agentList;
if(agentList && agentList.value && agentList.value.length > 0){
var agents = context.data.agentList.value;
var html = [];
for(var i=0; i<agents.length; i++){
var agent = agents;
var s = justep.String.format('<li><a data-executor="{0}">{1}</a></li>', agent.id, agent.name);
html.push(s);
}
$('#portal-agent .dropdown-menu').append(html.join(''));
var me = this;
$("#portal-agent").show().click(function(e){
var executor = $(e.target).data("executor");
executor && me.openAgent(executor);
});
}
this.getLoginInfo();
};
//取得登陆者信息
Model.prototype.getLoginInfo = function(event) {
var personData = this.comp('personData');
var params = new biz.Request.ActionParam();
//alert(this.getContext().getCurrentPersonCode());
params.setString("ygkh", '20112041');
biz.Request.sendBizRequest({
"context" : this.getContext(),
"action" : "getLoginInfo",
"parameters" : params,
"callback" : function(resultData) {
resultData.ignoreError = false;
if (resultData.state) {
personData.loadData(resultData.response);
personData.refreshData();
alert(personData.count());
} else {
throw new Error('取得登陆者信息失败!');
}
}
});
if(personData.count() === 1){
alert('succ');
//localStorage.setItem('');
}else{
alert('shibai!');
// justep.Portal.logout();
}
};
|
-
|