Create another php file under the TP5 controller directory. The request from the front end is less than 404.

<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
header("Content-type:text/html;charset=utf-8");
header("Access-Control-Allow-Origin: *");   //

class UserExit extends Controller
{ 
    public function UserExit(){
        ......
    }  
}
?>

as in the code above, the structure of Login.php and UserExit.php is similar.
the front-end access login can be accessed, and the access to userexit is reported to 404.
the newcomer has just used TP5. I may not understand the configuration. I wonder if this needs to be matched again.

clipboard.png

clipboard.png

May.31,2022

what is the running environment? windows the case of url does not matter, but if the system of Linux needs to pay attention to the case of your url , you need to write as: / index/userExit/userExit

Menu