|
版本: |
X5.2.7 |
小版本号: |
|
|
|
数据库: |
MySQL |
服务器操作系统: |
Windows |
应用服务器: |
Tomcat |
客户端操作系统: |
Windows 7 |
浏览器: |
IE8 |
|
|
本帖最后由 boolean 于 2015-12-25 20:31 编辑
需求:需要在经典页面门户头部放一个切换默认账号按钮,或和代理下拉人员列表一样。点击用户名能在当前index.w页面切换为选择的用户首页。
方案代码:
var username=$("#username_input").val();
var password=$("#password_input").val();
password = hex_md5(password);
var param = {};
if(username!="null"){
$.jpolite.Data.system.User.login(name, key, null, param, function(data){
if(data.status){
$.cookie("justep-username", username, {expires:7,path:'/'});
var _index = window.location.href.indexOf("?");
var url = window.location.href.substring(0, _index) + "?timestamp=" + new Date().valueOf();
window.location.href = url;
}
});
}
测试结果:Chrome、Firefox、IE9 10 11等版本可以正常切换,IE8兼容非兼容模式都不能切换,且跳转到了登录页面。
控制台消息:
2015-12-25 20:10:16 [Action Time]action执行时间:5ms,/SA/OPM/system/systemProcess,mainActivity,getAgentListAction
index.java----com.justep.portal.bean.system.ContextBean@1f5329f---isLogin==true
2015-12-25 20:10:16 [Action Time]action执行时间:12ms,/SA/OPM/system/systemProcess,mainActivity,getProcessAction
2015-12-25 20:10:16 [Action Time]action执行时间:5ms,/SA/OPM/system/systemProcess,mainActivity,getClientAppsAction
2015-12-25 20:10:16 [Action Time]action执行时间:9ms,/SA/theme/portalProfiles/portalProfilesProcess,mainActivity,selectPortalProfilesAction
2015-12-25 20:10:16 [Action Time]action执行时间:9ms,/SA/theme/themeUse/themeUseProcess,mainActivity,getThemeDefineAction
2015-12-25 20:10:16 [Action Time]action执行时间:9ms,/SA/OPM/system/systemProcess,mainActivity,getProcessAction
2015-12-25 20:10:16 [Action Time]action执行时间:5ms,/SA/OPM/system/systemProcess,mainActivity,getClientAppsAction
2015-12-25 20:10:16 Not registed session:85652D6EFDF4E66995E1A81E2949FBC3, jsessionid:JSESSIONID=51321B1C9645367B0C49A28471B3FD45, action: <?xml version="1.0" encoding="UTF-8"?>
<action direct-execute="true" process="/CommonPlatform/doorPlatfrom/process/doorPlatfrom/doorPlatfromProcess" activity="fastLink" action-flag="__action_0__" executor="" execute-context="" name="closeActivityAction"/>
2015-12-25 20:10:16 [Action Time]action执行时间:43ms,/SA/OPM/system/systemProcess,mainActivity,logoutAction
|
|