jQuery¼¼Êõ

ʹÓÃjQuery,AngularʵÏֵǼ½çÃæÑéÖ¤ÂëÏê½â(2)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-05-03 18:07 ÎÒÒªÆÀÂÛ( )

jq²¿·ÖдµÄÏêϸһµã£¬ÕâÀïҲͦÏêϸµÄ£¬Èç¹û²»¶®µÄ»°£¬¿ÉÒÔ»ØÍ·¿´¿´jq²¿·Ö£¬Ô­Àí¶¼ÊÇÒ»ÑùµÄ£¬¸´ÖƵ½±¾µØ×Ô¼º¶àÊÔÊÔ¡£ var enter=angular.module("myApp");enter.controller('enterCtrl',['$scope','$http','$state',

jq²¿·ÖдµÄÏêϸһµã£¬ÕâÀïҲͦÏêϸµÄ£¬Èç¹û²»¶®µÄ»°£¬¿ÉÒÔ»ØÍ·¿´¿´jq²¿·Ö£¬Ô­Àí¶¼ÊÇÒ»ÑùµÄ£¬¸´ÖƵ½±¾µØ×Ô¼º¶àÊÔÊÔ¡£

var enter=angular.module("myApp"); enter.controller('enterCtrl',['$scope','$http','$state',function ($scope,$http,$state) { $scope.changeVerify=function () {//¶¨ÒåÁËÒ»¸öµã»÷ʼþ£¬»ñÈ¡ÑéÖ¤Âë var authCode=""; var authCodeLength=4;//È¡¼¸¸öËæ»úÊý×Ö var randomArray=[0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R', 'S','T','U','V','W','X','Y','Z']; for(var i=0;i<authCodeLength;i++){ var index=Math.floor(Math.random()*36);//Ëæ»úȡһλÊý authCode +=randomArray[index];//È¡ËÄλÊý£¬²¢+ÏàÁ¬ } $scope.showAuthCode=authCode;//¸³Öµ console.log($scope.showAuthCode); }; //ÉÏÃæÊÇ·â×°µÄ»ñÈ¡ÑéÖ¤ÂëµÄº¯Êý£¬»áÔÚÏÂÃæ½øÐе÷Óà (function () { $scope.changeVerify();//µ÷Óõã»÷ʼþ¡£ $scope.enter=function (userName,userPsd) { //µã»÷µÇ¼°´Å¥Ê¼þ£¬½«Ë«Ïò°ó¶¨µÄÕ˺ÅÃÜÂëµ±×ö²ÎÊý´«È뺯Êý if ($scope.writeCode.toUpperCase() ==$scope.showAuthCode){//toUpperCase()½«Ð¡Ð´×ª»¯Îª´óд //Ë«Ïò°ó¶¨ÑéÖ¤ÂëÊäÈë¿ò£¬¿ÉÒÔÖ±½ÓʹÓã¬ÕâÀïÊÇÑéÖ¤ÑéÖ¤Âë $http({ method:"POST", url:"ÄãµÄ¿çÓòµØÖ·",//$httpµÄ¹Ì¶¨¸ñʽ params:{ "name":userName, "pwd":userPsd //Ë«Ïò°ó¶¨µÄ²ÎÊý´«µ½Ï¸öÒ³Ãæ } }).then(function (res) { //»ñÈ¡·þÎñÆ÷·µ»ØµÄ²ÎÊý console.log(res); if (res.data.code!==0){ //²ÎÊý²»Îª0µÄʱºò£¬µ¯³öÌáʾ alert(res.data.message); }else { //²ÎÊýΪ0µÄʱºò£¬ÌøתҳÃæ $state.go("home.studentList"); } }) }else { alert("ÑéÖ¤ÂëÊäÈë´íÎó¿©£¬¿©¿©¿©"); $scope.changeVerify();//ÑéÖ¤ºó£¬Ë¢ÐÂÑéÖ¤Âë } } }());

ºó»°

¶Ï¶ÏÐøÐøдÁËÁ½Ì죬ÏÖÔÚдµÄûÓÐ֮ǰÄÇô¿ìÁË¡£¡£²î²»¶à¾ÍÒÔÉÏÕâЩÄÚÈÝ£¬ÓÐÎÊÌâ¿ÉÔÚÆÀÂÛÇøÁôÑÔ¡£Óв»×㻶ӭָµ¼£¬ÅÄש¡£

ÒÔÉÏËùÊöÊÇС±à¸ø´ó¼Ò½éÉܵÄʹÓÃjQuery,AngularʵÏֵǼ½çÃæÑéÖ¤ÂëÏê½â£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú£¬Èç¹û´ó¼ÒÓÐÈκÎÒÉÎÊÇë¸øÎÒÁôÑÔ£¬Ð¡±à»á¼°Ê±»Ø¸´´ó¼ÒµÄ¡£ÔÚ´ËÒ²·Ç³£¸Ðл´ó¼Ò¶Ô½Å±¾Ö®¼ÒÍøÕ¾µÄÖ§³Ö£¡


¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • jquery»ñÈ¡Ñ¡ÖеÄselectÖµºÍÏÔʾÃû³Æ

    jquery»ñÈ¡Ñ¡ÖеÄselectÖµºÍÏÔʾÃû³Æ

    2017-05-04 08:00

  • ÀûÓÃjQuery Ajax¼¼ÊõʵÏÖÿ¸ô5ÃëÏòijҳÃæ´«Öµ£¬jqueryajax

    ÀûÓÃjQuery Ajax¼¼ÊõʵÏÖÿ¸ô5ÃëÏòijҳÃæ´«Öµ£¬jqueryajax

    2017-05-03 11:03

  • JqueryÁ´Ê½½á¹¹ÊµÏÖ·ÖÎö

    JqueryÁ´Ê½½á¹¹ÊµÏÖ·ÖÎö

    2017-05-03 10:01

  • appendToʹÓü¼ÇÉ.

    appendToʹÓü¼ÇÉ.

    2017-05-03 10:00

ÍøÓѵãÆÀ
Ä