smartClient isomorphic 로그인 (1)

3542 단어 smartClientisomorphic
/**
 *---------------------------------------------------------------------
 *  Function     :     
 *	Version	     : 1.0
 *  Date         : 2012-4-9
 *  Descriptions :   
 *---------------------------------------------------------------------	 
 */

isc.SearchForm.create({
	ID:'loginForm',
	width:200,
	numCols:2,
	autoFocus:true,
	requiredTitlePrefix:'<font color="red">*</font><b>',
	fields:[
	   {name:'account',title:'  ',length:80,height:25},
	   {name:'password',title:'  ',length:80,type:'password',height:25},	
	   {name:'checkCode',title:'   ',length:4,icons:[{src:'../check/checkCode.do',click:function(){
		   loginForm.getField("checkCode").setValueIcons("../check/checkCode.do");
	   },height:25}],iconWidth:55,height:25}
	]
});
isc.Dialog.create({
	ID:'loginDlog',
	title:'  ',
	width:200,
	autoSize:true,
	showCloseButton:false,
	canDragReposition:false,
	items:[
	    loginForm
	],
	buttons:[
	   isc.Button.create({title:'  '})
	],
	buttonClick:function(btn,index){
		var data=loginForm.getValues();
		RPCManager.sendRequest({ 
	    	 evalResult:true,
	    	 //data:data,
	    	 //paramsOnly:true,
	    	 params:data,
	    	 //data:{'account':credentials.username,'password':credentials.password},
	    	 actionURL: "user/login.do",
	    	 callback:function(data){
	    		 if(data.status==isc.RPCResponse.STATUS_SUCCESS){
	    			var data=data.data;
	 	    		if(data.success){
	 	    			window.location.href="index.jsp";
	 	    		}else{
	 	    			if(data.msg!=null){
	 	    				isc.say(data.msg);
	 	    			}
	 	    		}
	    		 }else{
	    			 isc.say('        ',window.location='login.jsp');
	    		 }
	     }});
	}
});

isc.Page.setEvent("load", "loginDlog.show()");

/*isc.LoginDialog.create({
	title:'    ',
 	loginButtonTitle:'  ',
 	usernameItemTitle:'  ',
 	passwordItemTitle:'  ',
 	numCols:2,
 	loginFunc:function (credentials, dialogCallback) {
	     if (credentials == null) return; // dismissed
	     var data={'account':credentials.username,'password':credentials.password};
	     
	     RPCManager.sendRequest({ 
	    	 evalResult:true,
	    	 //data:data,
	    	 //paramsOnly:true,
	    	 params:{'account':credentials.username,'password':credentials.password},
	    	 //data:{'account':credentials.username,'password':credentials.password},
	    	 actionURL: "user/login.do",
	    	 callback:function(data){
	    		 if(data.status==isc.RPCResponse.STATUS_SUCCESS){
	    			var data=data.data;
	 	    		if(data.success){
	 	    			window.location.href="index.jsp";
	 	    		}else{
	 	    			if(data.msg!=null){
	 	    				isc.say(data.msg);
	 	    			}
	 	    		}
	    		 }else{
	    			 isc.say('        ',window.location='login.jsp');
	    		 }
	     }});
    }
 });*/

좋은 웹페이지 즐겨찾기