81,122
社区成员




<form>
<div class="x_input">
<p><input name="userCode" value="" type="text" id="user.USER_CODE" style="font-size:12px; font-family:Arial;" />
</p>
<p style="margin-top:4px;"><input name="password" value="" type="password" id="user.PASSWORD" style="font-size:12px; font-family:Arial;" >
<span style="margin-left:12px;">
<input id="SubId" type="button" onclick="login();" onkeypress="login();" style="width: 67px; height: 22px; background: url(images/x_login.png); border: 0px;"/>
</span>
</p>
</div>
</form>
<script type="text/javascript">
function login(){
var userCode=document.all.userCode.value;
var password=document.all.password.value;
Ext.Ajax.request({
method:'POST',
url:'loginUser',
params:{"user.USER_CODE":userCode,"user.PASSWORD":password},
success:function(response, options){
var respText = Ext.util.JSON.decode(response.responseText);
if(respText.msg=="登录成功!"){
var data = respText.data;
var userName=respText.userName;
var userId=respText.userId;
var topicNames = new Array();
var topicIds = new Array();
if (typeof(data) != "undefined" && data.length > 0)
{
for(var i=0;i<data.length;i++)
{
topicNames.push(data[i]["topic_name"]);
topicIds.push(data[i]["topic_id"]);
}
}
var f=document.createElement("form");
f.action=rootPath+"/IasManager.jsp";
f.method="post";//指定为post
f.innerHTML="<input type='hidden' name='userName' value='"+userName+"'/>;"+
"<input type='hidden' name='userId' value='"+userId+"'/>;"+
"<input type='hidden' name='topicNames' value='"+topicNames+"'/>;"+
"<input type='hidden' name='topicIds' value='"+topicIds+"'/>";
document.appendChild(f);
f.submit();
} else{
Ext.MessageBox.minWidth = 150;
Ext.Msg.alert('提示',respText.msg);
}
},
failure:function(response, options){
Ext.MessageBox.minWidth = 120;
Ext.Msg.alert('提示','操作失败。');
}
});
}
</script>