有域名了怎么做网站,做生意在哪个网站做,企业网站的建设 任务书,巨鹿县住房与城乡建设厅网站之前一直想sso接口已经写好了#xff0c;登录注册功能是怎么调用的呢#xff1f;原来在登录注册的jsp页面实现的接口的调用#xff0c;页面的校验和验证功能在jsp页面即可实现。 注册页面#xff1a; % page languagejava contentTypetext/html; cha…之前一直想sso接口已经写好了登录注册功能是怎么调用的呢原来在登录注册的jsp页面实现的接口的调用页面的校验和验证功能在jsp页面即可实现。 注册页面 % page languagejava contentTypetext/html; charsetUTF-8 pageEncodingUTF-8%
% page trimDirectiveWhitespacestrue %
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html xmlnshttp://www.w3.org/1999/xhtml
headmeta http-equivpragma contentno-cachemeta http-equivCache-Control contentno-cache,must-revalidatetitle注册-个人用户/titlelink typetext/css relstylesheet href/css/regist.personal.css/link typetext/css relstylesheet href/css/passport.base.css/script typetext/javascript src/js/jquery-1.6.4.js/script
/head
body
div classw idlogodiva hrefhttp://localhost:8082img src/images/taotao-logo.gif alt淘淘商城 width170 height60//a b/b/div
/divdiv classw idregistdiv classmtul classtabli classcurr个人用户/li/uldiv classextraspan我已经注册现在就 a href/page/login classflk13登录/a/span/div/divdiv classmcform idpersonRegForm methodpost οnsubmitreturn false;div classform onselectstartreturn false;div classitem idselect-regNamespan classlabelb classftx04*/b用户名/spandiv classfl item-ifodiv classo-intelligent-regNameinput typetext idregName nameusername classtext tabindex1 autoCompleteoffοnpastereturn false;valueοnfοcusif(this.value) this.value;this.style.color#333οnblurif(this.value) {this.value;this.style.color#999999}/i classi-name/iul idintelligent-regName classhide/ullabel idregName_succeed classblank/labellabel idregName_error classhide/label/div/div/divdiv ido-passworddiv classitemspan classlabelb classftx04*/b请设置密码/spandiv classfl item-ifoinput typepassword idpwd namepassword classtext tabindex2styleime-mode:disabled;οnpastereturn false autocompleteoff/i classi-pass/ilabel idpwd_succeed classblank/labellabel idpwd_error/labelspan classclr/span/div/divdiv classitemspan classlabelb classftx04*/b请确认密码/spandiv classfl item-ifoinput typepassword idpwdRepeat namepwdRepeat classtext tabindex3οnpastereturn false autocompleteoff/i classi-pass/ilabel idpwdRepeat_succeed classblank/labellabel idpwdRepeat_error/label/div/divdiv classitem iddphonespan classlabelb classftx04*/b验证手机/spandiv classfl item-ifoinput typetext idphone maxlength11 namephoneclasstext tabindex4autocompleteoff / i classi-phone/i labelidphone_succeed classblank/label labelidphone_error/label/div/div/divdiv classitem item-newspan classlabel /spandiv classfl item-ifoinput typecheckbox classcheckbox checkedchecked idreadmeοnclickagreeonProtocol();label forprotocol我已阅读并同意a href# classblue idprotocol《淘淘用户注册协议》/a/labelspan classclr/spanlabel idprotocol_error classerror hide请接受服务条款/label/div/divdiv classitemspan classlabel /spaninput typebutton classbtn-img btn-regist idregistsubmit value立即注册 tabindex8clstagregist|keycount|personalreg|07οnclickREGISTER.reg();//div/divdiv classphoneimg width180 height180 src/images/phone-bg.jpg/divspan classclr/span/form/div
script typetext/javascriptvar REGISTER{param:{//单点登录系统的urlsurl:},inputcheck:function(){//不能为空检查if ($(#regName).val() ) {alert(用户名不能为空);$(#regName).focus();return false;}if ($(#pwd).val() ) {alert(密码不能为空);$(#pwd).focus();return false;}if ($(#phone).val() ) {alert(手机号不能为空);$(#phone).focus();return false;}//密码检查if ($(#pwd).val() ! $(#pwdRepeat).val()) {alert(确认密码和密码不一致请重新输入);$(#pwdRepeat).select();$(#pwdRepeat).focus();return false;}return true;},beforeSubmit:function() {//检查用户是否已经被占用$.ajax({ //这是校验的接口调用通过接口中的url来实现的url : REGISTER.param.surl /user/check/escape($(#regName).val())/1?r Math.random(),success : function(data) {if (data.data) {//检查手机号是否存在$.ajax({url : REGISTER.param.surl /user/check/$(#phone).val()/2?r Math.random(),success : function(data) {if (data.data) {REGISTER.doSubmit();} else {alert(此手机号已经被注册);$(#phone).select();}}});} else {alert(此用户名已经被占用请选择其他用户名);$(#regName).select();} }});},doSubmit:function() {//这是注册的接口通过注册接口的URL来实现的调用$.post(/user/register,$(#personRegForm).serialize(), function(data){if(data.status 200){alert(用户注册成功请登录);REGISTER.login();} else {alert(注册失败);}});},login:function() {location.href /page/login;return false;},reg:function() {if (this.inputcheck()) {this.beforeSubmit();}}};
/script
/body
/html登录页面 % page languagejava contentTypetext/html; charsetUTF-8 pageEncodingUTF-8%
% page trimDirectiveWhitespacestrue %
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html xmlnshttp://www.w3.org/1999/xhtml
headmeta http-equivContent-Type contenttext/html; charsetgb2312/title登录淘淘/titlelink typetext/css relstylesheet href/css/login.css/script typetext/javascript src/js/jquery-1.6.4.js/script
/head
body
div classwdiv idlogoa hrefhttp://localhost:8082 clstagpassport|keycount|login|01img src/images/taotao-logo.gif alt淘淘 width170 height60//ab/b/div
/div
form idformlogin methodpost οnsubmitreturn false;div class w1 identrydiv classmc idbgDivdiv identry-bg clstagpassport|keycount|login|02 stylewidth: 511px; height: 455px; position: absolute; left: -44px; top: -44px; background: url(/images/544a11d3Na5a3d566.png) 0px 0px no-repeat;/divdiv classform div classitem fore1span用户名/spandiv classitem-ifoinput typetext idloginname nameusername classtext tabindex1 autocompleteoff/div classi-name ico/divlabel idloginname_succeed classblank invisible/labellabel idloginname_error classhideb/b/label/div/divscript typetext/javascriptsetTimeout(function () {if (!$(#loginname).val()) {$(#loginname).get(0).focus();}}, 0);/scriptdiv idcapslocki/is/s键盘大写锁定已打开请注意大小写/divdiv classitem fore2span密码/spandiv classitem-ifoinput typepassword idnloginpwd namepassword classtext tabindex2 autocompleteoff/div classi-pass ico/divlabel idloginpwd_succeed classblank invisible/labellabel idloginpwd_error classhide/label/div/divdiv classitem login-btn2013input typebutton classbtn-img btn-entry idloginsubmit value登录 tabindex8 clstagpassport|keycount|login|06//div/div/divdiv classfree-registspana href/page/register clstagpassport|keycount|login|08免费注册/a/span/div/div
/form
script typetext/javascriptvar redirectUrl ${redirect};var LOGIN {checkInput:function() {if ($(#loginname).val() ) {alert(用户名不能为空);$(#loginname).focus();return false;}if ($(#nloginpwd).val() ) {alert(密码不能为空);$(#nloginpwd).focus();return false;}return true;},doLogin:function() {//这里是一样的功能调用登录的接口来实现的$.post(/user/login, $(#formlogin).serialize(),function(data){if (data.status 200) {alert(登录成功);if (redirectUrl ) {location.href http://localhost:8082;} else {location.href redirectUrl;}} else {alert(登录失败原因是 data.msg);$(#loginname).select();}});},login:function() {if (this.checkInput()) {this.doLogin();}}};$(function(){$(#loginsubmit).click(function(){LOGIN.login();});});
/script
/body
/html转载于:https://www.cnblogs.com/fengli9998/p/6403418.html