当前位置:网站首页>Solution to the problem of multi application routing using thinkphp6.0

Solution to the problem of multi application routing using thinkphp6.0

2022-06-26 07:17:00 Official account small tutorial

Source of problem : When we are developing the project , Front end applications are usually created 、 Back end applications 、API application ....... I'm lucky this time , Just finish the backend +API Just the module , So I use thinkphp6.0+layui Developed a back-end , Encountered a multi Application module routing problem ; If you have the same problem , I hope I can help you

The project structure is like this :
image.png

API The routing of the module is as follows ( There are some errors in the following routing settings ):
image.png

Let's verify whether the route is set successfully , Output the following results in the browser :
image.png

Careful students should find that , Use
Route::post('register', '/register'); There is a problem , It is recommended to use Route::any( Various debugging problems have not been solved , This card took me all afternoon . You can see this , I hope I can help you )
Because of the above problems , I'll go to the title :thinkphp3.2.3,thinkphp5.0,thinkphp5.1 Have a look ,thinkphp6 Of course, I didn't miss it , Hard pressed brick man ( I ), Only then had the following writing content : Please skip this article .
thinkphp3.2
image.png
thinkphp5.0+
image.png
thinkphp5.1+
image.png
Last , Remember to use composer Download multi Application module : composer require topthink/think-multi-app

If you have any questions, you can ask me

Well written, remember to collect some praise , Thank you for your patience !

原网站

版权声明
本文为[Official account small tutorial]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202171155247517.html

随机推荐