1layui.use(['form'], function () { 2 3 var form = layui.form, 4 $ = layui.$; 5 6 form.verify({ 7 email: function(value) { 8 value = $.trim(value); 9 var reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; 10 if(reg.test(value)){ 11 }else{ 12 return 'E-mail format input error!'; 13 } 14 }, 15 pwd:function(value){ 16 value = $.trim(value); 17 var pwd = /^[\w\W]{6,20}$/; 18 if(pwd.test(value)){ 19 }else{ 20 return 'Password input 6-20 characters!'; 21 } 22 }, 23 checkemail:function(value){ 24 var msg; 25 $.ajax({ 26 url:'/login/doCheckemail', 27 type: "POST", 28 contentType: "application/json", 29 dataType: "json", 30 async: false, 31 data:JSON.stringify({email:value}), 32 beforeSend:function () { 33 34 }, 35 success:function(data){ 36 console.log(data); 37 if(data.code==-1){ 38 msg=data.msg; 39 } 40 } 41 }) 42 return msg; 43 }, 44 equalTo:function(value){ 45 var cpwd = $("#register_div input[name=pwd]").val(); 46 if(cpwd!==value){ 47 return 'Password input is inconsistent!'; 48 } 49 }, 50 }); 51 52 form.on("submit(submitReg)", function (data) { 53 $.ajax({ 54 url:'/login/doReg', 55 type: "POST", 56 contentType: "application/json", 57 dataType: "json", 58 async: false, 59 data:JSON.stringify(data.field), 60 beforeSend:function () { 61 62 }, 63 success:function(res){ 64 if(res.code==0){ 65 layer.msg(res.msg, {icon: 1, time: 500}, function () { 66 var href=$("input[name=gobackurl]").val(); 67 window.location=href; 68 }); 69 }else{ 70 layer.msg(res.msg,{icon:5}); 71 return false; 72 } 73 } 74 }) 75 }); 76 form.on("submit(submitLogin)", function (data) { 77 $.ajax({ 78 url:'/login/doLogin', 79 type: "POST", 80 contentType: "application/json", 81 dataType: "json", 82 async: false, 83 data:JSON.stringify(data.field), 84 beforeSend:function () { 85 86 }, 87 success:function(res){ 88 console.log(res); 89 if(res.code==0){ 90 layer.msg(res.msg, {icon: 1, time: 500}, function () { 91 window.location=res.data.gourl; 92 }); 93 }else{ 94 layer.msg(res.msg,{icon:5}); 95 return false; 96 } 97 } 98 }) 99 }); 100})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.