search

Home  >  Q&A  >  body text

The submission address I filled in is checkLogin, why is index submitted?

Why are you reporting such an error to me

[0] HttpException in App.php line 590

##Method does not exist: app\index\ controller\User->index()

The code is as follows:

$(function () {

$('#loginbtn').on('click', function (event) {
$.ajax({
type:'POST',//Set the request method to submit data
url:"{:url('ckeckLogin')}",//Set Data submission path
data:$('form').serialize(),//Serialize the form data and submit it
dataType:'json',
success:function (data) {//data It is a Map collection corresponding to the method return in PHP, passed in json format
                    });
           );


#

你哟你哟2473 days ago1626

reply all(4)I'll reply

  • 轻微强迫症

    轻微强迫症2018-05-24 20:52:10

    Isn’t the url submitted to the checkLogin method in User.php? Why does the source code become the /index.php/index/user/checklogin.html file

    5GGMB$FM]VU3XA@%ZS~VK_S.jpg

    reply
    0
  • 你哟

    你哟2018-03-07 12:41:24

    It is correct to view the source code of the web page!

    $(function () {

    $('#loginbtn').on('click',function (event) {

    $.ajax({

    type:'POST',//Set the request method for submitting data

    url:"/index.php/index/user/checklogin.html",//Set the data submission path

    data:$('form').serialize(),//Serialize the form data and submit it

    dataType:'json',

    success:function (data)

    });

    })

    })


    reply
    0
  • 换个网名

    You can write the actual address in url: and then check whether the redirected url is correct?

    换个网名 · 2018-03-07 12:50:33
    你哟

    I have solved the problem, the submit button is not cleared

    你哟 · 2018-03-07 15:11:55
  • Cancelreply